Problem:


Score : 200 points

Problem Statement

Takahashi has A cookies, and Aoki has B cookies.
Takahashi will do the following action K times:

If Takahashi has one or more cookies, eat one of his cookies.

Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.

If they both have no cookies, do nothing.

In the end, how many cookies will Takahashi and Aoki have, respectively?

Constraints

0 \leq A \leq 10^{12}

0 \leq B \leq 10^{12}

0 \leq K \leq 10^{12}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B K

Output

Print the numbers of Takahashi's and Aoki's cookies after K actions.

Sample Input 1

2 3 3

Sample Output 1

0 2

Takahashi will do the following:

He has two cookies, so he eats one of them.

Now he has one cookie left, and he eats it.

Now he has no cookies left, but Aoki has three, so Takahashi eats one of them.

Thus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.

Sample Input 2

500000000000 500000000000 1000000000000

Sample Output 2

0 0

Watch out for overflows.



Sample input:
2 3 3


Sample output:
0 2

Submission status: Runtime Error

Solution code:
n = list(map(int, input().strip().split()))
count = 0
         
while count < n[2]:
	if n[0] > 0:
    	n[0]-=1   
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1
    else:
        break
 
print(n[0] + " " + n[1])

Submission status: Runtime Error

Solution code:
S, T = input().split()
print(T+S)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
if a>=k:
  print(a-k,b)
elif:
  print(0,max(b+a-k,0))

Submission status: Runtime Error

Solution code:

if a >= k:
  a -= k
  print(str(a)+" "+str(b))

elif a< k and a+b >=k:
  b -= (k-a)
  a = 0
  print(str(a)+" "+str(b))

else:
  a = 0
  b = 0
  print(str(a)+" "+str(b))

Submission status: Runtime Error

Solution code:
A,B,K=map(int, input().split())
for i in range(K):

A,B,K=map(int, input().split())
for i in range(K):
    if(A>=1):
        A-=1
    else:
        if(B>=1):
            B-=1
print(A,B)

Submission status: Runtime Error

Solution code:
cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1])
if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input())
if a+b<=k:print(0,0)
elif a<=k:print(0,a+b-k)
else:print(a-k,b)

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
b = a[0] - a[2]
if b <= 0:
  ans = a[1] + b
  print('0 {}'.format(ans))
elif b == 0:
  print('0 {}'.format(a[1]))
elif ans < 0:
  print('0 0')
else:
  print('{} {}'.format(b, a[1]))

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline

ta_c,ao_c,num = map(int,input().split())

for _ in [0]*num:
    if ta_c > 0:
        ta_c -=1
    elif ao_c >0:
        ao_c -=1

print(ta_c,ao_c)

Submission status: Runtime Error

Solution code:
# coding: utf-8


def main():
    
    takahashi_cookie, aoki_cookie, action_count = map(int, input().split(' '))

    if action_count >= (takahashi_cookie + aoki_cookie):
        takahashi_result = 0
        aoki_result = 0
    elif action_count >= takahashi_cookie:
        takahashi_result = 0
        aoki_result = aoki_cookie - (action_count - takahashi_cookie)
    elif action_count < takahashi_cookie:
        takahashi_result = takahashi_cookie - action_count
        aoki_result = aoki_result
        
    print(takahashi_result, aoki_result)

    return 0
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
b = a[0] - a[2]
if b < 0:
  ans = a[1] + b
  print('0 {}'.format(ans))
elif ans < 0:
  print('0 0')
else:
  print('{} {}'.format(b, a[1]))

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
b = a[0] - a[2]
if b <= 0:
  ans = a[1] + b
  print('0 {}'.format(ans))
elif ans <= 0:
  print('0 0')
else:
  print('{} {}'.format(b, a[1]))

Submission status: Runtime Error

Solution code:
# coding: utf-8


def main():
    
    takahashi_cookie, aoki_cookie, action_count = map(int, input().split(' '))

    if action_count > takahashi_cookie:
        takahashi_result = 0
        aoki_result = aoki_cookie - (action_count - takahashi_cookie)
    elif action_count < takahashi_cookie:
        takahashi_result = takahashi_cookie - action_count
        aoki_result = aoki_result
    elif action_count >= (takahashi_cookie + aoki_cookie):
        takahashi_result = 0
        aoki_result = 0
        
    print(takahashi_result, aoki_result)

    return 0
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b,k = (int(x) for x in input().split())

if k >= a :
  if k >= b :
    if a + b >= k :
      a1 = 0
      b1 = b - k + a
    else :
      a1 = 0
      b1 = 0
  else :
    a1 = 0
    b1 = b - k + a
