1374A - Required Remainder

    技术2025-12-27  14

    #include<iostream> using namespace std; int main(){ int num; cin>>num; for(int i=0;i<num;i++){ long int x,y,n; cin>>x>>y>>n; long int count = n/x; if((count*x+y)<=n){ cout<<count*x+y<<endl; }else{ cout<<(count-1)*x+y<<endl; } } return 0; }
    Processed: 0.041, SQL: 9