Remainder Always Positive
Computer Mathematics
Medium
4 views
Problem Description
Given integers a and m>0, print a mod m in range [0,m-1].
Input Format
Two integers a m.
Output Format
One integer.
Official Solution
Compute r = a % m. If r<0 add m. Output r.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!