Problems from topcoder. Div 1 Problem 1.