/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 4ms 344.0 KiB
#3 Accepted 5ms 532.0 KiB
#4 Accepted 16ms 532.0 KiB
#5 Accepted 42ms 1.27 MiB
#6 Accepted 38ms 1.461 MiB
#7 Accepted 65ms 1.316 MiB
#8 Accepted 37ms 1.27 MiB
#9 Accepted 2ms 532.0 KiB
#10 Accepted 61ms 1.324 MiB

Code

#include <bits/stdc++.h>
#define nl '\n'
#define ll long long int
#define all(c) c.begin(),c.end()
#define print(c) for(auto e : c) cout << e << " "; cout << nl
using namespace std;
void solve()
{
    int a, b, x; cin >> a >> b >> x;

    if(x <= a)
    {
        cout << a-x << " " << b << nl;
    }
    else
    {
        // x > a
        cout << 0 << " ";
        x -= a;
        if(b-x < 0)
        {
            cout << 0 << nl; return;
        }
        cout << b-x << nl;
    }
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    int t; cin >> t;
    for(int tt = 1; tt <= t; tt++)
    {
        // cout << "TEST CASE-" << tt << nl;
        solve();
    }

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