Accepted
Code
// Author: Shohidur Rahman
#include <bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main() {
fast;
int t;
cin >> t;
while(t--) {
int a, b, x;
cin >> a >> b >> x;
x-=a;
if(x>0) {
a = 0;
x -= b;
if(x>0) {
b = 0;
}
else{
x+=b;
b-=x;
}
}
else{
x+=a;
a-=x;
}
cout << a << " " << b << "\n";
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1187 Ticket Battle: Hridoy vs Kamona
- Contest
- Brain Booster #9
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-04-06 17:07:20
- Judged At
- 2025-04-06 17:07:20
- Judged By
- Score
- 100
- Total Time
- 40ms
- Peak Memory
- 1.355 MiB