TopCoder SRM 590 Div2