/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 2ms 532.0 KiB
#3 Accepted 4ms 532.0 KiB
#4 Accepted 35ms 556.0 KiB
#5 Accepted 278ms 1.23 MiB
#6 Accepted 251ms 1.227 MiB
#7 Accepted 251ms 1.316 MiB
#8 Accepted 282ms 1.363 MiB
#9 Accepted 4ms 532.0 KiB
#10 Accepted 253ms 1.301 MiB

Code

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{

    int T;
    cin>>T;

    for(int i=0; i<T; i++)
    {
        int A, B, x;
        cin>>A>>B>>x;
        int h, k;

        if(A>x)
        {
            h=A-x;

            k=B;

            cout<<h<<" "<<k<<endl;

        }

        else
        {
            h=x-A;

            if(B>h)
            {
                k=B-h;
                cout<<0<<" "<<k<<endl;

            }

            else
            {
                cout<<0<<" "<<0<<endl;
            }
        }
    }
}

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:55:59
Judged At
2025-04-06 16:55:59
Judged By
Score
100
Total Time
282ms
Peak Memory
1.363 MiB