else :
  a1 = a - k

print(a1,b1)

Submission status: Runtime Error

Solution code:
A,B,K=map(int,input().split())
if A>=K:
  print(str(A-k)+" "+str(B))
else:
  if A+B>=K:
    print("0 "+str(A+B-K))
  else:
    print("0 0")

Submission status: Runtime Error

Solution code:
A, B, K = input().split()
A = int(A)
B = int(B)
K = int(K)
if (A + B) - K <= 0:
    Ta = 0
    Ao = 0
else:
    if A > B:
        Ta = (A + B) - K
        Ao = 0
    else:
        Ao = (A + B) - K
        Ta = 0
print(f"{Ta} {Ao}")

Submission status: Runtime Error

Solution code:
s = input().split()
A = s[0]
B = s[1]
K = s[2]
 
for j in range(K):
  if A >0:
    A -= 1
  elif B >0:
    B -= 1
  else:
    break
 
print(A, B)

Submission status: Runtime Error

Solution code:
A, B, K = input().split()
A = int(A)
B = int(B)
K = int(K)

if (A+B) - K <= 0:
    Ta=0
    Ao=0
else:
    if A < B:
        Ta = (A+B) - K
        Ao = 0
    else:
        Ao = (A+B) - K
        Ta = 0

    
print(f"{Ta} {Ao}")

Submission status: Runtime Error

Solution code:
n = list(map(int, input().strip().split()))
count = 0
         
while count == n[2]:
	if n[0] > 0:
    	n[0]-=1   
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1
    else:
        break
 
print(n[0] + " " + n[1])

Submission status: Runtime Error

Solution code:
if a>k and a>0:
    a-=k
else:
    if b>k-a and b>0:
        b-=(k-a)
    else:
        b=0
    a=0
print(str(a)+" "+str(b))

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
if a==0 and b==0:
    print(0)
else:
    a = a - k
    a2 = a
    if a<0:
        a=0
    b= b + a2
    if b<0:
        b=0
	print(a,b)

Submission status: Runtime Error

Solution code:
ABK = input()
A = int(ABK[0])
B = int(ABK[1])
K = int(ABK[2])

if (K >= A):
  print(str(K-A) + " " + str(K-A-B))
else:
  print(str(K-A) + " " + str(B))

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
if a==0 and b==0:
    print(0)
else:
    a = a - k
    a2 = a
    if a<0:
        a=0
    b= b + a2
    if b<0:
        b=0
	print(a,b)

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
if a==0 and b==0:
    print(0)
else:
    a = a - k
    a2 = a
    if a<0:
        a=0
    b= b + a2
    if b<0:
        b=0
print(a,b)


1 3 1000
0 1

Submission status: Runtime Error

Solution code:
s = [input() for i in range(3)]
A = s[0]
B = s[1]
K = s[2]
 
for j in range(K):
  if A >0:
    A -= 1
  elif B >0:
    B -= 1
  else:
    break
 
print(A)
print(B)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {

  long long A,B,K;
  cin >> A >> B >> K;

  if(A==0 && B == 0){
    cout << A << " " << B << endl;
    return 0;
  }

  if(K-A>0){
    B = B-(K-A);
    A = 0;
  }else{
    A = A-K;
  }

  cout << A << " " << B << endl;

}

Submission status: Runtime Error

Solution code:
a,b,k=input().split()
a=int(a)
b=int(b)
k=int(k)
a=a-k
c=b+a
if a<0:
	print(0,max(c,o))
else;
	print(a,0)

Submission status: Runtime Error

Solution code:
line = input().split(' ')
A = int(line[0])
B = int(line[1])
K = int(line[2])
Z = 0

def p2(num1, num2, Z):
  if Z:
    return(0)
  else:
    if(num1 < num2):
      return (num2 - num1)
      Z = 1
    else:
      return(0)
  
print(str(p2(K, A)) + ' ' + str(p2(K - A, B)))

Submission status: Runtime Error

