Source Code
#include <iostream>
using namespace std;
//int N = 10e5+1;

int main(){
    int t;
    cin >> t;
    long long x, y;
    while(t){
        cin >> x >> y;
        int k = x+(y-(x%y));
        if(x%y==0){
            cout<<x<<endl;
        }
        else if(x <= y) {
            cout << y << endl;
        }
        else{
            cout<<k<<endl;
        }
        t--;
    }
}
Copy
AZOZ with an O (EZ Version) Zeina.A
GNU G++17
252 ms
1.6 MB
Accepted