CodeForces
来源:互联网 发布:我是皇玉玺进阶数据 编辑:程序博客网 时间:2024/06/06 03:07
A. Johny Likes Numbers
time limit per test
0.5 secondsmemory limit per test
256 megabytesinput
standard inputoutput
standard outputJohny 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;}
阅读全文
0 0
- codeforces~~~
- Codeforces
- codeforces
- Codeforces
- codeforces
- codeforces
- Codeforces
- Codeforces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- CodeForces
- Codeforces
- Codeforces
- Codeforces
- Codeforces
- Codeforces
- css代码实时预览(脑洞大开的操作)
- POJ-1456-Supermarket [贪心]
- 《剑指offer》非递归法判定二叉树是否是对称的
- Java对象转为json
- 剑指offer面试题[41]-和为s的两个数VS和为s的连续正数序列
- CodeForces
- C#继承
- centos6.7系统中zabbix3.0的安装
- 最高的奖励
- (二分) Strange fuction--HDOJ
- 增大Linux的socket最大连接数(针对select,要编译内核)
- windows安装clang
- Blockchain的鱼和熊掌系列(18) 之 openssl 问题
- 分享一个excel的导入