ProgrammingVery hardCodeforces-style · placement coding round

What is printed?

What is printed?
M = 1000000007
print(pow(2, -1, 7), pow(3, 4, 5), (pow(10, 9, M) * 2) % M)
  1. A. 4 1 2000000000
  2. B. 3 1 999999993
  3. C. 4 1 999999993
  4. D. 4 4 999999993

Correct answer: C. 4 1 999999993

pow(2, -1, 7) is the modular inverse of 2 modulo 7, which is 4 because 2 x 4 = 8 = 1 (mod 7). The last value is 2 x 10^9 reduced modulo M.

More Python Programming questions

Exams that ask this topic