Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t;
- scanf("%d", &t);
- while(t--)
- {
- long long x, y, n;
- scanf("%lld %lld %lld", &x, &y, &n);
- if(n - (n % x) + y <= n) printf("%lld\n", n - (n % x) + y);
- else printf("%lld\n", n - (n % x) + y - x);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment