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: Accepted

Solution code:
takahashi, aoki, count = map(int, input().split())
if takahashi >= count:
    takahashi -= count
elif takahashi < count and aoki > count - takahashi:
    aoki -= count - takahashi
    takahashi = 0
    
else:
    takahashi, aoki = 0, 0
print(takahashi, aoki)

Submission status: Accepted

Solution code:
a,b,k = map(int, input().split())
print('{} {}'.format(max(0,a-k), max(0, b - max(0, k-a))))

Submission status: Accepted

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

Submission status: Accepted

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

if a > k:
  aa = a - k
  bb = b

else:
  aa = 0
  bb = max( 0, b - ( k - a ))

print(aa , bb)

Submission status: Accepted

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

if A > K:
  Ta = A - K
  Ao = B
  
elif B > K - A:
  Ta = 0
  Ao = B - (K - A)
  
else:
  Ta = 0
  Ao = 0
  
print(Ta, Ao)

Submission status: Accepted

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

takahashi_cookie = A
aoki_cookie = B
iteration = K

if 0 <= takahashi_cookie - iteration:
  takahashi_cookie -= iteration
 
elif 0 <= aoki_cookie + takahashi_cookie - iteration:
  aoki_cookie = aoki_cookie + takahashi_cookie - iteration
  takahashi_cookie = 0

else:
  takahashi_cookie = 0
  aoki_cookie = 0

print(str(takahashi_cookie) + ' ' + str(aoki_cookie))

Submission status: Accepted

Solution code:
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

def debug(*var, sep = ' ', end = '\n'):
    print(*var, file=sys.stderr, end = end, sep = sep)

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
# from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

a, b, k = I()
m = min(a, k)
a -= m
k -= m
m = min(b, k)
b -= m
print(a, b)

Submission status: Accepted

Solution code:
A, B, K = list(map(int, input().split(" ")))
times = min(A, K)
K -= times
print(A-times, max(B-K, 0))

Submission status: Accepted

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: Accepted

Solution code:
a=[int(i) for i in input().split()]
k=a[2]
if(a[0]<=k):
    k-=a[0]
    a[0]=0
else:
    a[0]-=k
    k=0
if(k>0):
    if(a[1]>k):
        a[1]-=k
    else:
        a[1]=0
print(a[0],a[1])

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
eaten = min(K, A)
K -= eaten
print(A-eaten, max(B-K, 0))

Submission status: Accepted

Solution code:
taka, aoki, action = map(int, input().split())
 
if taka >= action:
  print(taka-action, aoki)
  
