Adityaxv's blog

By Adityaxv, 20 months ago, In English

Problem

According to me P = 85 and Q = 10. So, the answer should be 8. But why the expected answer is 500000012?

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
20 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

perform modular division(Fermat's Theorem) on it you will get that o/p My Solution

»
20 months ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

you need to calculate $$$Q^{-1}$$$ mod $$$10^9 + 7$$$ using Fermat's theorem (modular inverse) which is $$$700000005$$$, then multiply it by $$$85$$$ mod $$$10^9 + 7$$$, which is equal to $$$500000012$$$