Problem link — https://mirror.codeforces.com/problemset/problem/1355/D
I was able to prove that if S>=2*n, then Petya can always win (same logic which is given in the tutorial). But I am not able to prove that if S<2*n then Petya will always lose. How to prove that?









you can see the editorial section on the right side of the page .
I don't understand the part when S<2*n.
if you want i can share my code with you i have done brute force.
ok that would be great.
Why is this post getting downvoted? I am just asking how to prove something. How is this not relevant to this community?