Solution code:
n = list(map(int, input().split())
count = 0
         
while count == n[2]:
	if n[0] > 0:
    	n[0]-=1   
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1
    else:
        break
 
print(n[0] n[1])

Submission status: Runtime Error

Solution code:
= list(map(int,input().input().split()))
for i in range(A[2]):
  if A[0]>0:
    A[0]-=1
  elif A[1] >1:
      A[1]-=1
print(A[0],A[1])

Submission status: Runtime Error

Solution code:
n = list(map(long, input().split())
count = 0
         
while count == n[2]:
	if n[0] > 0:
    	n[0]-=1   
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1
    else:
        break
 
print(n[0] n[1])

Submission status: Runtime Error

Solution code:
A= list(map(int,input().input().split()))
for i in range(A[2]):
  if A[0]>0:
    A[0]-=1
  elif A[1] >0:
      A[1]-=1
print(A[0],A[1])

Submission status: Runtime Error

Solution code:
a,b,k=input().split()
a=int(a)
b=int(b)
k=int(k)
a=a-k
c=b+a
if a<0:
	print(0,c)
elif b<0;
	print(a,0)
else:
	print(a,b)

Submission status: Runtime Error

Solution code:
At = int(input())
Ba = int(input())
K = int(input())

for i in range(K):
    if At >= 1:
        At -= 1
    elif Ba >= 1:
        Ba -= 1
    
print(At)
print(Ba)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**9)

a, b, k = map(int, input().split())

if k > 10**9:

for i in range(k):
    if a >= 1:
        a = a - 1
    elif b >= 1:
        b = b - 1

print("{}".format(a) + " {}".format(b))

Submission status: Runtime Error

Solution code:
n = list(map(int, input().split())
count = 0
         
while count == n[2]:
	if n[0] > 0:
    	n[0]-=1   
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1
 
print(n[0] n[1])

Submission status: Runtime Error

Solution code:
n = list(map(long, input().split())
count = 0
         
while count == n[2]:
	if n[0] > 0:
    	n[0]-=1   
        count+=1
    elif n[1] > 0:
        n[1]-=1
        count+=1

print(n[0] n[1])

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())

if a-k >= 0:
    print(f'{a-k} {b}')
elif b-(k-a) >= 0:
    print(f'0 {b-(k-a)}')
else:
    print('0 0')

Submission status: Runtime Error

Solution code:
A_B_K = input()

A = int(A_B_K[0])
B = int(A_B_K[1])
K = int(A_B_K[2])
 
result = K - (A+B)
 
if (result <=0):
  print(0)
else:
  print(result)

Submission status: Runtime Error

Solution code:
A,B,K = input().split()
print(f"{0 if A <= K else A - k} {0 if B <= K else B-k}")

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split()))
d = 0
for a in range(a[2]):
  if a[0] >= 1:
    a[0] -= 1
    d += 1
else:
  if b[1] >= 1:
    b[1] -= 1
    print(a[0], a[1])

Submission status: Runtime Error

Solution code:
A, B, K = input().split()

C = int(K)-int(A)
if(C >= 0):
    B = int(B)-C
    A = 0
else:
    A = int(A)-int(break)

print(str(A) +" "+ str(B))

Submission status: Runtime Error

Solution code:
a1 = max(a - k, 0)
if a1 >= 1:
    a2 = b
else:
    a2 = a + b - k
if a2 < 0:
    a2 = 0
print(a1, a2)

Submission status: Runtime Error

Solution code:
At = int(input())
Ba = int(input())
K = int(input())

for i in range(K):
    if At >= 1:
        At -= 1
    elif Ba >= 1:
        Ba -= 1
    
print(At)
print(Ba)

Submission status: Runtime Error

Solution code:
t,a,k = input().split()
while k>0:
  if t>0:
    t-=1
    k-=1
  elif t==0 and a>0:
    a-=1
    k-=1
  else if t==0 and a==0:
    break
print(str(t)+' '+str(a))

Submission status: Runtime Error

Solution code:
s = [input() for i in range(3)]
A = s[0]
B = s[1]
K = s[2]

for j in range(K):
  if A >0:
    A -= 1
  elif B >0:
    B -= 1
  else:
    break

print(A, B)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input.split())

a=max(a-k,0)
k=max(k-a,0)
b=max(b-k,0)
print(a,b)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())

if a > k:
    c = a - k
elif a + b > k:
    c = 0
    d = a + b - k
else:
    c = 0
    d = 0

print(c, d)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())

if a < k :
	k = k - a
	a = 0	
	if b < k :
		b = 0
	else :
		b = b - k

else :
	a = a - k

print(a, b

Submission status: Runtime Error

Solution code:
A,B,K = [int(i) for i in input().split()]
a = A - (K - (K -A))
b = B - (K - A)
print(f"{a} {b}")

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())

if a > k:
    c = a - k
else:
    c = 0
    d = a + b - k

print(c, d)

Submission status: Runtime Error

Solution code:
if (a + b) > k:
    if a < k:
        b = b - (k - a)
        a = 0
    else:
        a = k - a
else:
    a, b = 0, 0

print(a, b)

Submission status: Runtime Error

Solution code:
takahashi, aoki, kaisu = [int(x) for x in input().split()]
taka_amari = takahashi - kaisu
if taka_amari<0:
    ao_amari = aoki+taka_amari

