/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Accepted 1ms 556.0 KiB
#3 Accepted 2ms 568.0 KiB
#4 Accepted 5ms 864.0 KiB
#5 Accepted 38ms 1.375 MiB
#6 Accepted 38ms 1.328 MiB
#7 Accepted 38ms 1.348 MiB
#8 Accepted 39ms 1.348 MiB
#9 Accepted 2ms 540.0 KiB
#10 Accepted 38ms 1.375 MiB

Code

#include <bits/stdc++.h>

#define int long long
#define ull unsigned long long
#define pf push_front
#define ppf pop_front
#define pb push_back
#define ppb pop_back
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define vi vector<int>
#define endl "\n"
using namespace std;

const int MOD = 1e9 + 7;

void solve(int tt) {
    int a, b, x;
    cin >> a >> b >> x;

    if (a >= x) {
        cout << a - x << " " << b << endl;
    } else {
        cout << 0 << " " << max<int>(0, b - (x - a)) << endl;
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

#ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int testcase = 1;
    cin >> testcase;

    for (int tt = 1; tt <= testcase; tt++) {
        solve(tt);
    }

    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 16:20:58
Judged At
2025-04-06 16:20:58
Judged By
Score
100
Total Time
39ms
Peak Memory
1.375 MiB