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:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
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 GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

ans=0

a,b,k=LI()
#for i in range(n):

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

Submission status: Accepted

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


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

Submission status: Accepted

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


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

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
A,B,K = map(int,input().split())

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

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

Submission status: Accepted

Solution code:
# ABC149b


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, k = map(int, input().split())
if 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 = 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:
def main():
    A, B, K= [int(x) for x in input().split()]
    A -= K
    left = A
    if left < 0:
        A = 0
    else:
        print(A, B)
        return

    B += left
    if B < 0:
        B = 0

    print(A, B)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import bisect
import collections
import itertools
def gcd(a,b):return math.gcd #最大公約数
def lcm(a,b):return (a*b) // math.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def imn(): return map(int, input().split()) #整数map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def 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)
    return divisors

A,B,K = imn()

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


print(str(A) + ' ' + str(B))

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  a,b,k=LI()

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

main()
# print(main())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if a >= k:
    print("{} {}".format(a-k, b))
elif a+b >= k:
    print("{} {}".format(0, 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:
def examA():
    S, T = LSI()
    ans = T+S
    print(ans)
    return

def examB():
    A, B, K = LI()
    if A>K:
        A -=K
        print(A,B)
        return
    if A+B>K:
        B -=(K-A)
        A = 0
        print(A,B)
        return
    A = 0; B = 0
    print(A,B)
    return

def examC():
    return

def examD():
    return

def examE():
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,inf
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()

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:
def solve(a, b, k):
    if a >= k:
        res_a = a - k
        res_b = b
    elif a + b >= k:
        res_a = 0
        res_b = a + b - k
    else:
        res_a = 0
        res_b = 0
    return "{} {}".format(res_a, res_b)


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


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


if __name__ == "__main__":
    test()
    main()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(a, b, k):
    d1 = min(a, k)
    a -= d1
    k -= d1
    d2 = min(b, k)
    b -= d2
    k -= d2
    return a, b


def main():
    a, b, k = (int(z) for z in input().split())
    res = solve(a, b, k)
    print(*res)


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline

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

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

Submission status: Accepted

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

K_A = A - K

if K_A < 0:
    print(0, max(0, B + K_A))
else:
    print(K_A, B)

Submission status: Accepted

Solution code:
A, B, K = [int(x) for x in input().split()]
print(max(A-K, 0), end=' ')
print(max(B-(K-A), 0) if A<K else B)

Submission status: Accepted

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

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

A, B, K = MAP()

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

Submission status: Accepted

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

if k <= a:
    ans = str(a-k) + ' ' + str(b)
else:
    ans = str(0) + ' ' + str(max(b-(k-a), 0))

print(ans)

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:
abk=list(map(int,input().split()))

if abk[2]<=abk[0]:
    print(abk[0]-abk[2],abk[1])
elif abk[2]<=abk[0]+abk[1]:
    print(0,abk[0]+abk[1]-abk[2])
else:
    print(0,0)

Submission status: Accepted

Solution code:
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

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

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

if K<=A:
    A-=K
    K=0
else:
    K-=A
    A=0
    
if K!= 0:
    if K<=B:
        B-=K
        K=0
    else:
        K-=B
        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:


# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

#n = int(input())
#n, op = [i for i in readline().split()]


#s,t = [i for i in readline().split()]

#print(t+s)

a,b,k = [int(i) for i in readline().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())

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

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

A, B, K = IL()

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import numpy as np


# noinspection PyShadowingBuiltinsInspection

def main():
    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)
    return


if __name__ == "__main__":
    main()

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

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

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

a,b,k = inpl()
c = d = 0
if a <= k:
    c = 0
    tmp = k-a
    d = max(b-tmp,0)
else:
    c = a-k
    d = b
print(c,d)

Submission status: Accepted

Solution code:
def main():

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

    if K < A:
        return A-K, B
    else:
        return 0, max(0, B-(K-A))
if __name__ == '__main__':
    ans = main()
    print(" ".join(map(str, ans)))

Submission status: Accepted

Solution code:
import sys
from math import factorial
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

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

    else:
        print("0 0")

Submission status: Accepted

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

eat = min(a, k)
a -= eat
k -= eat
eat = min(b, k)
b -= eat
k -= eat
print(a, b)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#import sys
#input = sys.stdin.readline
def main():
    A, B, K = map( int, input().split())
    if A >= K:
        print(A-K, B)
        return
    K -= A
    if B >= K:
        print(0, B-K)
        return
    print(0, 0)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
#input = sys.stdin.readline
import math

import itertools

#import bisect

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]
def main():
    a,b,k=map(int,input().split())
    taka=a-k
    if taka<0:
        taka=0
    noko=k-a
    if noko<0:
        noko=0
    ao=b-noko
    if ao<0:
        ao=0
    print(taka,ao)











if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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 main():
    # S, T = get_inputs()
    # print(T + S)
    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())
tmp = min(a, k)
a -= tmp
k -= tmp
if a == 0:
    tmp2 = min(b, k)
    b -= tmp2
    k -= tmp2
else:
    pass
print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

ri = lambda: int(input())
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string

A ,B, K = map(int, input().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 K > A:
    print(0, end=" ")
    K -= A
    print(max(0, B - K))
else:
    print(A - K, end=" ")
    print(B)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

Solution code:
import sys

a, b, k = map(int, sys.stdin.readline().split())

def main():
    if a >= k:
        return a - k, b
    elif a + b >= k:
        return 0, a + b - k
    else:
        return 0, 0

if __name__ == '__main__':
    ans = main()
    print(*ans, sep=' ')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
def input():
    return sys.stdin.readline()[:-1]
from itertools import permutations, combinations
from collections import defaultdict

sys.setrecursionlimit(10**7)
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:
#n = int(input())
a,b,k = map(int,input().split())
print(max(a-k,0), max(0,min(b,a + b - k)))

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())
t = max(0, A-K)
a = max(0, (A+B-K)-t)
print(t, a)

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

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

Submission status: Accepted

Solution code:
A,B,K=[int(i) for i in 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:
A, B, K = map(int, input().split())
diff = min(A, K)
A -= diff
K -= diff

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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