if taka_amari<0:
    taka_amari = 0
if ao_amari<0:
    ao_amari = 0
print(str(taka_amari) + " " + str(ao_amari))

Submission status: Runtime Error

Solution code:
# -*- Coding: utf-8 -*-

a,b,k = map(int, input().split())

if k == 0:
    print('{0} {1}'.format(a,b))
    exit(1)

if k >= a:
    k = k-a
    a = 0
else:
    a = a - k

if k == 0:
    print('{0} {1}'.format(a,b))
    exit(1)
else:
    if k >= b:
        b = 0
        print('{0} {1}'.format(a,b))
        exit(1)
    else:
        b = b - k
        print('{0} {1}'.format(a,b))

Submission status: Runtime Error

Solution code:
def main():
    #高橋a, 青木b, 繰り返す回数k
    a, b, k = map(int,input().split())
    if a < k:
        lest = k - a
        ans = b - lest
        print(0, ans)
    else :
        print(lest, b)
    
main()

Submission status: Runtime Error

Solution code:
a, b, k = input().split()
a = int(a)
b = int(b)
k = int(k)

first_a = a
a -= k if k < a else a
k -= first_a if a == 0 else 0
b -= k

print(a + " " + b)

Submission status: Runtime Error

Solution code:
try:
    a = int(input("Enter A: "))
    b = int(input("Enter B: "))
    k = int(input("Enter K: "))
    limit = 10**12
    if a <= 0 or a > limit or b <= 0 or b > limit or k <= 0 or k > limit:
        print("Invalid input constaint")
    else:
        if a >= k:
            a = a - k
            k =0
        else:
            k = k - a
            a = 0
        b = b - k
        print(f'{a} {b}')
except:
    print("Input must be integer")

Submission status: Runtime Error

Solution code:
a, b, k = map(int,input().split())
if a >= k:
    ans = [a-k,b]
else:
    ans = [0,a+b-k]
print(str(ans[0]+" "+str(ans[1])))

Submission status: Runtime Error

Solution code:
a, b, k = map(float(), input().split(" "))
if a+b <= k:
  print("0 0")
elif a >= k:
  print(f'{a-k} 0')
else:
  print(f'0 {(a+b)-k}')

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
k=int(input())
for i in range (k):
  if a > 0:
    a-=1
  elif:
  	if b > 0:
      b-=1
print(a, b)

Submission status: Runtime Error

Solution code:
a,b,c = list(map(int,input().split()))
if a-c < 0:
    diff = abs(a-c)
    a = 0
elif a-c > 0:
    diff = 0
    a = a-c
print(a,b-diff)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
k=int(input())
for i in range (k):
  if a > 0:
    a-1
  elif:
  	if b > 0:
      b-1
print(a, b)

Submission status: Runtime Error

Solution code:
import math
A, B, K = map(int, input().split())

gcd = math.gcd(A, B)
A = A // gcd
B = B // gcd

    
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
    if A == 0 and B == 0:
        break

print(A, end=" ")
print(B)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
d = 0
for a in range(c):
  if a >= 1:
    a -= 1
    d += 1
else b in range(c - d):
  if b >= 1:
    b -= 1
    print(a, b)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())
if A <= K:
	a = 0
	if B <= K - A:
		b = 0
	else:
		b = B - (K - A)
else:
	a = A - K
print(a, b)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())

if k >= n:
    n1 = 0
    if k >= n+m:
        m1 = 0
    else:
        m1 = m+n-k
print("{} {}".format(n1,m1))

Submission status: Runtime Error

Solution code:
s=input().split()
i=int(s[0])
j=int(s[1])
k=int(s[2])
if k>=i:
  i=0
  j=j-k+i
else:
  i=i-k
print(str(i)+" "str(j))

Submission status: Runtime Error

Solution code:
a, b, k = input().split()
a = int(a)
b = int(b)
k = int(k)

first_a = a
a -= k if k < a else a
k -= first_a if a == 0 else 0
b -= k

print(f"{a} {b}")

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())

if k > a :
  print("0",b-(k-a))
elif k=<a:
  print(a-k,b)

Submission status: Runtime Error

Solution code:
A, B, K = map(int, input().split())

