Блог пользователя Adityaxv

Автор Adityaxv, 4 часа назад, По-английски

Problem

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

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Yeah you are right, 85/10 = 8.

I think the authors made a mistake probably.

And we should do a complete retesting for all those who got AC during the contest.

»
4 часа назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

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$$$