/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 2ms 532.0 KiB
#4 Accepted 7ms 536.0 KiB
#5 Accepted 40ms 1.137 MiB
#6 Accepted 39ms 1.27 MiB
#7 Accepted 38ms 1.312 MiB
#8 Accepted 40ms 1.355 MiB
#9 Accepted 2ms 532.0 KiB
#10 Accepted 38ms 1.27 MiB

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