if A <= K:
    print(0, max(B - (K - A), 0)
else:
    print(A - K, B)

Submission status: Runtime Error

Solution code:
A,B,K = map(int,input().split())
if A+B <= K:
print(0,0)
elif A >= K:
  print(A-K,B)
else:
  print(0,B-K+A)

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(1000000000000000)


a, b, k = map(int, input().split())

if a >= k:
    a = a - k
    print("{} {}".format(a, b))
elif k > a and a + b >= k:
    b = a + b - k
    print("{} {}".format(0, b))
else:
    print("{} {}".format(0, 0))

Submission status: Runtime Error

Solution code:
a,b,k = map(int input().split())

if k>a+b:
    print("0 0")    
elif k>a:
    print("0 "+str(a+b-k))
else:
    print(str(a-k)+" "+str(b))

Submission status: Runtime Error

Solution code:
a,b,c = input().split(' ')
for i in range(int(c)):
  if int(a) >= 1:
    a = int(a) - 1
  else:
    b = int(b) - 1
print(a + " " + b)

Submission status: Runtime Error

Solution code:
a,b,k = map(int, input().split())
if a => k:
  print(a-k," ",b)
elif b > (k-a):
  print(0," ",b-(k-a)):
else:
  print(0," ",0)

Submission status: Runtime Error

Solution code:
A,B,K = map(int,input().split())



if A==B:
    print("0 0")
elif A==0 and B==0:
    print(f"{A} {B}")
else:
    least = min(A,B)
    more = max(A,B)
    K-=least
    if K:
        more-=K
    if min(A,B)==A:
        print(f"0 {more}")
    else:
        print(f"{more} 0")

Submission status: Runtime Error

Solution code:
A,B,K = map(int,input().split())
T = A - K
O = 0
if T >= 0:
	print(T, 0)
	else:
      print(0,O-T)

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
k=int(input())
for i in range (k):
  if a > 0:
    a-1
  else:
  	if b > 0:
      b-1
print(a, b)

Submission status: Runtime Error

Solution code:
s,t=map(str,input().split())
print(t+s)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())

if k >= n:
    n1 = 0
    if k >= n+m:
        m1 = 0
    else:
        m1 = m+n-k
print("{} {}".format(n1,m1))

Submission status: Runtime Error

Solution code:
a, b, k = input().split()
a = int(a)
b = int(b)
k = int(k)

first_a = a
a -= k if k < a else a
k -= first_a if a == 0 else 0
b -= k

print(f"{a} {b}")

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())
if a>k:
  print(str(a-k) + " " + str(b))
else:
  if str(b-(a-k)) < 0:
    print("0 0")
  else:
  	print(str(0) +" " +str(b-(a-k)))

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())
if a >= k:
  print('{} {}'.format(a-k.b))
elif a+b >= k:
  print('0 {}'.format(b-(k-a)))
else:
  print('0 0')

Submission status: Runtime Error

Solution code:
a, b, k = input().split(" ")
if a+b <= k:
  print("0 0")
elif a >= k:
  print(f'{a-k} 0')
else:
  print(f'0 {(a+b)-k}')

Submission status: Runtime Error

