/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 328.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 2ms 532.0 KiB
#4 Accepted 5ms 532.0 KiB
#5 Accepted 40ms 1.184 MiB
#6 Accepted 36ms 1.254 MiB
#7 Accepted 37ms 1.27 MiB
#8 Accepted 39ms 1.27 MiB
#9 Accepted 2ms 532.0 KiB
#10 Accepted 37ms 1.184 MiB

Code

/*Starting with the name of almighty ALLAH*/
/*Solved by 'Nazmul'*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vpii = vector<pii>;
using vpll = vector<pll>;
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define FAST_IO              \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 5;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
bool com(int a, int b) { return a > b ? true : false; }
ll power(ll base, ll exp)
{
    ll res = 1;
    base %= MOD;
    while (exp > 0)
    {
        if (exp % 2 == 1)
            res = (res * base) % MOD;
        base = (base * base) % MOD;
        exp /= 2;
    }
    return res;
}

void solve()
{
    int A, B, X;
    cin >> A >> B >> X;
    if (A > X)
        cout << A - X << " " << B << endl;
    else
    {
        X -= A;
        cout << 0 << " " << ((B < X) ? 0 : abs(B - X)) << endl;
    }
}

int main()
{
    FAST_IO
    int t = 1;
    cin >> t;
    while (t--)
        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:43:37
Judged At
2025-04-06 15:43:37
Judged By
Score
100
Total Time
40ms
Peak Memory
1.27 MiB