Any idea about this
Aproach:
get the minimum next left you can kill, suppose 3rd ,now you kill him 4th becomes 3rd, kill him next becomes 3rd…so on…until next person is me.
So in short you can kill everyone after the minimum you can kill
https://www.codechef.com/viewsolution/40625031
I did similar to this but instead of doing this one time i am doing this for several times,
Approach: find minimum of (arr[i]%n) (if arr[i]%n !=0) otherwise take minimum of arr[i] only then add (n-minimum obtained) in the answer and repeat this step until we get the (minimum found >=n).
Please Help! I am stuck here from 2 hrs !!