C. Vanya and Scales
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
Vanya has a scales for weighing loads and weights of masses w0,?w1,?w2,?...,?w100 grams where w is some integer not less than 2(exactly one weight of each nominal value). Vanya wonders whether he can weig