CT111
Fair Remainder for the Caravan
EasyL1 · Pixel PusherAcceptance: 0.0%XP: 5
The caravan ledger needs a remainder that stays nonnegative even for a negative balance.
Task: Find r such that a=qb+r for an integer q and 0<=r<b.
Input format: Integers a and positive b.
Output format: Print the unique nonnegative remainder r.
Constraints: -10^12 <= a <= 10^12; 1 <= b <= 10^9
Constraints:
-10^12 <= a <= 10^12; 1 <= b <= 10^9