/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 1ms 324.0 KiB
#3 Accepted 2ms 532.0 KiB
#4 Accepted 7ms 624.0 KiB
#5 Accepted 37ms 1.16 MiB
#6 Accepted 41ms 1.375 MiB
#7 Accepted 37ms 1.18 MiB
#8 Accepted 38ms 1.148 MiB
#9 Accepted 2ms 532.0 KiB
#10 Accepted 65ms 1.34 MiB

Code

#include <bits/stdc++.h>
#define ll long long int
#define N "\n"
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin >> t;
    while (t--)
    {
        ll a,b,x;
        cin>>a>>b>>x;
        if(x<=a){
            cout<<a-x<<" "<<b<<N;
            continue;
        }
        x-=a;
        a=0;
        if(x>b){
            b=0;
        }
        else{
            b-=x;
        }
        cout<<a<<" "<<b<<N;
    }
}

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 15:36:25
Judged At
2025-04-06 15:36:25
Judged By
Score
100
Total Time
65ms
Peak Memory
1.375 MiB