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:
a, b, k = map(int, input().split(' '))

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

Submission status: Accepted

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

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

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

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

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


main()

Submission status: Accepted

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

r1 = a-k
if r1<0:
    r2 = b+r1
else:
    r2 = b

print(str(max(r1,0)) + " " + str(max(r2,0)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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,input().split())
if A >= K:
    print(A-K,B)
else:
    print(0,max(B+A-K,0))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

def main():
    A,B,K = map(int, input().split())
    if A >= K:
        A = A - K
    else:
        B = B - (K - A) 
        A = 0
        if B < 0:
            B = 0


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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

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

if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

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

tkhs = max(a-k,0)

if tkhs != 0:
    aoki = b
else:
    aoki = max(b-(k-a),0)

print(tkhs,aoki)

Submission status: Accepted

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

myans = []

if A - K >= 0:
    myans += [A - K]
    myans += [B]
else:
    myans += [0]
    if (A +B) - K >= 0:
        myans += [(A +B) - K]
    else:
        myans += [0]

print(' '.join(map(str,myans)))

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:
import numpy as np
def main():
    ABK = [np.int64(i) for i in input().split(" ")]
    A = ABK[0]
    B = ABK[1]
    K = ABK[2]

    ans = 0

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

    ans = "{0} {1}".format(A, B)

    print(ans)
 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K = list(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 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+B)):
    print(0,0)
elif(K<=A):
    print(A-K,B)
else:
    print(0,B+A-K)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
if A >= K:
    A -= K
else:
    B = max(B+A-K, 0)
    A = 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:
#coding:utf-8
import sys
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = lambda *something : print(*something) if DEBUG else 0
DEBUG = False
def main(given = sys.stdin.readline):
    input = lambda : given().rstrip()
    LMIIS = lambda : list(map(int,input().split()))
    II = lambda : int(input())
    XLMIIS = lambda x : [LMIIS() for _ in range(x)]

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if A<=K:
    C=0
    B+=A-K
else:
    C=A-K

print(str(C)+' '+str(max(B,0)))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

fin_a = max(a-k, 0)
new_k = max(k-a, 0)

fin_b = max(b-new_k, 0)

print(fin_a, fin_b)

Submission status: Accepted

Solution code:
def main():
    A, B, K = list(map(int, input().split()))
    if K <= A:
        A = A - K
    else:
        B = B - (K - A)
        A = 0

    if A < 0:
        A = 0
    if B < 0:
        B = 0
    return(A, B)

if __name__ == '__main__':
    A, B = main()
    print(A, B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

    B += nokori
    if B > 0:
        print(0, B)
        return

    print(0, 0)


if __name__ == "__main__":
    main()

Submission status: Accepted

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


def main():
    A, B, K = map(int, input().split())
    a = min(A, K)
    A -= a
    K -= a
    b = min(B, K)
    B -= b

    print(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
	A, B, K = map(int, input().split())
	ans1 = max(A - K, 0)
	ans2 = max(B - max(K - A, 0), 0)
	print("{0} {1}".format(ans1, ans2))

Submission status: Accepted

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

a = max(A - K, 0)
K -= A - a
b = max(B - K, 0)
print(*[a, b])

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("0 0")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections as c
ip = lambda : map(int, input().split())
# ##############

a,b,k = ip()
if a>=k:
    print(a-k,b)
elif a+b >= k:
    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:
    K = K -A
    print(0, max(B-K, 0))

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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:
    a -= k
    print(str(a) + " " + str(b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10000001
MOD = 10**9+7
spf = [i for i in range(MAXN)]
spf[0]=spf[1] = -1
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]

def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))

def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))

def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD

    return (num*(pow(den,MOD-2,MOD)))%MOD

def flush():
    return sys.stdout.flush()

'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''
a,b,k = arrIN()
if a>=k:
    a-=k
    print(a,b)
    exit(0)
k-=a
a = 0
b-=min(b,k)
print(a,b)

Submission status: Accepted

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

################ DANGER ################
test = ""
#test = \
"""
2 5 10
"""
########################################
test = list(reversed(test.strip().splitlines()))
if test:
    def input2():
        return test.pop()
else:
    def input2():
        return input()
########################################  
        
a, b, n = map(int, input2().split())