else:
  print(0, max(taka+aoki-action, 0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a-k>0:
  a -= k
  print(a,b)
  exit()
else:
  k -= a
  a = 0
if b-k>0:
  b -=k
  print(a,b)
  exit()
else:
  print(a,0)

Submission status: Accepted

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

temp_a = a
if (k >= a):
  a = 0
else :
  a = (a - k)
k = k - temp_a

if k < 0 :
  k = 0
if (k >= b):
  b = 0
else :
  b = (b - k)


print("%s %s" % (a,b))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b,k = inm()
print("{} {}".format(max(0,a-k), max(0,b-max(0,k-a))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

    if k - a < 0:
        print(a - k, b)
    else:
        if (k - a) - b < 0:
            print(0, b - (k - a))
        else:
            print(0, 0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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



if b >= k:
     b -= k
     k = 0
else:
     b = 0
print(a, b)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
a = max(0, A-K)
K = max(0, K-A)
b = max(0, B-K)
print(str(a) + ' ' + str(b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S=max([0,A-K])

if A<K:
  T=max([0,B-(K-A)])

else:
  T=B

print(str(S)+" "+str(T))

Submission status: Accepted

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

X = A-K
if(X >= 0):
  A=X
  print(A,B)
  
elif(X < 0 ):
  A=0
  if(B+X>=0):
    B=B+X
    print(A,B)
  elif(B+X<0):
    print(0,0)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
print(max(0,A-K),max(0,min(B,A+B-K)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

mi = min(A, K)
A -= mi
K -= mi
mi = min(B, K)
B -= mi

print A, B

Submission status: Accepted

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

if k <= a:
    a, b = a - k, b
elif k <= a + b:
    a, b = 0, b - (k - a)
else:
    a, b = 0, 0
        
print a, b

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = [int(_) for _ in input().split()]

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

elif K >= A:
    if B >= K-A:
        print(0, B-(K-A))
    else:
        print(0,0)

Submission status: Accepted

Solution code:
input_line = input().split(' ')
taka = int(input_line[0])
aoki = int(input_line[1])
numK = int(input_line[2])
result = ""
if taka + aoki <= numK:
  result = "0 0"
elif taka >= numK:
  result = str(taka - numK) + " " + str(aoki)
elif taka + aoki > numK:
  result = "0 " + str(taka + aoki - numK)
  
print(result)

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
A = max(a-k,0)
B = max(b-max(k-a,0),0)
print(A,B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  A,B,K = input().split()
  A=int(A)
  B=int(B)
  K=int(K)
  
  if(A+B<=K):
    print("0","0")
  elif(A>=K):
    print(A-K,B)
  else:
    print("0",A+B-K)
    
if __name__=="__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a>=k:
    print(a-k, b)
elif a+b>=k:
    print(0, b-k+a)
else:
    print(0, 0)

Submission status: Accepted

Solution code:
Taka, Aoki, K = map(int, input().split())
dif = Taka - K
if dif >= 0:
    Taka -= K
else:
    dif = abs(dif)
    Taka = 0
    dif = Aoki - dif
    if dif >= 0:
        Aoki = dif
    else:
        Aoki = 0
print(Taka, Aoki)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

# 最小公倍数
def gcd(a, b):
	if a < b:
		a, b = b, a
	while a % b != 0:
		a, b = b, a % b
	return b
 
# 最大公約数 
def lcm(a, b):
	y = a*b / gcd(a, b)
	return int(y)

a, b, k = MAP()

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




# while k > 0:
#   if a >= 1:
#     a = a - 1
#   elif b >= 1:
#     b = b - 1
#   k = k - 1

Submission status: Accepted

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

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

print("{} {}".format(A, B))

Submission status: Accepted

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

Submission status: Accepted

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

p=0
q=0

if k<=a:
    p=a-k
    q=b
elif k-a<=b:
    p=0
    q=b-(k-a)
else:
    p=0
    q=0

print("{} {}".format(p, q))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, K = [int(_) for _ in input().split()]

X = max(0, A - K)
Y = max(0, min(A + B - K, B))

print(X, Y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
import numpy as np
from functools import lru_cache
import time

def main(): 
    if True:
        A,B,K = list(map(
            int, input().split()))
    else:
        pass

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



if __name__ =='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(a, b, k):
    d = min(a, k)
    a -= d
    k -= d
    d = min(b, k)
    b -= d
    return "%d %d" % (a, b)

assert solve(2, 3, 3) == "0 2"
assert solve(500000000000, 500000000000, 1000000000000) == "0 0"

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

Submission status: Accepted

Solution code:
A,B,K = map(int, input().split())
if A >= 1:
    if K - A >= 0:
        K = K - A
        A = 0
        if K - B >= 0:
            B = 0
        else:
            B = B - K
    else:
        A = A - K
else:
    if K - B >= 0:
        B = 0
    else:
        B = B - K
print("{} {}".format(A, B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(map(int,input().split()))
a = 0
if s[2] >= s[0]:
    a = s[2] - s[0]
    s[0] = 0
    if a >= s[1]:
        s[1] = 0
    else:
        s[1] = s[1] - a
else:
    s[0] = s[0] - s[2]

print(str(s[0]) + ' ' + str(s[1]))

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
if (A+B)<=K:
  print('0 0')
else:
  if A <= K:
    if B <= (K-A):
      print('0 0')
    else:
      print('0 {}'.format(str(B-(K-A))))
  else:
    print('{} {}'.format(str(A-K),str(B)))

Submission status: Accepted

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

Submission status: Accepted

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

A, K = max(0, A - K), max(0, K - A)
B, K = max(0, B - K), max(0, K - B)
print(A, B)

Submission status: Accepted

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

if a + b <= k:
    a = b = 0
elif a < k and k < a + b:
    b = b + a - k
    a = 0
else:
    a -= k

print(a, b)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

if __name__=='__main__':
  a, b, k = map(int, input().strip().split())
  print(max(0, a-k), max(0, b-max(0, k-a)))

Submission status: Accepted

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

if K >= T + A:
    print(0, 0)
elif T >= K:
    T -= K
    print(T, A)
else :
    K -= T
    T = 0
    A -= K
    print(T, A)

Submission status: Accepted

Solution code:
def main():
    A, B, K = map(int, input().split())
    a = max(A-K, 0)
    b = B - max(min(K-A, B), 0)
    print(a, b)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
a,b,k = map(int,input().split())
"""
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
print(a,b)
"""

if k <= a and a >= 1:
    a = a - k
elif k <= a + b and b >= 1:
    c = a
    a = 0
    b = b - (k - c)
else:
    a = 0
    b = 0
print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if k <= a:
    print(str(a-k),str(b))
elif k <= a+b:
    print(str(0),str(b-(k-a)))
else:
    print(str(0),str(0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if K <= A:
    A -= K
elif A < K and K < A+B:
    K -= A
    B -= K
    A = 0
else:
    K -= A
    K -= B
    A = 0
    B = 0
print("%d %d"%(A, B))

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
li=[0,0]
li[0]=max(a-k,0)
li[1]=max(min(b-(k-a),b),0)
print(*li)

Submission status: Accepted

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

if k < a:
    print(a - k, b)
else:
    print(0, max(0, a + b - k))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

Solution code:
a,b,k=[int(i) for i in input().split()]
if a<=k:
    k-=a
    a=0
else:
    a-=k
    k=0
if b<=k:
    k-=b
    b=0
else:
    b-=k
print('%d %d'%(a,b))

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys
import bisect
import math
import itertools
import string
import queue
import copy
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
 
def inp(): # n=1
    return int(input())
def inpm(): # x=1,y=2
    return map(int,input().split())
def inpl(): # a=[1,2,3,4,5,...,n]
    return list(map(int, input().split()))
def inpls(): # a=['1','2','3',...,'n']
    return list(input().split())
def inplm(n): # x=[] 複数行
    return list(int(input()) for _ in range(n))
def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]
    return [list(map(int, input().split())) for _ in range(n)]


def main():
    a,b,k = inpm()
    a,k = a-k,k-a
    if a < 0:
        a = 0
    if k > 0:
        b -= k
    if b < 0:
        b = 0
    print(a,b)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
print(max(A - K, 0), max(min(A + B - K, B), 0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
if a>=k:
  aans=a-k;
  bans=b
  
else:
  aans=0;
  bans=max(0,b-(k-a))

print(aans,bans)

Submission status: Accepted

Solution code:
from sys import stdin

A, B, K = [int(x) for x in stdin.readline().rstrip().split()]

if A - K >= 0:
    print(A - K, B)
elif A - K < 0:
    print(0, max(0, B + (A - K)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if K>=A+B:
  A,B=0,0
elif K<A+B:
  if K>A:
    A,B=0,B-K+A
  if K<=A:
    A,B=A-K,B

print(A,B)

Submission status: Accepted

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

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

Submission status: Accepted

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

if a+b<=n:
  a=0
  b=0
else:
  if n>a:
    b -= n-a
    a=0
    if b < 0:
      b = 0
  else:
    a = a - n

print("%d %d" %(a,b))

Submission status: Accepted

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

Submission status: Accepted

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

C = max(0, A - K)
K -= A - C
print(C, max(0, B - K))

Submission status: Accepted

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

if a >= k:
	a = a - k
elif a + b >= k:
	b = b - (k - a)
	a = 0
else:
	a = 0
	b = 0
		
print(a, b)

Submission status: Accepted

Solution code:
def getdata_input():
    while True:
        yield input()
def callFunc2(it):
    A0,B0,K=map(int, next(it).split())
    A=[0]
    B=[0]
    
    t=min(K,A0)
    A.append(t)
    t=min(K-t,B0)
    B.append(min(t,B0))
    return(" ".join([str(A0-sum(A)), str(B0-sum(B))]))
  
it=getdata_input()
print(callFunc2(it))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = [int(x) for x in input().split()]

if A >= K:
    t = A - K
    a = B
else:
    t = 0
    res = K - A
    if res < B:
        a = B - res
    else:
        a = 0

print("{} {}".format(t, a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


print(str(a)+' '+str(b))

Submission status: Accepted

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

if k <= a:
   print(a - k, b)
elif a < k <= a+b:
   print(0, a+b-k)
else:
   print(0, 0)

Submission status: Accepted

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


if k <= a:
    a -= k

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

Submission status: Accepted

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

Submission status: Accepted

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

if a >= k:
    print(a - k, b)
    exit(0)

k = k - a
if b >= k:
    print(0, b - k)
    exit(0)
else:
    print(0, 0)
    exit(0)

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
print(a-min(a, k), max(b-(k - min(a, k)), 0))

Submission status: Accepted

Solution code:
lst = list(map(int,input().split()))
a = lst[0]-lst[2]
ans1 = max(a, 0)
b = lst[1] + min(0, a)
ans2 = max(b, 0)
print(str(ans1) + " " + str(ans2))

Submission status: Accepted

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

if(A>K):
    A-=K
    print(A,B)
elif(A+B>K):
    B-=K-A
    print(0,B)
else:
    print("0 0")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

if A >= K : 
    A = A - K
    K = 0
else : 
    K = K - A
    A = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b,k=[int(i) for i in 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: Accepted

Solution code:
a,b,k=map(int,input().split())
atmp=max(0,a-k)
ktmp=max(k-a,0)
btmp=max(0,b-ktmp)
print(atmp,btmp)

Submission status: Accepted

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

ans1=0
ans2=0
if k>=a:
    ans1=0
    if a+b<=k:
        ans2=0
    else:
        ans2=b-(k-a)
else:
    ans1=a-k
    ans2=b
print(ans1,ans2)

Submission status: Accepted

Solution code:
# B - Greedy Takahashi

A, B, K = [int(x) for x in input().split()]
AB = A + B
if A > K:
    print(A - K, B)
elif AB > K:
    print(0, AB - K)
else:
    print(0, 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a >= k:
	print(str(a - k) + ' ' + str(b))
elif a + b >= k > a:
	print(str(0) + ' ' + str((a + b) - k))
elif k > a + b:
	print(str(0) + ' ' + str(0))

Submission status: Accepted

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

Submission status: Accepted

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

if A > K:
    print(A - K,B)
elif sum > K:
    print(0,sum - K)
else:
    print(0,0)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A = []
if a < c:
    A.append(0)
    c = c-a
    if b<c:
        A.append(0)
    else:
        A.append(b-c)
else:
    A.append(a-c)
    A.append(b)

print(A[0], A[1])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
from fractions import gcd
from itertools import count
from functools import lru_cache
from collections import defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok
#

def main():
    A,B,K = mis()
    if A >= K:
        print(A-K, B)
    else:
        K -= A
        print(0, max(0, B-K))


main()

Submission status: Accepted

Solution code:
import sys
a, b, k = [int(i) for i in sys.stdin.readline().split()]
print(max(0, a - k), max(0, min(b, a+b-k)))

Submission status: Accepted

Solution code:
takahashi, aoki, k = map(int, input().split(" "))


if k >= takahashi:
    k -= takahashi
    takahashi = 0
    if k >= aoki:
        k -= aoki
        aoki = 0
    else:
        aoki -= k 
else:
    takahashi -= k
        
print(takahashi, aoki)

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
a=max(0,A-K)
b=min(A+B-K,B)
if b<0:
  b=0
print(*[a,b])

Submission status: Accepted

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

if a > k or a == k:
    a = a - k
    print(a, b)
else:
    tem = k - a
    a = 0
    if b > tem or b == tem:
        b = b - tem
        print(a, b)
    else:
        b = 0
        print(a, b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

a,b,k=map(int,input().split())
tmp=k; k=max(0,k-a)
a=max(0,a-tmp)

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

if A < K:
    if B > K - A:
        B -= K - A
    else:
        B = 0
    A = 0
else:
    A -= K

print(A, B)