10093 - An Easy Problem!


Difficulty : easy

Solution Description :

Ad hoc problem

Convert the 0..9, A..Z (10..35), a..z (36..61) representation to
standard number first.
Find maximum number (M) and also sum all number (Sum)

now
for i=M to 61
---if Sum%i==0 then print i+1 and break

if you do not find any number then print "such number is impossible!"

Example
aab2
convert the string to standard number
so, 36 36 37 2
the maximum number M = 37
and sum = 36+36+37+2 = 111
111%37=0 so ans = 37 + 1 = 38

Another example
43
After convert 4 3
M = 4 ans Sum=7
7%4=3
7%5=2
7%6=1
7%7=0 so ans = 7+1=8