Educational Codeforces Round 13 A
2016-06-15 11:54
288 查看
[b]Description[/b]
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
output
input
output
input
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 嗯,这个就没必要说了吧,找n与k的关系
#include<iostream> #include<stdio.h> #include<algorithm> #include<string.h> using namespace std; int a,b,c; long long n,t; int main() { long long k; long long sum; cin>>n>>k; cout<<(n/k+1)*k<<endl; return 0; }
相关文章推荐
- 银行卡号- 查询银行卡信息
- 关于 jenkins LDAP 的配置详情
- Leetcode Find the Celebrity
- [iOS]苹果开发证书 一个证书多人开发 注意项
- 剑指offer(27)-连续子数组的最大和
- 案例-水果
- Java发送邮件遇到的常见需求汇总
- java复制更改指定文件类型、后缀名
- 手机前端开发注意事项
- Oracle数据库之SQL基础(二)
- 用poi,加载excel模板导出数据
- ajax请求简单的demo
- mysql group by排序问题
- shell编程——if语句 if -z -n -f -eq -ne -lt
- C++基础备忘
- Linux特殊符号大全
- oracle的用户、表、表空间三者的关系
- mysql基础
- nginx location配置说明
- Node.js中, 使用Q.ninvoke封装对象方法为promise