码迷,mamicode.com
首页 > 其他好文 > 详细

Educational Codeforces Round 13 A

时间:2016-06-15 12:41:07      阅读:156      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!