Codeforces Round #308 (Div. 2) C.Vanya and Scales
Vanyahasascalesforweighingloadsandweightsofmasses w0, w1, w2, ..., w100 gramswhere w issomeintegernotlessthan 2(exactlyoneweightofeachnominalvalue).Vanyawonderswhetherhecanweightanitemwithmass m using