Codeforces Johny Likes Numbers

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>

using namespace std;

#define sf scanf
#define pf printf

typedef long long LL;

int main()
{
    LL n,k;

    while(~sf("%lld %lld", &n, &k))
    {
        if(n < k)
        {
            pf("%lld\n", k);
        }

        else
        {
            //LL quotient = n / k;

            //k = k*(quotient+1);

            k = k * ( (n/k) + 1 );

            pf("%lld\n", k);
        }
    }

    return 0;
}

Comments

Popular posts from this blog

SPOJ-CMG - Collecting Mango

LightOJ 1009 - Back to Underworld

LeetCode Palindrome Number