Add Mod M

Add Mod M

Easy Computer Mathematics Modular Arithmetic 30 views
Explanation Complexity

Problem Statement

Compute (a+b) mod m for large a,b.

Input Format

Three integers a b m.

Output Format

One integer.

Example

1000000000000 7 10
7

Constraints

m>0

Input / Output Format

Input Format
Three integers a b m.
Output Format
One integer.
Constraints
m>0

Examples

Input:
1000000000000 7 10
Output:
7

Example Solution (Public)

Computer Mathematics
Normalize a and b then (a+b)%m.

Official Solution Code

Normalize a and b then (a+b)%m.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.