Topcoder SRM#580 Div2