Skip to content

Commit 1b4e943

Browse files
committed
Added 1374A - Required Remainder.cpp
1 parent dbe7e89 commit 1b4e943

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

1374A - Required Remainder.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int t;
12+
cin>>t;
13+
while(t--)
14+
{
15+
int x,y,n,ans;
16+
cin>>x>>y>>n;
17+
ans = n - n % x + y;
18+
if(ans <= n)
19+
cout<<ans<<endl;
20+
else
21+
cout<<(n - n % x - (x - y))<<endl;
22+
}
23+
return 0;
24+
}

0 commit comments

Comments
 (0)