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:
l = input().split(" ")
x = int(l[0])
y = int(l[1])
z = int(l[2])

x -= z
if x < 0:
  y += x
  x = 0
if y < 0:
  y = 0
print(x, y)

Submission status: Accepted

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

	print(a, b)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

elif A<K and K-A>B:
    print(0,0)
else:
    print(0,0)

Submission status: Accepted

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

Submission status: Accepted

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

if A <= K:
    print('{} {}'.format(0, max(B - (K - A), 0)))
else:
    print('{} {}'.format(A - K, B))

Submission status: Accepted

Solution code:
from sys import stdin
A, B, K = [int(_) for _ in stdin.readline().rstrip().split()]
print(max(0, A-K), max(0, min(B-(K-A), B)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

print(A,B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(map(int,input().split()))

l[0] = l[0] - l[2]

if l[0] < 0:
  l[1] = l[1] + l[0]
  l[0] = 0
  if l[1] < 0:
    l[1] = 0

print(str(l[0]) + " " + str(l[1]))

Submission status: Accepted

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

if a > k:
    a1 = a - k
    b1 = b

else:
    a1 = 0
    b1 = max(b -(k - a),0)
    
print(a1, b1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A,B,K = map(int, read().decode("utf-8").split())

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

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

print(0, 0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = max(K - A, 0)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 8, Jan, 2020
problem : ABC149
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

x = min(A, K)
A -= x
K -= x

x = min(B, K)
B -= x

print(A, B)

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 8, Jan, 2020
problem : ABC149
"""

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

A, B, K = map(int, read().decode('utf-8').split())

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

Submission status: Accepted

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

Submission status: Accepted

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

    a=0

print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    a, b, k = list(map(int, input().rstrip('\n').split()))
    t = min(a, k)
    a -= t
    k -= t
    t = min(b, k)
    b -= t
    print(a, b)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split(' '))
odd_a, odd_b = a, b
odd_a = a - k
if odd_a < 0:
    odd_b += odd_a
    odd_a = 0
    if odd_b < 0:
        odd_b = 0

print(odd_a, odd_b)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
s = input().split()
a = int(s[0])
b = int(s[1])
k = int(s[2])

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

Submission status: Accepted

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

print(str(out1) + ' ' + str(out2))

Submission status: Accepted

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

x = max(0,A - K)
y = B

if x == 0:
  y = max(0,B - (K - A))

print(x,y)

Submission status: Accepted

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

if k < a:
  a = a-k

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

Submission status: Accepted

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

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 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)
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())
if A >= K:
    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:
    a -= k


elif a + b <= k:
    a = 0
    b = 0

else:
    b = b - (k - a)
    a = 0
print(str(a)+' '+str(b))

Submission status: Accepted

Solution code:
n1, n2, n3 = [int(i) for i in input().split()]

if n1 >= n3:
    n1 -= n3
elif n1 + n2 >= n3:
    n2 -= (n3 - n1)
    n1 = 0
else:
    n1 = 0
    n2 = 0

print(str(n1) + " " + str(n2))

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
line_str = input().split()

A = int(line_str[0])
B = int(line_str[1])
K = int(line_str[2])

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
stra, strb, strk = input().split()
a = int(stra)
b = int(strb)
k = int(strk)
if a >= k :
  a = a - k
  k = 0
else:
  k = k - a
  a = 0
#  print("{} {} {}\n".format(a,b,k))

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

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

Submission status: Accepted

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

    '''
    for i in range(K):
        if 1 <= A:
            A-=1
        elif 1 <= B:
            B-=1
    '''

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

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
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 (A <= K) :
    K -= A
    A = 0
else :
    A -= K
    K = 0

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

print(A,B)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def resolve():
    A, B, K = map(int, input().split())
    A_res = A - K
    if A_res >= 0:
        print(A_res, B)
        return
    
    B_res = B + A_res
    if B_res >= 0:
        print(0, B_res)
        return 

    print(0, 0)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

Solution code:
import sys

def stdin_parse_int():
    a = list(map(int,input().split()))
    return a

list = stdin_parse_int()
A = list[0]
B = list[1]
K = list[2]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

lines = sys.stdin.readlines()

a, b, k = map(int, lines[0].split())

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
takahashi, aoki, n = [int(i) for i in input().split()]
rtaka = takahashi-n
raoki = aoki if rtaka >= 0 else aoki+rtaka
print(str(max(rtaka, 0)), str(max(raoki, 0)))

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("{} {}".format(a, b))

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
A, B, K = map(int, input().split())

if A+B <= K :
  print ("0 0")
  exit()

if A >= K :
  print (str(A-K) + " " + str(B))
  exit()
elif A+B > K :
  print ("0 " + str(B-(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:
A, B, K = map(int, input().split())

if(K >= A):
    result1 = 0
    x = K - A
    B = B - x
    result2 = B if B >= 0 else 0
else:
    result1 = A - K
    result2 = B

print('{} {}'.format(result1, result2))

Submission status: Accepted

Solution code:
#ABC149 B

#K>AのときはAは0になり、その残りをBから引く。
#それ以外のときはA-Kをする。Bはそのまま。

A,B,K=(int(i) for i in input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

inputA,inputB,inputC = map(int, input().split())

if inputC >= inputA:
    if inputB > inputC-inputA:
        print(0,inputB -(inputC-inputA))
    else:
        print(0,0)
else:
    print(inputA-inputC,inputB)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
print(A,B)

Submission status: Accepted

Solution code:
a,b,k = (int(w) for w in input().split()[:3])

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

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

Submission status: Accepted

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

if A-K>=0:
    ans1=A-K
    ans2=B
else:
    if B-(K-A)<=0:
        ans1=0
        ans2=0
    else:
        ans1=0
        ans2=B-(K-A)

print(ans1,ans2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

A -= K
if(A < 0):
    B -= abs(A)
    A = 0
    if(B < 0):
        B = 0

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

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split())
A1 = K - A
if A1 > 0:
    B1 = B - A1
    print(0,end =" ")
    if B1 < 0:
        print(0)
    else:
        print(B1)
else:
    A2 = A - K
    print(A2,end =" ")
    print(B)

Submission status: Accepted

Solution code:
s, t, k = map(int,input().split())

if s>=k:
  ans_s = s-k
  ans_t = t
else:
  ans_s, k = 0, k-s
  if k<t:
    ans_t = t-k
  else:
    ans_t = 0
print(ans_s, ans_t)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
taka=a-c
aoki=b
if taka<0:
  taka=0
  aoki=b+a-c
  if aoki < 0:
    aoki=0

print(taka,aoki)

Submission status: Accepted

Solution code:
a = input().rstrip().split(' ')
b=[int(i) for i in a]
S,T,U=b[0],b[1],b[2]
if S>U:
    S1=S-U
    print(S1,T)
elif S==U:
    print(0,T)
elif S<U and S+T>U:
    U1=U-S
    T1=T-U1
    print(0,T1)
else:
    print(0,0)

Submission status: Accepted

Solution code:

#ライブラリインポート
from collections import defaultdict

#入力受け取り
def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	A, B, K = getlist()
	if A > K:
		print(A - K, B)
	elif A + B > K:
		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())

n_takahashi = a
n_aoki = b

cookies_to_eat = k
if n_takahashi > cookies_to_eat:
    n_takahashi = n_takahashi - cookies_to_eat
    cookies_to_eat = 0
else:
    cookies_to_eat = cookies_to_eat - n_takahashi
    n_takahashi = 0

if n_aoki > cookies_to_eat:
    n_aoki = n_aoki - cookies_to_eat
    cookies_to_eat = 0
else:
    cookies_to_eat = cookies_to_eat - n_aoki
    n_aoki = 0

print('{} {}'.format(n_takahashi, n_aoki))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(string):
    a, b, k = map(int, string.split())
    return "{} {}".format(max(0, a - k), max(0, min(b, a + b - k)))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Accepted

Solution code:
a, b, k = map(int, input("").split(" "))
if k >= a:
    print("0 {}".format(b-(k-a) if k-a < b else 0))
else:
    print("{} {}".format(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:
A,B,K=(int(x) for x in input().split())
a,b=A,B
if a>=K:
  a=a-K
elif a<K:
  a=0
  K=K-A
  if b>=K:
    b=b-K
  else:
    b=0
print(a,b)

Submission status: Accepted

Solution code:
# ABC149B - Greedy Takahashi
def main():
    A, B, K = map(int, input().split())
    if K <= A:
        print(A - K, B)
    else:
        print(0, max(0, B - (K - A)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A,B,K = map(float,raw_input().split())
ans_A=0
ans_B=0
if A <= K:
  ans_A=0
  if K-A < B:
    ans_B = int(B-(K-A))
    print ans_A,ans_B
  else:
    print 0,0
else:
  ans_A=A-K
  print int(ans_A),int(B)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if a < k:
  a1 = k - a
  a2 = b - a1 if b > a1 else 0
  print('0 ' + str(a2))
        
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 A <= K < A+B:
  print(0, A+B-K)
else:
  print(0,0)

Submission status: Accepted

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

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

Submission status: Accepted

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

a,b,k = (int(x) for x 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())
x = max(a-k, 0)
y = max(min(b, (a+b-k)), 0)
print(x, y)

Submission status: Accepted

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

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

else:
    print('0 0')

Submission status: Accepted

Solution code:
a,b,k = input().split()
a = int(a)
b = int(b)
k = int(k)
if a >= k:
    print(a-k, b)
elif a < k  and 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 + b <= k:
    print(0,0)
elif a <= k:
    print(0, a+b-k)
else:
    print(a-k,b)

Submission status: Accepted

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

a = a - k

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

Submission status: Accepted

Solution code:


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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

if k != 0:
    diva = a / k
    if diva >= 1:
        a -= k
    else:
        k -= a
        a = 0
        b -= k
        if b < 0:
            b = 0
print("{} {}".format(a, b))

Submission status: Accepted

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

if A >= K:
    A = A - K
    print(A, end=" ")
    print(B)
    exit(0)

if K > A:
    K = K - A
    A = 0
    if K >= B:
        B = 0
        print(A, end=" ")
        print(B)
        exit(0)
    if B > K:
        B = B - K
        print(A, end=" ")
        print(B)
        exit(0)

Submission status: Accepted

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

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

Submission status: Accepted

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

d = min(A, K)
A -= d
K -= d

d = min(B, K)
B -= d

print(A, B)

Submission status: Accepted

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

if a <= k:
  if b -(k - a) <=0:
    print('0 0')
  else:
    s = 0
    t = b - (k - a)
    print('{} {}'.format(s, t))
else:
  s = a - k
  t = b
  print('{} {}'.format(s, t))

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

def eating(A,B,K):
  if A+B <= K:
    return 0, 0
  elif A > K:
    return A-K, B
  elif A <= K:
    return 0, B-(K-A)

out1, out2 = eating(A,B,K)
print(out1,out2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
ans1 = max(0, a - k)
k = k - (a - ans1)
ans2 = max(0, b - k)
print(ans1, ans2)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
a,b,k=[int(x) for x in stdin.readline().rstrip().split()]
if b+a-k<0:
    print(0,0)
elif a-k<0:
    print(0,b+a-k)
else:
    print(a-k,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
m = a-k
if(0<=m):
  print(m,b)
else:
  l = 0-m
  n = b-l
  if(0<=n):
    print(0,n)
  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('{} {}'.format(0,b+a-k))
else:
    print('0 0')

Submission status: Accepted

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

if A >= K:
    _A = A - K
    _B = B
elif K >= A+1 and A+B >= K:
    _A = 0
    _B = A + B - K
else:
    _A = 0
    _B = 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",a+b-k)
else:
  print("0","0")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
stdin = input().split()
a = int(stdin[0]) # 高橋君のクッキー
b = int(stdin[1]) # 青木君のクッキー
k = int(stdin[2]) # 繰り返し回数

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

Submission status: Accepted

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

ma = min(a, c)
a = a-ma
c = c-ma
ma = min(c, b)
b = b - ma
print(str(a)+" "+str(b))

Submission status: Accepted

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

Submission status: Accepted

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