## 10211 - Divisibility Testing! Wow!

Moderator: Board moderators

10153EN
Experienced poster
Posts: 148
Joined: Sun Jan 06, 2002 2:00 am
Location: Hong Kong
Contact:

### 10211 - Divisibility Testing! Wow!

I have tired this problem but got wrong answer...

Could anyone tell me what's the base of the second input of each input set?

e.g. if the input is 16 20
then it means the base is 16
but the 20 means a decimal 20 or 20 of base 16?

Guru
Posts: 724
Joined: Wed Dec 19, 2001 2:00 am
Location: Germany
I havn't tried this problem yet, but I am absolutely sure that the second number is a decimal number, because in the description of the problem there is no definition how to write for example 97 in base 100, therefore the problem wouldn't be solvable.

Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden

### 10211 - "Divisibility Testing! Wow!!"

Could someone confirm or refute these outputs?

Input:

Code: Select all

``````439 2918
27 12
3 13
3141 592
10 6``````
Output:

Code: Select all

``````Add all 1458
Alternate 729 change sign

Andrey Mokhov
Experienced poster
Posts: 128
Joined: Fri Nov 15, 2002 7:45 am
Location: Kyrgyzstan
Hello!

My AC program produced this:

Code: Select all

``````Alternate 729 change sign

``````
According to the problem statement Add all 1458 is illegal.

Have AC!
Andrey.

Per
A great helper
Posts: 429
Joined: Fri Nov 29, 2002 11:27 pm
Location: Sweden
Thanks Andrey!

I had misunderstood the output format. Also I had another mistake, in handling cases such as "7 2", but now I'm AC. Thanks!

Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan
Hello, what are the outputs of

Code: Select all

``````10 6
5 2``````
Thanks

rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan
My AC code outputs:

Code: Select all

``````condition not found.

Alternate 1 change sign
``````
----
Rio

Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan

Code: Select all

``5 2``

Code: Select all

``````Add all 1
Alternate 1 change sign``````
not

Code: Select all

``Add all 1``

rio
A great helper
Posts: 385
Joined: Thu Sep 21, 2006 5:01 pm
Location: Kyoto, Japan
Because:

Code: Select all

``````Sum of all digits is even(odd)  <--> Sum of all digits with alternative signs is even(odd)
``````
----
RIo

Wei-Ming Chen
Experienced poster
Posts: 122
Joined: Sun Nov 13, 2005 10:25 am
Location: Taiwan
Thanks rio

you help me again and again..

forthright48
New poster
Posts: 37
Joined: Wed Mar 14, 2012 11:57 am