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:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    if K < A:
        print(A - K, B)
    elif K < A + B:
        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())
 
if A >= K:
  ans_t = A - K
  ans_a = B
elif B >= ( K - A):
  ans_t = 0
  ans_a = B - ( K - A)
else:
  ans_t = 0
  ans_a = 0
 
print( '{} {}'.format( ans_t, ans_a))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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:
  print(a-k,b)
elif a<=k<=a+b:
  print(0,b-(k-a))
else:
  print(0,0)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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,c = map(int, input().split())
 
print(max(0,a-c),max(0, b - max(0,c-a)))

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

Submission status: Accepted

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

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

print(a,b)

Submission status: Accepted

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

if A>= K:
  print(A-K, end=" ")
  print(B)
else:
  print(0, end=" ")
  print(max(B-(K-A),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())
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:
from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(str(a),str(b))

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(' '.join(map(str, ans)))

Submission status: Accepted

Solution code:
import sys
A, B, K = (int(x) for x in input().split())
if A>=K:
  A-=K
else:
  K-=A
  A=0
  if B>=K:
    B-=K
  else:
    B=0
print(A, end=" ")
print(B)

Submission status: Accepted

Solution code:
a, b, c = input().split()
x = int(a)
y = int(b)
z = int(c)
if z >= x:
    z -= x
    x = 0

else:
    x -= z
    z = 0

if z >= y:
    z -= y
    y = 0

else:
    y -= z
    z = 0

print(str(x),str(y))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

elif a+b <= k:
    a = 0
    b = 0

else:
    b = a+b-k
    a = 0
    

print(a, b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(a,b,k):
  if k <= a: return a - k, b
  elif k <= a + b: return 0, b - (k - a)
  else: return 0, 0

a,b,k = map(int,input().split())
ans_1, ans_2 = solve(a,b,k)
print(f"{ans_1} {ans_2}")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
a, b, k = list(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 k <= a:
    ans = (a-k, b)
else:
    ans = (0, max(0, a+b-k))
print(*ans, sep=' ')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC149B

import sys
input=sys.stdin.readline

def main():
    A,B,K=map(int,input().split())
    print(max(A-K,0),max(0,min(A+B-K,B)))
    
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
tc, ac, tasks = map(int, input().split())

if tasks >= (tc + ac): tc, ac = 0,0
else:
  if tc >= tasks: tc -= tasks
  else: tc,ac = 0,ac + tc - tasks


print(tc, ac)

Submission status: Accepted

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

Submission status: Accepted

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

if a[0]+a[1]<=a[2]:
    print(0,0)
elif a[0]>=a[2]:
    print(a[0]-a[2],a[1])
elif a[0]<a[2]:
    b = a[2]-a[0]
    print(0,a[1]-b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 149 B

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

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

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

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())
t=min(a,k)
s=min(b,k-t)
print(a-t,b-s)

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

Submission status: Accepted

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

d = min(A, K)
#print('d:', d)
A -= d
K -= d
d = min(B, K)
#print('d:', d)
B -= d
K -= d

print(A, B)

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

ansA = A
ansB = B
ansA -= min(A, K)
K -= A - ansA
ansB -= min(B, K)
print(ansA, ansB)

Submission status: Accepted

Solution code:
A,B,K = (int(x) for x in input().split())
print('{} {}'.format(max(0,A-K),max((0<=K<=A)*B,(A<K)*max(A+B-K,0))))

Submission status: Accepted

Solution code:
A,B,K = (int(x) for x in input().split())
if A+B<K:
    print('0 0')
elif A<K<=A+B:
    print('0 {}'.format(A+B-K))
elif 0<=K<=A:
    print('{} {}'.format(A-K,B))

Submission status: Accepted

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

if a > 0 and k > 0:
    eat = a
    if a > k:
        eat = k
    a -= eat
    k -= eat

if b > 0 and k > 0:
    eat = b
    if b > k:
        eat = k
    b -= eat
    k -= eat

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Greedy Takahashi
https://atcoder.jp/contests/abc149/tasks/abc149_b

"""
import sys


def solve(A, B, K):
    if A >= K:
        return A-K, B
    return 0, max(B - K + A, 0)


def main(args):
    A, B, K = map(int, input().split())
    ans = solve(A, B, K)
    print(*ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# abc149_b

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

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

Submission status: Accepted

Solution code:
def main():
    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])

main()

Submission status: Accepted

Solution code:
import sys

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

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

new_a = a - k if a >= k else 0
new_b = b - (k - a) if a < k else b
if new_b < 0:
    new_b = 0

print(new_a, end=" ")
print(new_b)

Submission status: Accepted

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

Submission status: Accepted

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

if(input_line[0]>=input_line[2]):
    input_line[0] -= input_line[2]
elif((input_line[0]+input_line[1])>=input_line[2]):
    input_line[1] -= (input_line[2]-input_line[0])
    input_line[0] = 0
else:
    input_line[0] = 0
    input_line[1] = 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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

if x[0]>x[2]:
    print(str(x[0]-x[2])+" "+str(x[1]))
elif x[0]+x[1]>x[2]:
    print("0"+" "+str(x[0]+x[1]-x[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 K>A and A+B>=K:
  print(0,B-K+A)
else:
  print(0,0)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


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

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

    




    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    A, B, K = map(int, readline().split())
    if K <= A:
        print(A - K, B)
    elif A < K <= A + B:
        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())
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:
    a -= k
elif a < k <= a + b:
    temp = a
    a = 0
    b -= k - temp
else:
    a = 0
    b = 0
print('{} {}'.format(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(A, B)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(A,B)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = input().split()
a = int(i[0])
b = int(i[1])
k = int(i[2])
if a >= k:
  a = a - k
else:
  if (k - a) >= b:
    a = 0
    b = 0
  else:
    b = b - (k - a)
    a = 0
print(a," ",b)

Submission status: Accepted

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

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

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

print(A,B)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

AK = A-K

if AK < 0:
    BK = AK+B
    if BK < 0:
        print(0, 0)
    else:
        print(0, BK)
else:
    print(AK, B)

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
flag_1=False
flag_2=False
flag_3=False

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

Submission status: Accepted

Solution code:
#from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


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

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


main()

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 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 = map(int, input().split())
taka = A
ao = B

if K <= A:
    taka -= K
else:
    taka = 0
    ao -= K-A
    if ao < 0:
        ao = 0
print(taka, ao)

Submission status: Accepted

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

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

# A-k>=0ならその分kからひく
a = max(A - K, 0)
K -= A - a
# 残りのkでひく
b = max(B - K, 0)
# *でリストを外す
print(*[a, b])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def actual(a, b, k):
    if a >= k:
        # return f'{a - k} {b}'
        return '{} {}'.format((a - k), b)

    if b > (k - a):
        # return f'0 {b - (k - a)}'
        return '0 {}'.format(b - (k - a))

    return '0 0'

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve(A, B, K):
    if K <= A:
        print(A - K, B)
    elif K - A <= B:
        print(0, B - (K - A))
    else:
        print(0, 0)

if __name__ == "__main__":
    A, B, K = map(int, input().split())
    solve(A, B, K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc149/tasks/abc149_b
a, b, k = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC149B
def main():
    import sys, math
    A, B, K = map(int, sys.stdin.readline().split())
    #print(A, B, K)
    if A>=K:
        print(A-K, B)
    else:
        print(0, max(B-(K-A), 0))
   

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

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


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

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

    print(A, B)


if __name__ == '__main__':
    solve()

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

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

    if A > K:
        A -= K
    else:

        K -= A
        A = 0
        B -= K
        if B <= 0:
            print("0 0")
            exit(0)

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

T = A + B

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import decimal # 10進法に変換，正確な計算

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

def main():
    a, b, k = map(int, input().split())
    if k <= a:
        print(a-k, b)
        return
    elif k <= a + b:
        print(0, b-k+a)
        return
    print(0, 0)

    
    
main()

Submission status: Accepted

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


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