Approach for the question Games With Rectangle

Can anyone explain the logic for this question:

I couldnt understand the editorial(which was in russian (english translation was really bad))

Thanks in advance!!

1 Like

see this :

1 Like

Thanx!! Can u write this in answer so i can accept it…

And also can u suggest some resource to learn math related problems?

1 Like

You can find the solution here :

1 Like

Try a2oj, it has problems (category wise) from various sites. Also, you can search problems based on their tags on codechef discuss and spoj. (Try searching for specific categories/tags like ‘number theory’, ‘combinatorics’ etc., depending on what you want to learn, rather than just ‘math’)

Thanks maan!!