Huge Power Mod (Exponent as String)

Python Hard 4 views
Back to Questions

Problem Description

Integers a and m are provided, and exponent b is provided as a very large decimal string. Output (a^b) % m.

Input Format

Line1: a m. Line2: b (string).

Output Format

One integer ans.

Sample Test Case

Input:
2 1000 100
Output:
376

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next