Untitled
raw download clone
TEXT
views 14
,
size 251 b
#include <iostream>
using namespace std;

int main()
{
    int n , k , c , m1 , m2;

    cin >> n >> k ;

    c=n/k;

    m1=c*k;
    m2=(c+1)*k;

    if(n-m1<=m2-n)
        cout << m1;
    else
        cout << m2;

    return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.