CHECK ONCE WHY THIS IS NOT WORKING

Hey @rupeshjha909
Where have you seen this approach from ?

it is explained in the video

@rupeshjha909
You’re using int everywhere
Ranges are upto 10^12
Use long long instead

STILL IT IS SHOWING ERROR IN FIRST TEST CASE

@rupeshjha909
I couldn’t find the question on hacker blocks
Can you please send the question link ?
Thanks

IT IS ON CODEFORCES FOOTBALL SEASON
https://codeforces.com/problemset/problem/1244/C

@rupeshjha909
Your modinverse function is giving the run time error
Please see what mistake you might have made

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.