Loading [MathJax]/extensions/TeX/mathchoice.js

Problem #66

Reaching Point

You have to reach point (x_{2}, y_{2}) from (x_{1}, y_{1}) by making jumps from one point to another but you have some limitations. You can only move in the direction of the line connecting these two points constantly aiming towards the destination point. Also from one point you can jump to only the next most nearest integral point on the line. For example, (3,3) to (6,6) then path has to be (3,3)->(4,4)->(5,5)->(6,6) and this required 3 jumps. But now the problem is the a jump comes at a heavy cost.

If the total number of jumps made to reach (x_{2},y_{2}) starting from (x_{1},y_{1}) is n, then the total cost for the journey is said to be the (number of trailing zeroes in n!)^n.

Find the total cost for the journey from (-10101099 , 127898755387) to (1137947000140424, 1607032990556) \mod 10^9 +7.

Contributed by Vikas Yadav

Solved by 91 users

Log in to submit answers.

Is something wrong?

Maintaining a collection of high quality questions is our top priority. If, however, you do find an error, report the problem and we'll make sure it is reviewed soon.