SRM 596 Div I 250.ad hoc. greedy.

Used C++ built ins.