CodeForces

来源:互联网 发布:我是皇玉玺进阶数据 编辑:程序博客网 时间:2024/06/06 03:07

A. Johny Likes Numbers
time limit per test
0.5 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Johny likes numbers n and k very much. Now Johny wants to find the smallest integer x greater than n, so it is divisible by the number k.

Input

The only line contains two integers n and k (1 ≤ n, k ≤ 109).

Output

Print the smallest integer x > n, so it is divisible by the number k.

Examples
input
5 3
output
6
input
25 13
output
26
input
26 13
output
39
解题思路:看代码就懂了

AC代码:

#include<cstdio>int main(){int n, k, mod;scanf("%d%d", &n, &k); mod = (n / k) * k + k;printf("%d", mod);return 0;}