Solution code:
//#include <windows.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//#define int ll
typedef vector<vector<pair<int, int> > > vvp;
typedef vector<pair<int, int> > vp;
typedef vector<int> vi;
typedef vector<vi > vvi;
typedef vector<vvi > vvvi;
typedef vector<vector<ll> > vvl;
typedef vector<ll> vl;
typedef vector<vector<double> > vvd;
typedef vector<double> vd;
typedef vector<vector<bool> > vvb;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef pair<string, int> psi;
typedef pair<int, int> pii;
//#define unix ((unsigned int)time(NULL))
#define rep(i,s,n) for(int i = (s); i < (n); i++)
#define loop while(true)
#define inputv(v) for(int i = 0; i < (v.size()); i++)cin>>v[i];
#define inputvv(v) for(int i = 0; i < (v.size()); i++)for(int j=0;j<(v[0].size());j++)cin>>v[i][j];
#define all(x) (x).begin(), (x).end()
#define yn(f) cout <<(f?"yes":"no")<< endl
#define YN(f) cout <<(f?"YES":"NO")<< endl
#define Yn(f) cout <<(f?"Yes":"No")<< endl
#define POSSIBLE(f) cout << ((f) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(f) cout << ((f) ? "Possible" : "Impossible"  ) << endl
const int inf8 = 1e8;
const int inf = 1e9+7;
const ll inf18 = 1e18;
void puts() {
	cout << endl;
}
template <class T>
void puts(T a) {
	cout << (a) << endl;
}
template <class Head, class... Tail>
void puts(Head&& head, Tail&& ... tail) {
	cout << head;
	if (sizeof...(tail) == 0) {
		puts();
	}
	else {
		cout << " ";
		puts(forward<Tail>(tail)...);
	}

}
void puts(pair<int, int> A) {
	cout << "(" << A.first << "," << A.second << ")" << endl;;
}
void puts(vector<pair<int, int> >& A) {
	for (int i = 0; i < A.size(); i++)
	{
		cout << "(" << A[i].first << "," << A[i].second << ")";
		if (A.size() - 1 == i) {
			cout << endl;
		}
		else {
			cout << " ";
		}
	}
}
void puts(vector<vector<pair<int, int> > >& A) {
	for (int i = 0; i < A.size(); i++)
	{
		puts(A[i]);
	}
}
template <class T>
void puts(vector<T>& A) {
	for (int i = 0; i < A.size(); i++)
	{
		cout << A[i];
		if (A.size() - 1 == i) {
			cout << endl;
		}
		else {
			cout << " ";
		}
	}
}
template <class T>
void puts(const vector<T>& A) {
	for (int i = 0; i < A.size(); i++)
	{
		cout << A[i];
		if (A.size() - 1 == i) {
			cout << endl;
		}
		else {
			cout << " ";
		}
	}
}
template<class T>
void puts(vector<vector<T> >& A) {
	for (int i = 0; i < A.size(); i++)
	{
		puts(A[i]);
	}
}
template<class T>
void puts(const vector<vector<T> >& A) {
	for (int i = 0; i < A.size(); i++)
	{
		puts(A[i]);
	}
}
template <class T>
vector<T> ruisekiwa(vector<T>& A) {
	vector<T> R(A.size()+1);
	for (int i = 0; i < A.size(); i++)
	{
		R[i + 1] = R[i] + A[i];
	}
	return R;
}
class disjoint_set {
public:
	vi p, rank;
	disjoint_set(int size) {
		p.resize(size, 0);
		rank.resize(size, 0);
		for (int i = 0; i < size; i++)makeSet(i);
	}
	void makeSet(int x) {
		p[x] = x;
		rank[x] = 0;
	}
	bool same(int x, int y) {
		return findSet(x) == findSet(y);
	}
	void unite(int x, int y) {
		link(findSet(x), findSet(y));
	}
	void link(int x, int y) {
		if (rank[x] < rank[y]) {
			p[x] = y;
		}
		else {
			p[y] = x;
			if (rank[x] == rank[y]) {
				rank[x]++;
			}
		}
	}
	int findSet(int x) {
		if (x != p[x]) {
			p[x] = findSet(p[x]);
		}
		return p[x];
	}
};
class rmq {
public:
	int n, inf_, max_n;
	vi A;
	rmq(int n_) {
		n = 1;
		inf_ = INT_MAX;
		max_n = (1 << 18);
		while (n < n_)n *= 2;
		A.resize(max_n * 2 - 1);
		for (int i = 0; i < n * 2 - 1; i++)A[i] = inf_;
	}
	void update(int i, int x) {
		i += n - 1;
		A[i] = x;
		while (i > 0) {
			i = (i - 1) / 2;
			A[i] = min(A[i * 2 + 1], A[i * 2 + 2]);
		}
	}
	int query(int left, int right, int i = 0, int left2 = 0, int right2 = -1) {
		if (right2 == -1)right2 = n;
		if (right2 <= left || right <= left2) {
			return inf_;
		}
		if (left <= left2 && right2 <= right) {
			return A[i];
		}
		else {
			int mid = (left2 + right2) / 2;
			return min(query(left, right, i * 2 + 1, left2, mid), query(left, right, i * 2 + 2, mid, right2));
		}
	}
};
class rsq {//遅延セグ木
public:
	int n, max_n;
	vl A, Lazy;
	rsq(int n_) {
		n = 1;
		max_n = (1 << 18);
		while (n < n_)n *= 2;
		A.resize(max_n * 2 - 1);
		Lazy.resize(max_n * 2 - 1);
	}
	void propagate(int i, int left, int right) {
		if (Lazy[i] != 0) {
			A[i] += Lazy[i];
			if (right - left > 1) {
				Lazy[i * 2 + 1] += Lazy[i] / 2;
				Lazy[i * 2 + 2] += Lazy[i] / 2;
			}
			Lazy[i] = 0;
		}
	}
	void add(int left, int right, int x, int i = 0, int left2 = 0, int right2 = -1) {
		if (right2 == -1)right2 = n;
		propagate(i, left2, right2);
		if (right <= left2 || right2 <= left) return;

		if (left <= left2 && right2 <= right) {
			Lazy[i] += (right2 - left2) * x;
			propagate(i, left2, right2);

		}
		else {
			int mid = (left2 + right2) / 2;
			add(left, right, x, i * 2 + 1, left2, mid);
			add(left, right, x, i * 2 + 2, mid, right2);
			A[i] = A[i * 2 + 1] + A[i * 2 + 2];
		}

	}
	ll sum(int left, int right, int i = 0, int left2 = 0, int right2 = -1) {
		if (right2 == -1)right2 = n;
		if (right2 <= left || right <= left2) return 0;
		propagate(i, left2, right2);
		if (left <= left2 && right2 <= right) {
			return A[i];
		}
		else {
			int mid = (left2 + right2) / 2;
			ll res = 0;
			res += sum(left, right, i * 2 + 1, left2, mid);
			res += sum(left, right, i * 2 + 2, mid, right2);
			return res;
		}
	}
};
class binary_indexed_tree {//1-indexed
public:
	int n;
	vl A;
	binary_indexed_tree(int n_) {
		n = n_;
		A.resize(n + 1);//1-indexed
	}
	ll sum(int i) {//[0,i]の和を返す
		ll res = 0;
		while (i > 0) {
			res += A[i];
			i -= i & -i;
		}
		return res;
	}
	void add(int i, int x) {
		while (0 < i && i <= n) {
			A[i] += x;
			i += i & -i;
		}
	}
};
void dedupe(vi& A) {
	sort(A.begin(), A.end());
	A.erase(unique(A.begin(), A.end()), A.end());
}
int gcd(int a, int b) {//log N
	return (b == 0) ? a : gcd(b, a % b);
}
ll gcd(ll a, ll b) {//log N
	return (b == 0) ? a : gcd(b, a % b);
}
int lcm(int a, int b) {//log N
	return (a * b) / gcd(a, b);
}
ll lcm(ll a, ll b) {//log N
	return (a * b) / gcd(a, b);
}
int extgcd(int a, int b, int& x, int& y) {// log N
	int d = a;
	if (b == 0) {
		x = 1;
		y = 0;
	}
	else {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	return d;
}
vi get_primes(int limit) {//N log N
	vb A(limit + 1, true);
	for (int i = 2; i < A.size(); i++) {
		if (!A[i])continue;
		for (int j = i * 2; j < A.size(); j += i)A[j] = false;
	}
	vi B;
	for (int i = 2; i < A.size(); i++)
	{
		if (A[i])B.push_back(i);
	}
	return B;
}
template <class T>
bool is_prime(T num) {// sqrt(N)
	if (num < 2)return false;
	for (ll i = 2; i <= sqrt(num); i++)
	{
		if (num % i == 0) {
			return false;
		}
	}
	return true;
}
ll merge_count(vi & A) {//N log N
	const int inf = 1000000007;
	int n = A.size();
	if (n <= 1)return 0;
	long long count = 0;
	int mid = n / 2;
	vector<int> B(A.begin(), A.begin() + mid);
	vector<int> C(A.begin() + mid, A.end());
	count += merge_count(B);
	count += merge_count(C);
	B.push_back(inf);
	C.push_back(inf);
	int B_i = 0;
	int C_i = 0;
	for (int i = 0; i < n; i++) {
		if (B[B_i] <= C[C_i]) {
			A[i] = B[B_i++];
		}
		else {
			count += (n / 2) - B_i;
			A[i] = C[C_i++];
		}
	}
	return count;
}
ll perm(int n) {
	ll ret = 1;
	for (int i = 2; i <= n; i++)
	{
		ret *= i;
	}
	return ret;
}
ll comb(int left, int right) {
	ll N = 1;
	ll D = perm(right);
	for (int i = left; i>left-right; i--)
	{
		N *= i;
	}
	
	return N / D;
}
vi bit(int num, int size) {
	vi A;
	for (int j = 0; j < size; j++)
	{
		if ((num & (1 << (size - j - 1))) > 0) {
			A.push_back(1);
		}
		else {
			A.push_back(0);
		}
	}
	return A;
}
vvi bit_z(int size) {//2**N
	vvi A;
	for (int i = 0; i < (1 << size); i++)
	{
		vi temp = bit(i, size);
		A.push_back(temp);
	}
	return A;
}
vvi bit_z(int size, int n) {
	vvi A;
	int s = (1 << n) - 1;
	A.push_back(bit(s, size));
	while (true) {
		int x = s & (-s);
		int y = s + x;
		int z = s & (~y);

		z /= x;
		z = z >> 1;
		s = (y | z);
		if (s >= (1 << size))break;
		A.push_back(bit(s, size));
	}
	return A;
}
vvi bit_z(int size, int min, int max) {
	vvi A;
	for (int i = min; i <= max; i++)
	{
		vvi B = bit_z(size, i);
		A.insert(A.end(), B.begin(), B.end());
	}
	return A;
}
int random(int min, int max) {
	int r = rand() % (max + 1 - min) + min;
	return r;
}
vector< pair < ll, int > > factorize(ll n) {
	ll count = 0;
	vector< pair< ll, int > > res;
	for (ll i = 2; i * i <= n; i++)
	{
		if (n % i)continue;
		res.push_back(make_pair(i, 0));
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.push_back(make_pair(n, 1));
	return res;
}
vl dijkstra_am(int start,vvl& G) {//隣接行列
	int n = G.size();
	priority_queue<pair<ll, ll>, vector<pair<ll, ll> >, greater<pair<ll, ll>>  > Q;
	vl cost(n,inf18);
	cost[start] = 0;
	Q.push(make_pair(cost[start],start));
	while (!Q.empty()) {
		ll min_ = Q.top().first;
		int v = Q.top().second;
		Q.pop();
		if (cost[v] <min_)continue;
		for (int i = 0; i < n; i++)
		{
			if (min_ + G[v][i] < cost[i]) {
				cost[i] = min_ + G[v][i];
				Q.push(make_pair(min(inf18, min_ + G[v][i]), i));
			}
		}
	}
	return cost;
}
vl dijkstra_al(int start, vector<vector<pair<ll, ll> > >& G) {//隣接リスト
	int n = G.size();
	priority_queue<pair<ll, ll>, vector<pair<ll,ll> >, greater<pair<ll, ll>>  > Q;
	vl cost(n, inf18);
	cost[start] = 0;
	Q.push(make_pair(cost[start], start));
	while (!Q.empty()) {
		ll min_ = Q.top().first;
		int v = Q.top().second;
		Q.pop();
		if (cost[v] < min_)continue;
		for (int i = 0; i < G[v].size(); i++)
		{
			int u = G[v][i].first;
			if (min_ + G[v][i].second < cost[u]) {
				cost[u] = min_ + G[v][i].second;
				Q.push(make_pair(min(inf18, min_ + G[v][i].second), u));
			}
		}
	}
	return cost;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve() {
	ll a, b, k; cin >> a >> b >> k;
	if (a - k < 0LL) {
		k -= a;
		puts(0,max(b-k,0LL));
	}
	else {
		puts(a-k,b);
	}
}

signed main() {
	solve();
}

Submission status: Runtime Error

Solution code:
A,B,K = map(int,input().split())
for i in range(K):
    if A == 0:
        K_2 = K - i
        break
    A -= 1
for i in range(K_2):
    B -= 1
print(A,B)

Submission status: Runtime Error

Solution code:
a,b,k=map(int,input().split())

a2=a-min(a,k)
if k > a:
    b2=b-min(b,k-a)
print(a2,b2)

Submission status: Runtime Error

Solution code:
s=input().split()
a=int(s[0])
b=int(s[1])
k=int(s[2])
if a>=k:
    print((a-k)+" "+b)
else:
    if a+b>=k:
        print("0 "+b+a-k)
    else:
        print("0 0")

Submission status: Runtime Error

Solution code:
A, B, K = [int(s) for s in input().split()]
if K <= A:
  print(str(A-K)+' '+str(B))
else
  print(str(0)+' '+str(A+B-K))

Submission status: Runtime Error

Solution code:
#coding:utf-8
import sys
sys.setrecursionlimit(1000000000000)
a, b, k = map(int, input().split())

for i in range(0, k):
    if a >= 1:
        a = a - 1
    elif b >= 1:
        b = b - 1
    else:
        pass

print(a, b)

Submission status: Runtime Error

Solution code:
A, B, K = map(int,input().split())
if K >=A+B:
    print("0 0")
elif A+B>K>=A:
    p = A+B-K
    print(f"0 {p}")
else:
    q = A-K
    print(f"{q} {B}")

Submission status: Runtime Error

Solution code:
def run(a, b, k):
    ans1 = a - k
    if ans1 < 0:
        ans2 = b + ans1
        ans1 = 0
    return ans1, ans2


def main():
    a, b, k = map(int, input().split())
    ans = run(a, b, k)
    print(ans[0], ans[1])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b,k = map(int,input().split())

ans_t = max(a-k,0)
if a-k < 0:
  ans_a = max(b-(k-a),0)
print(ans_t,ans_a)

Submission status: Runtime Error

Solution code:
a, b, k = map(int, input().split())

print(max(0, a-k)+' '+max(0, a+b-k))

Submission status: Runtime Error

Solution code:
A, B, K = map(int,input().split())

if A > K:
  A -= K
else:
  A = 0
  B = max(0, A + B - K)

print(A + " " + B)