GRIDTOUR - EDITORIAL

I really admire your 5 star status but I think when a beginner asks a doubt, it shouldn’t made fun of!

Where did I make fun of anyone? I especially urge everyone to respect everyone no matter what their ratings are.
I said:-“There is a very easy way” …
I did not mention that easy way as I am having my endsem exams, and don’t have enough time to go in details.
+
It was a hint for you.

Taran has mentioned that in the editorial

You dont need to find the path
as no cell is visited twice, length of the path is total num of cells in the grid i.e N*M

Thanks.

But what I actually want to know that if i use values of y (0 to m) in this (c+y∗K)%m equation then how can i prove that all the values which i’ll get from this (c+y∗K) equation will be unique :thinking::thinking::thinking:

i think (yk)%m = (1)%m == 1 so if k and m have gcd other than 1 for example say 3 then y will be a no so y k would be a multiple of m so (yk)%m can never be 1 hence gcd(k,m) == 1.
in comment u can find why (y
k)%m = (1)%m

1 Like

have a look at this

1 Like

Can anyone please let me know i didnt understand this part below
which should be (c+1)modM for some y for reaching position (0,(c+1)%M).
After this why we have multiplied with K inverse both sides and when to multiply this again .
Sorry ! but i m very noob in maths.