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:
s=list(map(int,input().split()))
ans=s[2]-s[0]
if(ans>0):
  if(s[1]>ans):
    print(0,s[1]-ans)
  else:
    print(0,0)
else:
  print(-ans,s[1])

Submission status: Accepted

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

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

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:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    a,b,k = LI()
    if a < k:
        b -= k-a
        if b < 0:
            b = 0
        a = 0
    else:
        a -= k
    print(a,b)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]

    
def main():
    A, B, K = read_values()
    A2 = max(0, A - K)
    K -= A - A2
    B2 = max(0, B - K)

    print(A2, B2)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def ints():
  return [int(x) for x in input().split()]
def ii():
  return int(input())
a, b, k = ints()
da = min(a, k)

aa = a-da
db = min(b, k-da) 
bb = b-db
print(aa, bb)

Submission status: Accepted

Solution code:
A, B, K = (int(i) for i in 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())
if a >= k:
  print(a-k,b)
elif a <= k:
  if 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>=0):
    print(a-k,b)
else:
    c = b-abs(a-k)
    if c <= 0:
        c = 0
    print(0,c)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

elif k == a:
    a = 0
    print(a, b)

elif k < a:
    print(a-k, b)

Submission status: Accepted

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


# if __name__ == '__main__':
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
print(max(a - k, 0), min(max(b + (a - k), 0), 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 {0}".format(a + b - k))
else:
    print("{0} {1}".format(a - k, b))

Submission status: Accepted

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

t = K-A
A = A-K
if A>0:
    print("%d %d" % (A, B))
    exit(0)

A = 0
B = B-t
if B<0:
    B = 0

print("%d %d" % (A, B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

taka, aoki, K = list(map(int, input().split()))


if taka <= K:
    if aoki - K + taka < 0:
        print(0, 0)
    else:
        print(0, aoki - (K - taka))
else:
    print(taka - K, aoki)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

else:
    a -= k


print(a, b)

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations, accumulate
import sys
import bisect
import string
import math
import time
from fractions import gcd
#import random


def I(): return int(input())


def MI(): return map(int, input().split())


def LI(): return [int(i) for i in input().split()]


def LI_(): return [int(i)-1 for i in input().split()]


def StoI(): return [ord(i)-97 for i in input()]


def ItoS(nn): return chr(nn+97)


def input(): return sys.stdin.readline().rstrip()


def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)


YN = ['No', 'Yes']
MOD = 10**9+7
inf = float('inf')
IINF = 10**10
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)
nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']

show_flg = False
# show_flg = True


def main():
    A, B, K = MI()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

if int(a-k) <0:
  ans1 = 0
  
  if int(b+(a-k)) < 0:
    ans2 = 0
  else:
    ans2 = int(b+(a-k))
  
else :
  ans1 = int(a-k)
  ans2 = b

  
Lists=[ans1,ans2]
print(*Lists)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(a, end=" ")
print(b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = [int(x) for x in input().split()]
cnt = a + b - k

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

Submission status: Accepted

Solution code:
n = input()    
m = n.split()
p = [int(i) for i in m]
if p[0] > p[2]:
    print(str(p[0]-p[2])+" "+str(p[1]))
else:
    print("0 "+str(max(0,p[1]+p[0]-p[2])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
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:
import sys
#import numpy as np
stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

A, B, K = rl()

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

Submission status: Accepted

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

Submission status: Accepted

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

# t = -(-K // 2)
# a = K // 2

# result1 = A-t
# result2 = B-a

# if result1 < 0 :
#   result1 = 0
# if result2 < 0 :
#   result2 = 0

# print(result1, result2)

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

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

print(A,B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(A: int, B: int, K: int):

    if A <= K:
        a = 0
        b = max(B-(K-A), 0)
    else:
        a = A-K
        b = B
    print(a, b, sep=" ")
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

print(A, max(0, B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

A = max(0,A)
B = max(0,B)

print(A,B)

Submission status: Accepted

Solution code:
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect
import heapq


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def main():
    A, B, K = get_inputs(int)
    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())

a2 = a-k
b2 = b
if a2 < 0:
    b2 = b+a2

if a2 < 1:
    a2 = 0
if b2 < 1:
    b2 = 0
print(a2,b2)

Submission status: Accepted

Solution code:
# ABC149 B
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a,b,k=map(int, input().split())

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

if k>0:
    if b>=k:
        b-=k
    elif b<k:
        b=0

print(a,b)

Submission status: Accepted

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

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

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


    print(str(a) + ' ' + str(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 K <= A + B:
  print(*[0, B-(K-A)])
else:
  print(*[0, 0])

Submission status: Accepted

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

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(str(a)+" "+str(b))

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

A_ans = max(0, A - K)
K = max(0, K - A)
B_ans = max(0, B - K)

print(A_ans, B_ans)

Submission status: Accepted

Solution code:
A, B, K = [int(i) for i in input().split()]
if K > A:
    K -= A
    A = 0
    if K > B:
        print(0, 0)
    else:
        print(A, B-K)
else:
    print(A-K, B)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    A, B, K = map(int, input().split())

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

print(max(A - K, 0), end = " ")

K = max(K - A, 0)

print(max(B - K, 0))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
A, B, K = map(int, input().split())
if K >= A:
  B = B-(K-A)
  A = 0
else:
  A = A-K
if B < 0:
  B = 0
print("{} {}".format(A,B))

Submission status: Accepted

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

N = A+B-K

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

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,read().split())

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

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

print(A,B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = (int(i) for i in input().split())
x=a-k
if x < 0:
    y=b+x
    if y < 0:
        print ("0 0")
        exit (0)
    print("0", y)
    exit (0)
print (x, b)

Submission status: Accepted

Solution code:
# 高橋君A枚
# 青木君B枚
# 高橋君の行動回数K回
A, B, K = map(int, input().split())

# 高橋君がK枚以下なら全部食べる
if A <= K:
    K -= A
    A = 0
else:
    A -= K
    K = 0
    print('{} {}'.format(A, B))
    exit()
    
#print(A,B,K)
    
if B >= K:
    B -= K
    K = 0
    print('{} {}'.format(A, B))
else:
    print("0 0")

Submission status: Accepted

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

tmp_ans_Takahashi = A - K

if tmp_ans_Takahashi >= 0:
    print(str(tmp_ans_Takahashi) + " " + str(B))

elif tmp_ans_Takahashi < 0:
    tmp_ans_Aoki = B - (K - A)
    if tmp_ans_Aoki >=0:
        print("0 " + str(tmp_ans_Aoki))
    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(0,B-(K-A)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=map(int,input().split())
takahashi=0
if a>= k:
    #a=a-k
    takahashi=a-k
else:
    dif=k-a
    takahashi=0    
    #print(dif)
    b=b-dif
    if b<0:
        b=0
print("{0} {1}".format(takahashi,b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b,K=map(int,input().split())
if a<K and b>K-a:
    print(0,b-(K-a))
elif a<K and b<=K-a:
    print(0,0)
elif a>=K:
    print(a-K,b)

Submission status: Accepted

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

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

print (a,max(b,0))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def multi_int_input():
    return map(int, input().split())
  
multi_input = multi_int_input()
takahashi, aoki, K = multi_input
if K > takahashi:
  sum_result = K - takahashi - aoki
  if sum_result > 0:
    print("0 0")
  else:
    print("0 {}".format(-sum_result))
else:
  sum_result = takahashi - K
  print("{0} {1}".format(sum_result, aoki))

Submission status: Accepted

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

if K >= A:
        K -= A
        A = 0
        flag = 1

if flag == 1 and K >= B:
        K -= B
        B = 0

if A == 0 and B == 0:
                print('0 0')
                exit(0)
        
if A > 0:
        print(A-K, B)
        exit(0)
        
if B > 0:
        print(A, B-K)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k = map(int, input().split())		# 5 7 2

c = max(0, a-k)
d = max(0, b-max(0, k-a))

print(c,d)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans_takahasi = A
ans_aoki = B
if A>K:
    ans_takahasi -= K
else:
    ans_takahasi = 0
    ans_aoki -= K-A
if ans_takahasi < 0 or ans_aoki < 0:
    ans_takahasi = 0
    ans_aoki = 0
    
print(ans_takahasi,ans_aoki)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
line = input().split(" ")

a = int(line[0])
b = int(line[1])
k = int(line[2])

takahashi = 0
aoki = 0

if k <= a:
  takahashi = a - k
  aoki = b
elif k <= a + b:
  aoki = a + b - k

print(str(takahashi) + " " + str(aoki))

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(A, B)

Submission status: Accepted

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

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

print(0, A+B-K)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,K = map(int,input().split(" "))
C=K-A
if C >= 0:
    E = 0
elif C < 0:
    E = C * -1  
else:
    E = C
if E > 0:
    F = B
else:
    D=B-C
    if D >= 0:
        F = D
    else:
        F = 0

print('{} {}'.format(E , F))

Submission status: Accepted

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

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

a = min(A, K)
b = min(B, K - a)

print(A - a, B - b)

Submission status: Accepted

Solution code:
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think(2, 3, 3), (0, 2))

    def test_2(self):
        self.assertEqual(think(500000000000, 500000000000, 1000000000000), (0, 0))

    def test_3(self):
        self.assertEqual(think(1, 1, 10), (0, 0))


def solve():
    a, b, k = read()
    result = think(a, b, k)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, k):
    if a >= k:
        return a - k, b
    rem = k - a
    if b >= rem:
        return 0, b - rem
    else:
        return 0, 0


def write(result):
    print('{0:d} {1:d}'.format(result[0], result[1]))


if __name__ == '__main__':
    # unittest.main()
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [int(i) for i in input().split()]
ans1 = x[0]
ans2 = x[1]
if ans1 >= x[2]:
    ans1 -= x[2]
else:
    x[2] -= ans1
    ans1 = 0
    ans2 = max(0,ans2 - x[2])
print(ans1,ans2)

Submission status: Accepted

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

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