TopCoder SRM 508 div 2, 250 AC.