Minimum Steps To Make Divisible

Computer Mathematics Medium 4 views
Back to Questions

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.

Sample Test Case

Input:
14 6
Output:
4

Constraints

k>0

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next