Smallest Multiple >= N
Computer Mathematics
Easy
3 views
Problem Description
Given n and k>0, print the smallest multiple of k that is >= n.
Input Format
Two integers n k.
Output Format
One integer.
Official Solution
Compute q = ceil(n/k). Answer = q*k. Use (n + k - 1)//k for positive n.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!