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 __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd
# fractions.gcd() を用いること
# math.log2()はatcoderでは対応していない．留意せよ．

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
'''
https://atcoder.jp/contests/abc149/tasks/abc149_b
'''
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# import math
# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np


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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict

def load(vtype=int):
    return vtype(input().strip())

def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]

def exit():
    import sys
    sys.exit(0)

a, b, k = load_list()

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

if K == 0:
    print(A, B)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,k=list(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:
import sys

A, B, K = map(int, input().split())
if A >= K:
	A -= K
	print(A, B)
	sys.exit()

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

Submission status: Accepted

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

ans_list = []

if A >= K:
    ans_list.append(str(A - K))
    ans_list.append(str(B))
else:
    ans_list.append(str(0))
    if (K - A) >= B:
        ans_list.append(str(0))
    else:
        ans_list.append(str(A + B - K))
print(" ".join(ans_list))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def listint():
    a = input().split()
    for i in range(len(a)):
        a[i] = int(a[i])
    return a
a,b,k = listint()
if k < b+a:
    if k < a:
        print(a-k,b)
    else:
        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 {}".format(b - (k - a)))
else:
    print("{} {}".format(a - k, b))

Submission status: Accepted

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

if A > K:
    ans = [max(0, A-K), B]
else:
    ans = [0, max(B-(K-A), 0)]
    
print(' '.join(map(str, 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())
aa = 0 if k > a else a - k
bb = b if k <= a else b - k + a
if bb < 0:
    bb = 0
print(aa, bb)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a,b,k = map(int,input().split())
print(" ".join(map(str,[max(0,a-k),max(0,b-max(0,k-a))])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(takahashi, aoki)

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

Submission status: Accepted

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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(a, b)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
taka, aoki, times= map(int,input().split())
if taka + aoki > times:
    if taka < times:
        print(0,aoki - (times - taka))
    elif taka > times:
        print(taka - times, aoki)
    else:
        print(0,aoki)
else:
    print(0,0)

Submission status: Accepted

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

Submission status: Accepted

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

else:
    A -= K
print(A, B)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ABC120_D():
    class UnionFind():
        def __init__(self, n):
            self.parent = [-1 for _ in range(n)]
            # 正==子: 根の頂点番号 / 負==根: 連結頂点数

        def find(self, x):
            # 要素xが属するグループの根を返す
            if self.parent[x] < 0:
                return x
            else:
                self.parent[x] = self.find(self.parent[x])
                return self.parent[x]

        def unite(self, x, y):
            # 要素xが属するグループと要素yが属するグループとを併合する
            x, y = self.find(x), self.find(y)
            if x == y:
                return False
            else:
                if self.size(x) < self.size(y):
                    x, y = y, x
                self.parent[x] += self.parent[y]
                self.parent[y] = x

        def same(self, x, y):
            # 要素x, yが同じグループに属するかどうかを返す
            return self.find(x) == self.find(y)

        def size(self, x):
            # 要素xが属するグループのサイズ（要素数）を返す
            x = self.find(x)
            return -self.parent[x]

        def is_root(self, x):
            # 要素の根をリストで返す
            return self.parent[x] < 0

        def roots(self):
            # すべての根の要素をリストで返す
            return [i for i, x in enumerate(self.parent) if x < 0]

        def members(self, x):
            # 要素xが属するグループに属する要素をリストで返す
            root = self.find(x)
            return [i for i in range(self.n) if self.find(i) == root]

        def group_count(self):
            # グループの数を返す
            return len(self.roots())

        def all_group_members(self):
            # {ルート要素: [そのグループに含まれる要素のリスト], ...}の辞書を返す
            return {r: self.members(r) for r in self.roots()}
    N, M = LI()
    P = [[]for _ in range(M)]
    for i in range(M):
        P[i] = LI()
    uf = UnionFind(N)
    ans = [N*(N-1)//2]*M
    for i,[a,b] in enumerate(P[M-1:0:-1]):
        #print(i,a,b)
        a -= 1; b -= 1
        if uf.same(a,b):
            ans[i+1] = ans[i]
        else:
            cur = uf.size(a)*uf.size(b)
            ans[i+1] = ans[i]-cur
            uf.unite(a,b)
    for v in ans[::-1]:
        print(v)
    return

def JOI8_1():
    N = I()
    C = [I()for _ in range(N)]
    prev = C[0]
    BW = [[1,prev]]
    for i in range(1,N):
        #print(BW)
        if BW[-1][1]==C[i]:
            BW[-1][0] += 1
        else:
            if i%2==0:
                BW.append([1,C[i]])
            else:
                if len(BW) > 1:
                    BW[-2][0] += (BW[-1][0] + 1)
                    del BW[-1]
                else:
                    BW[0][0] += 1
                    BW[0][1] = C[i]
    ans = 0
    #print(BW)
    for i,s in BW:
        if s==0:
            ans += i
    print(ans)
    return
"""
8
1
0
1
1
0
0
0
1
"""
def JOI13_A():
    N = I()
    A = LI()
    S = []
    cur = 1
    prev = A[0]
    for i in range(1,N):
        if prev^A[i]==1:
            cur += 1
        else:
            S.append(cur)
            cur = 1
        prev = A[i]
    if cur>0:
        S.append(cur)
    #print(S)
    ans = 0
    for i in range(len(S)-2):
        cur = S[i]+S[i+1]+S[i+2]
        if ans<cur:
            ans = cur
    if len(S)<=2:
        ans = N
    print(ans)
    return
"""
10 
1 1 0 0 1 0 1 1 1 0
"""
def square869120Contest5_B():
    def length(a,b):
        return ((a[0]-b[0])**2 + (a[1]-b[1])**2)**0.5
    def check(r):
        for i in range(M):
            for j in range(N):
                if length(X[i],A[j][0:2])<A[j][2]+r+_ep:
                    return False
            for j in range(M):
                if i==j:
                    continue
                if length(X[i],X[j])<r+r+_ep:
                    return False
        return True
    N, M = LI()
    A = [LI()for _ in range(N)]
    X = [LI()for _ in range(M)]
    minA = inf
    for i,j,a in A:
        if minA>a:
            minA = a
    l = 0; r = 200
    while(r-l>_ep):
        now = (l+r)/2
        if check(now):
            l = now
        else:
            r = now
    ans = min(l,minA)
    print(ans)
    return

def ABC144_D():
    a, b, x = LI()
    half = a*a*b/2
    if x>=half:
        y = (half*2-x)/(a*a/2)
        deg = math.atan2(a,y)
        #print(y,a,deg)
        ans = 90-deg*180/math.pi
    else:
        y = x/(a*b/2)
        deg = math.atan2(b,y)
        ans = deg*180/math.pi
    print(ans)
    return

def square869120Contest3_B():
    def check_del(S):
        sco = 0
        for h in range(H):
            for w in range(W-K+1):
                s = S[h][w]
                if s==0:
                    continue
                if K==3 and s==S[h][w+1] and s==S[h][w+2]:
                    d = 3
                    for k in range(W-K+1-w):
                        if S[h][w]!=S[h][w+2+k]:
                            break
                        d += 1
                    t = S[h][w]
                    sco += cal_score(t,d)
                    del_stone(S,h,w,d)
                elif K==2 and s==S[h][w+1]:
                    d = 2
                    for k in range(W-K-w):
                        if S[h][w]!=S[h][w+2+k]:
                            break
                        d += 1
                    t = S[h][w]
                    sco += cal_score(t,d)
                    del_stone(S,h,w,d)
        return sco,S
    def del_stone(S,y,x,k):
        for i in range(k):
            S[y][x+i] = 0
        return S
    def cal_score(t,c):
        return (2**now)*(t*c)
    def move_stone(S):
        rep = deepcopy(S)
        for w in range(W):
            blank = -1
            que = deque()
            for h in range(H)[::-1]:
                if rep[h][w]==0:
                    if blank==-1:
                        blank = h
                else:
                    if blank>=0:
                        que.append(rep[h][w])
                        rep[h][w] = 0
            if blank==-1:
                continue
            for h,i in enumerate(que):
                rep[blank-h][w] = i
        return rep
    H, W, K = LI()
    A = [SI()for _ in range(H)]
    C = [[]for _ in range(H)]
    for h in range(H):
        for w in range(W):
            C[h].append(int(A[h][w]))
    if K>=4:
        print(0)
        return
    ans = 0
    if K==1:
        for c in C:
            ans += sum(c)
        print(ans)
        return
    for h in range(H):
        for w in range(W):
            nowC = deepcopy(C)
            nowC[h][w] = 0
            #print(nowC)
            cur = 0
            now = 0
            while(True):
                nowC = move_stone(nowC)
                #print(nowC)
                rep,nowC = check_del(nowC)
                #print(nowC)
                #print()
                if rep==0:
                    break
                cur += rep
                now += 1
            #print(h,w,cur)
            if ans<cur:
                ans = cur
    print(ans)
    return

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

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
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,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    ABC149_B()
"""

"""

Submission status: Accepted

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


main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Takahashi = 0
Aoki = 0

Takahashi = a - k

if Takahashi <= 0:
    Aoki = b + Takahashi
    Takahashi = 0
    if Aoki <= 0:
        Aoki = 0
else:
    Aoki = b

print(Takahashi , Aoki)

Submission status: Accepted

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

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

ans(a,b,k)

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
ta,ao,N= map(int,input().split())
#li = [int(x) for x in input().split()]
N=N-ta
if N>0:
  ta=0
  N=N-ao
  if N>0:
    print("0 0")
    sys.exit()
  else:
    ao=abs(N)
else:
  ta=abs(N)

    
print(str(ta)+" "+str(ao))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Mar  4 00:20:28 2020

@author: Kanaru Sato
"""

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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