Codeforces Round 1083 (Div. 2) D. Simons and Beating Peaks Hints: Simons and Beating Peaks Code: Simons and Beating Peaks