Multiply Mod M

Computer Mathematics Hard 2 views
Back to Questions

Problem Description

Compute (a*b) mod m for up to 10^18 (use bigint idea).

Input Format

Three integers a b m.

Output Format

One integer.

Sample Test Case

Input:
1000000000000 1000000000000 97
Output:
16

Constraints

m>0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next