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 = tuple(map(int, input().split()))
new_A = max(0, A - K)
K = max(0, K - A)
new_B = max(0, B - K)
print(new_A, new_B)

Submission status: Accepted

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


def func(variables_list):
    if variables_list[0] + variables_list[1] > variables_list[2]:
        if variables_list[0] > variables_list[2]:
            return (variables_list[0] - variables_list[2], variables_list[1])
        else:
            return (0, variables_list[1] - (variables_list[2] -variables_list[0]))
        return variables_list[0] + variables_list[1] - variables_list[2]
    else:
        return (0, 0)


print(str(func(variables_list)[0]) + " " + str(func(variables_list)[1]))

Submission status: Accepted

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

def eat_cookie(A,B,K):
    if A >= K:
        return A-K,B
    else:
        if B-K+A > 0:
            return 0,B-K+A
        else:
            return 0,0


resultA,resultB = eat_cookie(A,B,K)
print(resultA,resultB)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Q = K - A
q = A - K
if Q < 0 :
  print (q,B)
if Q >= 0 :
  W = B - Q
  if W >= 0:
    print ("0",W)
  if W< 0 :
    print("0 0")

Submission status: Accepted

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

if i[0]<i[2]:
  
  i[1]=i[1]-(i[2]-i[0])
  i[0]=0
  if i[1]<0:
    i[1]=0
else:
  i[0]-=i[2]

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

Submission status: Accepted

Solution code:
import math
import heapq
import sys
from collections import Counter
import datetime
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

#N,K=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
#x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
#s = [input() for i in range(3)]

x=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

A=x[0]
B=x[1]
K=x[2]

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

Submission status: Accepted

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

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

a = max(A - K, 0)
b = max(B - max(K - A, 0), 0)

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, k = (int(i) for i in input().split())
takahashi = a - k
aoki = b + takahashi if takahashi < 0 else b
print("{} {}".format(max(takahashi, 0), max(aoki, 0)))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, k = (int(s) for s in input().split())
    if a >= k:
        print(a - k, b)
        return
    else:
        a, k = 0, k - a
        if b >= k:
            print(a, b - k)
            return
        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)
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())
c = a
if k >= 1:
    if a >= k:
        a -= k
    elif a < k:
        a = 0
        k -= c
        if b >= k:
            b -= k
        elif b < k:
            b = 0

print(a, b)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jan  4 16:34:06 2020

