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的关系
 #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+)*k<<endl;
return ;
}

Educational Codeforces Round 13 A的更多相关文章

  1. Educational Codeforces Round 13 D:Iterated Linear Function(数论)

    http://codeforces.com/contest/678/problem/D D. Iterated Linear Function Consider a linear function f ...

  2. Educational Codeforces Round 13 D. Iterated Linear Function (矩阵快速幂)

    题目链接:http://codeforces.com/problemset/problem/678/D 简单的矩阵快速幂模版题 矩阵是这样的: #include <bits/stdc++.h&g ...

  3. Educational Codeforces Round 13 E. Another Sith Tournament 状压dp

    E. Another Sith Tournament 题目连接: http://www.codeforces.com/contest/678/problem/E Description The rul ...

  4. Educational Codeforces Round 13 D. Iterated Linear Function 水题

    D. Iterated Linear Function 题目连接: http://www.codeforces.com/contest/678/problem/D Description Consid ...

  5. Educational Codeforces Round 13 C. Joty and Chocolate 水题

    C. Joty and Chocolate 题目连接: http://www.codeforces.com/contest/678/problem/C Description Little Joty ...

  6. Educational Codeforces Round 13 B. The Same Calendar 水题

    B. The Same Calendar 题目连接: http://www.codeforces.com/contest/678/problem/B Description The girl Tayl ...

  7. Educational Codeforces Round 13 A. Johny Likes Numbers 水题

    A. Johny Likes Numbers 题目连接: http://www.codeforces.com/contest/678/problem/A Description Johny likes ...

  8. Educational Codeforces Round 13 A、B、C、D

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

  9. Educational Codeforces Round 13

    http://codeforces.com/contest/678 A:水题 #include<bits/stdc++.h> #define fi first #define se sec ...

随机推荐

  1. OpenCV4Android 不需要安装OpenCVManager,就可以运行的方法

    http://blog.csdn.net/yanzi1225627/article/details/27863615 OpenCV4Android释疑: 透析Android以JNI调OpenCV的三种 ...

  2. Android中同一个ImageView中根据状态显示不同图片

    一般: if(条件1) { image.setBackground(R.id.xxx1); } else if (条件2) { image.setBackground(R.id.xxx2); } 实际 ...

  3. Android 自定义Camera 随笔

      一.权限 <uses-permission android:name="android.permission.CAMERA" /> <uses-permiss ...

  4. cookie禁用后非重定向跳转时session的跟踪

  5. dubbo-admin打包和zookper安装

    1 首选安装Zookper,下载zookeeper-3.5.3-beta版本,在这里我主要演示这个:下载地址:http://mirrors.hust.edu.cn/apache/zookeeper/ ...

  6. 如何判断一个字符串是否是UTF8编码

    UTF8是以8bits即1Bytes为编码的最基本单位,当然也可以有基于16bits和32bits的形式,分别称为UTF16和UTF32,但目前用得不多,而UTF8则被广泛应用在文件储存和网络传输中. ...

  7. Codeforces 1114D Flood Fill (区间DP or 最长公共子序列)

    题意:给你n个颜色块,颜色相同并且相邻的颜色块是互相连通的(连通块).你可以改变其中的某个颜色块的颜色,不过每次改变会把它所在的连通块的颜色也改变,问最少需要多少次操作,使得n个颜色块的颜色相同. 例 ...

  8. Redis了解

    1. 使用Redis有哪些好处? (1) 速度快,因为数据存在内存中,类似于HashMap,HashMap的优势就是查找和操作的时间复杂度都是O(1) (2) 支持丰富数据类型,支持string,li ...

  9. Linux问题FAQ1

    1.使用vi编辑器时候,按方向键会产生A,B,C之类的 解决办法:ubuntu server 8.04, vim版本为 7.1.138,客户端使用pietty.vim 在插入模式下, 方向键被转为A ...

  10. NETTY4中的BYTEBUF 内存管理

    转 http://iteches.com/archives/65193 Netty4带来一个与众不同的特点是其ByteBuf的重现实现,老实说,java.nio.ByteBuf是我用得很不爽的一个AP ...