Problem:


Score : 200 points

Problem Statement

Takahashi has A cookies, and Aoki has B cookies.
Takahashi will do the following action K times:

If Takahashi has one or more cookies, eat one of his cookies.

Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.

If they both have no cookies, do nothing.

In the end, how many cookies will Takahashi and Aoki have, respectively?

Constraints

0 \leq A \leq 10^{12}

0 \leq B \leq 10^{12}

0 \leq K \leq 10^{12}

All values in input are integers.

Input

Input is given from Standard Input in the following format:

A B K

Output

Print the numbers of Takahashi's and Aoki's cookies after K actions.

Sample Input 1

2 3 3

Sample Output 1

0 2

Takahashi will do the following:

He has two cookies, so he eats one of them.

Now he has one cookie left, and he eats it.

Now he has no cookies left, but Aoki has three, so Takahashi eats one of them.

Thus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.

Sample Input 2

500000000000 500000000000 1000000000000

Sample Output 2

0 0

Watch out for overflows.



Sample input:
2 3 3


Sample output:
0 2

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(0,0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a,b,k=map(int,input().split())
if a>=k:
    print(a-k,b)
else:
    print(0,max(b-k+a,0))

Submission status: Accepted

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

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

Submission status: Accepted

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

if A-K <= 0:
    K2 = K-A
    A_ans = 0
    if B-K2 <= 0:
        B_ans = 0
    else:
        B_ans = B-K2
else:
    A_ans = A-K
    B_ans = B
    
print(A_ans, B_ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = map(int, input().split())
if A >= K:
  ans_a = A - K
  ans_b = B
elif A < K and A + B >= K:
  K = K - A
  ans_a = 0
  ans_b = B - K
else:
  ans_a = 0
  ans_b = 0
print(str(ans_a) + " " + str(ans_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:
    k -= a
    a = 0
else:
    a -= k
    k = 0

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


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


def solve():
    A, B, K = map(int, input().split())
    if K > A:
        B -= K - A
    A -= K
    print(max(0, A), max(0, B))


def main():
    solve()


if __name__ == '__main__':
    main()

Submission status: Accepted

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

a,b = max(a-k,0), max(min(b-(k-a),b),0)

print(a,b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A, B, K= map(int, next(sys.stdin.buffer).split())
if K > A:
  a = 0
  b = max(0, B - (K - A))
else:
  a = A - K
  b = B

print(a, b)

Submission status: Accepted

Solution code:

def cookie(a, b, n):
    
    if a >= n:
        return [a-n, b]
    elif n < a+b:
        
        return[0, b-(n-a)]
    else:
        return [0, 0]

if __name__ == "__main__":
    a, b, n = map(int, input().split())
    j = cookie(a, b, n)
    print(j[0], j[1])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if K <= A:
    print(A - K)
    print(B)

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

else:
    print(0)
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

t = a - min(a,k)
k -= min(a,k)
q = b - min(k,b)

print(t,q)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

else:
  print('0' +' ' +  '0')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    A, B, K = map(int, readline().split())

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

    print(A, B)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(a2,b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal
from argparse import ArgumentParser

args=ArgumentParser()
args.add_argument('-loc', '--local', type=bool,default=False)
LOCAL=args.parse_args().local

def input(): 
    x=sys.stdin.readline(); 
    if x[-1]=="\n": 
        return x.rstrip() 
    return x
    
def printe(*x):_=print("## ",*x,file=sys.stderr) if LOCAL else 0
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    A,B,K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

else:
    A -= K

if A <= 0 and B <= 0:
    print(0,0)
else:
    print(A,B)

Submission status: Accepted

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

    if a >= k:
        remain_a = a - k
        remain_b = b
    else:
        remain_a = 0
        if k - a >= b:
            remain_b = 0
        else:
            remain_b = b - (k - a)

    print(remain_a, remain_b)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

A_res = max(0, A - K)
B_res = max(0, B - K + A - A_res)

print("{} {}".format(A_res, B_res))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip.split())
def main():
    a,b,k = LI()
    x = max(a-k,0)
    y = b
    if k-a > 0:
        y = max(b-(k-a),0)
    print(x,y)
main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(A: int, B: int, K: int):
    return f'{max(A-K,0)} {max(B-max(0,K-A),0)}'


def main():

    sys.setrecursionlimit(10 ** 6)

    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
    print(f'{solve(A, B, K)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(Taka, Aoki)

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+A-K))

Submission status: Accepted

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

Submission status: Accepted

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

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


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

Submission status: Accepted

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

Submission status: Accepted

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

if A > K:
    after_A = A - K
    after_K = 0
else:
    after_A = 0
    after_K = K - A

if B > after_K:
    after_B = B - after_K
    final_K = 0
else:
    after_B = 0
    final_K = after_K - B

print(after_A, after_B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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

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

Submission status: Accepted

Solution code:
# ABC149
# B Greesy Takahashi
# takはA枚、aokiはB枚、TAKはK回
a, b, k = map(int, input().split())
if k > a:
    if k - a > b:
        print(0,0)
    else:
        print(0,b - (k - a))
else:
    print(a-k,b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x,y,k=map(int,input().split())
if(k<=x):
    x=x-k
    k=0
else:
    k-=x
    x=0
if(k<=y):
    y-=k
    k=0
else:
    k-=y
    y=0
print(x,y)

Submission status: Accepted

Solution code:
def main():
    a, b, k = map(int, input().split(" "))
    temp = min(a, k)
    a -= temp
    k -= temp
    b -= min(b, k)
    print(a, b)
main()

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
# from collections import Counter,defaultdict,deque
# from itertools import permutations, combinations
# from heapq import heappop, heappush
# # input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
# mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a, b, k = inpm()
ta = a - k
ao = b
if(ta < 0):
    ao = b + ta
    ta = 0
if(ao < 0):
    ao = 0
print(str(ta) + ' ' + str(ao))

Submission status: Accepted

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

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

Submission status: Accepted

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

print(a,b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = [int(x) for x in 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())

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

print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

a, b, k = list(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:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

a,b,k = inpm()

aa = min(a,k)
bb = max(0,(k-aa))

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

Submission status: Accepted

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

aa=a
bb=b
if a>=1:
  a-=k
  k-=aa
if b>=1 and k>0:
  b-=k
  k-=bb

if a<0:
  a=0
if b<0:
  b=0
print(a,b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def main():
    A,B,K = LI()
    A_ans = A-K if A>=K else 0
    B_ans = B-(K-A) if K>A else B
    B_ans = B_ans if B_ans>=0 else 0
    print(A_ans,B_ans)

main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = A - K

if a >= 0:
    print(a, B)
elif a < 0:
    b = B + a
    print(0, max(b,0))

Submission status: Accepted

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

a -= k
if a <= -1:
  p = abs(a)
  a = 0
  b -= p
  if b <= -1:
    b = 0
    
print(str(a) + ' ' + str(b))

Submission status: Accepted

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

if A + B == 0:
    print(0, 0)
elif 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:
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(*ans)

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

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

Submission status: Accepted

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

A1 = max(A-K,0)
K1 = max(K-A,0)

if K1 == 0:
    B1 = B
else:
    B1 = max(B-K1,0)

print(A1,B1)

Submission status: Accepted

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

if (a >= k):
    aa = a - k
    bb = b
else:
    aa = 0
    bb = max(0, b - (k - a))

print(aa, bb)

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)
"""
for k in range(K):
  if A>0 and B!=0:
    A+=-1
  elif A==0 and B>0:
    B+=-1
  elif A==0 & B==0:
    break
print(A, B)
"""

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
taka,aoki,k = map(int,input().split())
#for i in range(k):
#    if taka >= 1:
#        taka -= 1
#    elif aoki >= 1:
#        aoki -= 1
if k>=taka:
    k -= taka
    taka = 0
    if k>=aoki:
        aoki = 0
    else:
        aoki -= k
else:
    taka -= k
print(taka,aoki)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

c = k - a
d = b - c

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, K = list(map(lambda x: int(x), 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")