print(max(0, a-n), max(0, b-max(n-a, 0)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_list = input().split(' ')
A, B, K = [int(x) for x in str_list]
takahashi = max(A-K, 0)
if takahashi==A-K:
    aoki=B
else:
    aoki = max(B-(K-A), 0)
print('%d %d' % (takahashi, aoki))

Submission status: Accepted

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

if a>=k:
    ans1 = a - k
    ans2 = b
else:
    ans1 = 0
    if b>=(k-a):
        ans2 = b - (k-a)
    else:
        ans2 = 0 

print(ans1,ans2)

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(A,B)

Submission status: Accepted

Solution code:
A,B,K = map(int, input().strip().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())

ans_A = max(A-K, 0)
K = max(K - A, 0)
ans_B = max(B-K, 0)

print(ans_A, ans_B)

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
a = max(A-K, 0)
b = max(min(A-K, 0) + 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, a + b - k)
else:
    print(0, 0)

Submission status: Accepted

Solution code:
#B
A,B,K = map(int,input().split())
if A > K:
    a = A-K
    print(a,B)
else:
    a = 0
    b = max(0,B-(K-A))
    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, 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)
else:
    print(0, max(0, b-(k-a)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline



    a, b, k = map(int, input().split())
    t = max([0, a-k])
    ao = max([b-(k-(a-t)), 0])
    print(str(t) + ' ' + str(ao))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
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:
def p_b():
    a, b, k = map(int, input().split())
    if a >= k:
        a -= k
    else:
        b -= k - a
        b = max(0, b)
        a = 0
    print(a, b)
    
p_b()

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())

takahashi = a
aoki = b

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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 k>=a:
    print(0,max(0,b+a-k))
else:
    print(max(0,a-k),b)

Submission status: Accepted

Solution code:
#N = int(input())
A,B,K= map(int,input().split())
#v =list(map(int,input().split()))
# [list(map(int,input().split())) for i in range(N)]

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B, K = map(int, input().split())
        tc= max(A - K, 0)
        ac = min(max(A + B - K, 0), B)
        print(str(tc) + ' ' + str(ac))


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

Solution code:


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



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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A, B, K = map(int, input().split())

print(max(0, A - K), max(0, min(B, B + (A - K))))

Submission status: Accepted

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

actual_a = a
actual_k = k
k -= min(a, k) 
a -= min(actual_a, actual_k)
b -= min(b, k)

print('{} {}'.format(a, b))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

    else:
        print(a, b - k)

else:
    print(a - k, 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,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)
  exit()
if a <= k:
  print(0, a + b - k)
  exit()
print(a - k, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(A, B, K):
    if K >= A:
        K -= A
        A = 0
    else:
        A -= K
        K = 0

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

    return '%d %d' % (A, B)


def main():
    A, B, K = read_int_n()
    print(slv(A, B, K))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B, K = map(int,input().split())
t = min(A, K)
A -= t
K -= t
if K:
    B = max(B-K , 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))
else:
  if a+b>=k:
    print(str(0)+' '+str(b-(k-a)))
  else:
    print(str(0)+' '+str(0))

Submission status: Accepted

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

S=T
T-=min(T,K)
K=K-(S-T)
A-=min(A,K)
print(T,A)

Submission status: Accepted

Solution code:
# N = int(input())
a, b, k = map(int, input().split())
# l = [int(x) for x in input().split()]
if a <= k:
    k -= a
    a = 0
    
    if b <= k:
        b = 0
    else:
        b -= k
else:
    a -= k
    
print(a, b)

Submission status: Accepted

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

rem = a - k

if rem < 0:
    print('0 {}'.format(max(b+rem, 0)))
else:
    print('{} {}'.format(rem, b))

Submission status: Accepted

Solution code:
takahashi, aoki, n = map(int, input().split())
me = min(takahashi, n)
takahashi -= me
n -= me
aoki -= min(aoki, n)
print('%d %d' % (takahashi, aoki))

Submission status: Accepted

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

print(s, t)

Submission status: Accepted

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





print(x,y)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
abk=input().split(" ")
A=int(abk[0])
B=int(abk[1])
K=int(abk[2])
if A>=K:
  print(str(A-K)+" "+str(B))
else:
  print("0 "+str(max(0,A+B-K)))

Submission status: Accepted

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

if a+b < k:
    print("0 0")
    exit()

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

b -= k
print(a, b)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

a,b,k=map(int,readline().split())
if k > a+b:
  print(0,0)
  quit()
if 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 + b) <= k:
    a, b = 0, 0
elif a <= k:
    a, b = 0, b - (k - a)
else:
    a, b = a - k, b
print(a, b)

Submission status: Accepted

Solution code:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    a,b,k = map(int,input().split())
    if k<a:
        print((a-k),b)
    else:
        k -= a
        if k<b:
            print('0',(b-k))
        else:
            print('0 0')
    return

if __name__=='__main__':
    main()

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())
if a + b >= k:
    if a >= k:
        print(a-k, b)
    else:
        print(0, b-(k-a))
else:
    print(0, 0)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

print(A, B)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a,b)

Submission status: Accepted

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

A,B,K=LI()

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 a >= k:
    print(a-k, b)
elif a+b >= k:
    print(0, a+b-k)
else:
    print(0, 0)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    A, B, K = map(int, input().split())
    
    a = b = 0
    if A>=K:
        a = A - K
        b = B
    elif A+B>=K:
        a = 0
        b = A + B - K
    
    print(str(a) + " " + str(b))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

rem = K

rem = K - A

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

Submission status: Accepted

Solution code:
def main():
    A, B, K = (int(i) for i in input().split())
    if A < K:
        K -= A
        A = 0
        B = max(0, B-K)
    else:
        A -= K
    print(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import collections
import numpy as np
input = sys.stdin.readline
A, B, K = [int(x) for x in input().split()]
if A + B <= K:
    print(*[0,0])
elif A >= K:
    print(*[A-K, B])
else:
    print(*[0, B - (K - A)])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def solve():
  A, B, K = map(int, input().split())
  if K >= A + B: return '0 0'
  if K <= A: return str(A - K) + ' ' + str(B)
  return '0 ' + str(A + B - K)

print(solve())