首页 > 其他 > 详细

Educational Codeforces Round 13 A

时间:2016-06-15 12:37:58      阅读:219      评论:0      收藏:0      [点我收藏+]

Description

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的关系
 1 #include<iostream>
 2 #include<stdio.h>
 3 #include<algorithm>
 4 #include<string.h>
 5 using namespace std;
 6 int a,b,c;
 7 long long n,t;
 8 int main()
 9 {
10     long long k;
11     long long sum;
12     cin>>n>>k;
13     cout<<(n/k+1)*k<<endl;
14     return 0;
15 }

 

Educational Codeforces Round 13 A

原文:http://www.cnblogs.com/yinghualuowu/p/5586969.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!