Topcoder SRM#584 Div2-Easy