Minimum Steps To Make Divisible
Computer Mathematics
Medium
4 views
Problem Description
Given n and k, find the smallest non-negative x so (n+x) divisible by k.
Input Format
Two integers n k.
Output Format
One integer x.
Official Solution
Compute r = n mod k (positive). If r==0 answer 0 else k-r.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!