TopCoder SRM 597 div2, 500 AC.