Help!!! (Moduler Multiplecative Inverse)!!..

Revision en1, by Dream_Coder10, 2021-04-18 14:40:24

Suppose there are two number n & k where 1 <= k <= n <= 1e9 . Now I have to calculate n/k (modulo 1e9 + 7)

==========================================================================================================================

My approach:

I used fermats little theorem to calculate moduler multiplecative inverse & then i printed n*(moduler multiplecitive inv.); But in this approach many test cases like "n=11,k=3" or "n=10 ,k=4" are not working properly & giving me wrong answer..

what I have to modify in this code ( https://paste.ubuntu.com/p/T2h9CsjpXx/ )?

Thanks in advance

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Dream_Coder10 2021-04-18 17:13:08 55
en1 English Dream_Coder10 2021-04-18 14:40:24 675 Initial revision (published)