Source Code
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int T=0;
    scanf("%d", &T);
    for(int i=1;i<=T;i++){
        int r=0;
        int k=0;
        int x=0;
        int y=0;
        scanf("%d %d", &x, &y);
        if(y>=x){printf("%d\n",y);}
        else if(x%y==0){printf("%d\n",x);}
        else{
        r=x%y;
        k=y-r;
        printf("%d\n",k+x);
        }
    }
    return 0;
}
Copy
AZOZ with an O (EZ Version) Qais Jildeh
GNU G++17
28 ms
1.7 MB
Accepted