Codeforces 564A Greedy

Approach not clear ,can u please help me up with the intution

This link https://codeforces.com/blog/entry/67511 has decent comments with good explanation , so that should help you with the intuition.