TopCoder SRM 635: Div2-500