Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int x, y, k;
- cin>>x>>y>>k;
- if(y <= x) cout<<x<<"\n";
- else
- {
- x += k;
- x = min(x, y);
- cout<<y + (y-x)<<"\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment