Topcoder SRM 581