TopCoder SRM 595 Div2