Mike And Infinite Gold

https://hack.codingblocks.com/contests/c/547/687

Can you please explain the first test case? In the test case , Mike is on(2,4) and he has to reach (1,2) and he can take 0<k<=min(2-1,4-2) step . i.e k=1, So if he moves to (1,4) so his friend has only one option left to move to (1,3) and finally mike wins with making it to (1,2) as he is playing optimally…

You haven’t interpreted the question statement properly.

When Mike moves to (1,4), then his friend can directly move to (1,2) as it is mentioned in question

“”“A position (x,y’), such that q <= y’ < y.”"""

Hence Mike will always loose in this test case.

Hope this helps.

1 Like

Ohk ! I got it .
The “” K Constraint “” is only for the diagonal move…

Yes. :grinning:
Thats great read question more carefully from next time. :metal:

1 Like