@author: masat
"""

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

A_last = 0
B_last = 0

if K <= A:
    A_last = A-K
    B_last = B
elif K <= A+B:
    A_last = 0
    B_last = B-K+A
else:
    A_last = 0
    B_last = 0

print("{} {}".format(A_last, B_last))

Submission status: Accepted

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

if K <= A:
  print("{} {}".format(A - K, B))
elif K <= A + B:
  print("0 {}".format(B - (K - A)))
else:
  print("0 0")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc149/tasks/abc149_a

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

tcookie = 0
acookie = 0

# KがAより大きい
if A > K :
    tcookie = A - K 
    acookie = B

# KがA以下
if A <= K : 
    tcookie = 0
    # KがBより大きい
    if ( K - A ) < B:
        acookie = B - (K - A) 
    # KがB以下
    if ( K - A ) >= B:
        acookie = 0

print(str(tcookie) + " " +  str(acookie))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline().rstrip
A, B ,K = map(int, input().split())
a = K-A
if a < 0:
    print(-a, B)
elif B-a > 0:
    print(0, B-a)
else:
    print(0, 0)

Submission status: Accepted

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

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

print(ra,rb)

Submission status: Accepted

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

takahashi = max(0,t-k)
k = max(0,k-t)
aoki = max(0,a-k)
print(takahashi,aoki)

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+a-k))

Submission status: Accepted

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
a,b,k=map(int,input().split())
tmp=0
if a<=k:
    print(0)
    tmp=k-a
else:
    print(a-k)

if b<=tmp:
    print(0)
else:
    print(b-tmp)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(A, B)

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)
elif (K > A):
    print(0, max(0, B - (K - A)))

Submission status: Accepted

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

a = max(A - K, 0)
k = max(K - A, 0)
b = max(B - k, 0)
print(str(a) + ' ' + str(b))

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, B - (K-A))
else:
    print(0, 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# INPUT
input = list(map(float, input().split()))

takahashi = input[0]
aoki = input[1]
num = input[2]

a = takahashi - num
b = 0
if a < 0:
  b = aoki + a
  a = 0
  if b < 0:
    b = 0
else:
  b = aoki

print("{0} {1}".format(int(a),int(b)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
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 = [int(i) for i in 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())

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

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

    print(a, b)

Submission status: Accepted

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

if s + t <=  n:
  print('0 0')
elif s >= n:
  print(str(s-n) + ' ' + str(t))
else:
  print('0 ' + str(s+t-n))

Submission status: Accepted

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

if a+b <= k:
    A = 0
    B = 0
elif a < k:
    A = 0
    B = b + a - k
elif k <= a:
    A = a - k
    B = b
print(str(A) + " " + str(B))

Submission status: Accepted

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

#Takahashi eats a, k times while Aoki doesn't eat b unless
#all of a's are gone.

if a+b <= k: #all cookies will be gone
    print(0,0)
else:
    if a <= k:
        print(0, b-(k-a))
    else:
        print(a-k, b)

Submission status: Accepted

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

"""
ここで、まずはAとKの比較を行って、Aの方が大きければその場で試行は終了
し、Kの方が大きければ、A=0となり、その差|A-K|は残りのBから引くものになる。
"""
if A >= K:
  A -= K
  print(A, end=" ")
  print(B)
else:
  K -= A
  A = 0
  B -= K
  if B < 0:
    B = 0
  print(A, end=" ")
  print(B)

Submission status: Accepted

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

Submission status: Accepted

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

a = a -k

if a < 0:
    b = a + b
    a = 0
    if b < 0:
        b = 0

print(a, b)

Submission status: Accepted

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

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

elif k == a:
  c = 0

elif k > a:
  c = 0
  d = b - (k - a)

else:
  c = a - k
  
print(c,d)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
c=list(map(int, input().split()))
if c[0]<c[2]:
  if c[1]<c[2]-c[0]:
    print(0,0)
  else:
    print(0,c[1]-(c[2]-c[0]))
else:
  print(c[0]-c[2],c[1])

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

Submission status: Accepted

Solution code:
# coding: utf-8


def main():
    
    takahashi, aoki, action_count = map(int, input().split(' '))

    if action_count <= takahashi:
        takahashi = (takahashi - action_count)
    elif takahashi < action_count <= (takahashi + aoki):
        aoki = (takahashi + aoki - action_count)
        takahashi = 0
    elif (takahashi + aoki) < action_count:
        takahashi = 0
        aoki = 0
    
    print(takahashi, aoki)

    return 0
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#coding:utf-8
 
 
def main():
    list1  = list(map(int, input().split(' '))) 
    a, b, k = list1
  
    if a > k:
        a = a - k
      
    elif a + b >= k:
        b = b - (k - a)
        a = 0
        
    else:
        a = 0
        b = 0
        
    print(a, b)
  
    return 0
 
 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = min(a,k)
a -= x
k -= x
y = min(b,k)
b -= y
print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
'''input
3 5
1 2 1
2 3 0
'''
# connected components
from sys import stdin, setrecursionlimit


# main starts
a, b, k = list(map(int, stdin.readline().split()))

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = 0
b = 0

a = max(a, A - K)
K = max(0, K - A)
b = max(b, B - K)

print(str(a) + " " + str(b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, k = list(map(int, readline().split()))
    print(a - min(a, k), b - min(k - min(a, k), b))


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

if c[0]>=c[2]:
  c[0]-=c[2]
else :
  c[2]-=c[0]
  c[1]-=c[2]
  c[0]=0
  if c[1]<0:
    c[1]=0
print(c[0],c[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A,B,K = map(int, input().split())
 
while(K > 0):
  if A >= K:
    A -= K
    K = 0
    break
  else:
    K -= A
    A = 0
    if B >= K:
      B -= K
      K = 0
      break
    else:
      K -= B
      B = 0
      break
print(' '.join(map(str, [A,B])))

Submission status: Accepted

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

# 愚直に for で回すとTLEになりそう
# for _ in range(K):
#    if A >= 1:
#        A = A - 1
#    elif B >= 1:
#        B = B - 1

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

def main():

    # sys.stdin = open('input149b.txt')

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

    ra = max(0, a - k)
    ka = max(0, k - a) 
    rb = b
    if ka > 0:
        rb = max(0, rb - ka)

    print(str(ra) + ' ' + str(rb))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import string

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:
takahashi,aoki,count = map(int,input().split())
if count >= takahashi:
	aoki = aoki - count + takahashi
	takahashi = 0
else:
	takahashi = takahashi - count
if aoki < 0:
	aoki = 0
print(takahashi,aoki)

Submission status: Accepted

Solution code:
ta,ao,k = map(int,input().split())

if ta < k: #回数が高橋くんのクッキーより多い
    k = k - ta
    ta = 0

else: #回数が高橋くんのクッキーより少ない
    ta = ta - k
    k = 0

if ao < k:
    ao = 0
    k = k - ao

else:
    ao = ao - k
    k = 0

print(ta,ao)

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

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

Submission status: Accepted

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

ans_a = max((a - k), 0)
if ans_a == 0:
    ans_b = max((a + b) - k, 0)
else:
    ans_b = b
print(str(ans_a) + " " + str(ans_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, 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, B - K + A)
else:
    print(0, 0)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
  a,b,k = (int(i) for i in input().split())
  caneat = min(k,a+b)
  ans = [0,b]
  if a <= caneat:
    ans[0] = 0
    ans[1] = b-(caneat-a)
  else:
    ans[0] = a-caneat
  print(*ans)
solve()

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
if A >= K:
    A -= K
    print(A, B, sep=" ")
    exit()

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

Submission status: Accepted

Solution code:
# Greedy Takahashi

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

# solve
resA = max(0, A - K)
resB = max(0, B - max(0, K - A))

# output
print(resA, resB)

Submission status: Accepted

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

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

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

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

if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
#abc149b

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

Submission status: Accepted

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

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:
  print("0 " + str(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())
print(max(a-k,0), max(0,b+min(0,a-k)))

Submission status: Accepted

Solution code:
from sys import stdin
a,b,k = [int(x) for x in stdin.readline().rstrip().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,c = map(int,input().split())

if(a<=c):
    p = 0
    if(b<=c-a):
        q = 0
    else:
        q = b -(c-a)
else:
    p = a-c
    q = int(b)

print(str(p) + " " + str(q))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
list = input().split(' ')
(A,B,K)=(int(list[0]),int(list[1]),int(list[2]))
if A >= K:
    A = A - K
elif 1 <= A < K:
    B = B - K + A
    if B < 0:
        B = 0
    A = 0
else:
    A = 0
    B = B - K
    if B < 0:
        B = 0
print(A,B)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = [None] * 2

ans[0] = str(max(A - K, 0))
ans[1] = str(max(B - max(K - A, 0), 0))

print(" ".join(ans))

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
def split_A_K_B(A, B, K):
    if K >= A:
        K -= A
        A = 0
    else:
        A -= K
        return A, B
    if K >= B:
        K -= B
        B = 0
    else:
        B -= K
    return A, B
A, B = split_A_K_B(A, B, K)
print("{} {}".format(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(A, B)

Submission status: Accepted

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

if a+b <= k:
  a=0
  b=0
elif a <= k < a+b:
  b=a+b-k
  a=0
else:
  a=a-k
print(' '.join([str(a), str(b)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
import math
import fractions

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def bitlist(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res
'''
#a = list(map(int, input().split()))
'''
n,m,t = list(map(int, input().split()))

nb = [[] for i in range(n+1)]
for i in range(n):
    a,b = list(map(int, input().split()))
    nb[a].append([b,i])
    nb[b].append([a,i])
print(nb)

order = [-1 for i in range(n+1)]
order[1] = 0
noworder = 1
nbnow = [len(nb[i])-1 for i in range(n+1)]

print(nbnow)
queue = [[1,999999]]
deque = 0

while(len(queue)>deque and len(queue)<20):
    nownum = queue[deque][0]
    nowpos = queue[deque][1]
    deque+=1
    print("a",nownum,nowpos)
    while(True):
        if(nb[nownum][nbnow[nownum]][1] > nowpos):
            nbnow[nownum] -= 1
        if(nbnow[nownum]<=-1):
            break
    if(nbnow[nownum]<=-1):
        continue
    
    nextnum = nb[nownum][nbnow[nownum]][0]
    nextpos = nb[nownum][nbnow[nownum]][1]
    print(nextnum,nextpos)
    if(order[nextnum]==-1):
        queue.append([nextnum,nextpos])
        order[nextnum]=noworder
        noworder+=1


print(order)
'''

#a = list(map(str, input().split()))

a,b,k = list(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 = list(map(int,input().split()))
if(a[0]-a[2]<0):
    b = 0
    d = a[2]-a[0]
    if(a[1]-d>=0):
        c = a[1]-d
    else:
        c = 0
else:
    b = a[0]-a[2]
    c = a[1]   
print(b,c)

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

Submission status: Accepted

Solution code:
n = list(map(int,input().split()))
ans1 = n[0] - n[2]
ans2 = (n[0] + n[1]) -  n[2]

if ans1 <= 0:
    ans1 = 0

if ans1 > 0:
    ans2 = n[1]
elif ans2 <= 0:
    ans2 = 0

print(ans1,ans2)

Submission status: Accepted

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

Submission status: Accepted

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

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