TopCoder SRM 413 div 1, 250 WA :(