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: Wrong Answer

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


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


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


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

    
def main():
    A, B, K = read_values()
    s = min(K, A)
    print(A - s,  B - (K - s))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

print(left, right)

Submission status: Wrong Answer

Solution code:
from heapq import heappush, heappop
from collections import deque
import re
import math
import functools

def sRaw():
    return input().rstrip("\r")

def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))

INF = 1 << 29


def make1d_arr(n, val=INF):
    return [val for i in range(n)]


def make2d_arr(h, w, val=INF):
    return [[val for i in range(w)]for i in range(h)]


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


def BFord(n,es):
    v_cost = [INF]*n
    v_cost[0] = 0
    for v in range(n*2):
        for e in es:
            frm = e[0]
            to = e[1]
            if v_cost[to] > v_cost[frm]+e[2]:
                v_cost[to] = v_cost[frm]+e[2]
                if v >= n:
                    v_cost[to] = -INF
        if v == n-1:
            prev = v_cost[:]
    v_cost = [-INF if prev[idx]!=v_cost[idx] else v_cost[idx] for idx in range(n)]
    return v_cost
    
def ZAlgo(s):
    l = len(s)
    A = [0]*l
    i =1
    j =0
    A[0]=l
    while i<l:
        while i+j<l and s[j] == s[i+j]:
            j+=1
        if j==0:
            i+=1
            continue
        A[i]=j
        k=1
        while (i+k<l) and (k+A[k]<j):
            A[i+k] =A[k]
            k+=1
        i+=k
        j-=k
    return A


DIV = 998244353

def main():
    A,B,K = isRaw()
    if K <=A:
        return (A-K,B)
    else:
        return (0,max(B-K+A,0))

if __name__ == "__main__":

    print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    A, B, K = map(int, input().split())
    if A <= K:
        K -= A
        A = 0
    else:
        A -= K

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

    return 0

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
a, b, k = [int(x) for x in input().strip().split()]
if k <= a:
    print((a - k) + b, b)
else:
    print(0, max(0, b - (k - a)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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


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

print(A, B)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

ans = [0, 0]

if k > a:
    ans[1] = a + b - k
else:
    ans[0] = a - k
    ans[1] = b

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

Submission status: Wrong Answer

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

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

print(T, A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if A > K:
    print('{} {}'.format(A - K, B))
else:
    print('0 {}'.format(B - (K - A)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    A,B,K=map(int,input().split())
    ans=A-K if A-K>0 else 0
    ans2=B-(K-A if K-A >0 else 0)
    print(str(ans)+' '+str(ans2))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(a, b)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
a,b,k=map(int,input().split())
print(max(0,a-k),max(0,b+a-k))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(a, b)

Submission status: Wrong Answer

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

tkhs = max(a-k,0)
aoki = max(b-(k-a),0)

print(tkhs,aoki)

Submission status: Wrong Answer

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

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

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    a,b,k = LI()
    b -= max(0,k-a)
    a = max(0,a-k)

    return JA([a,b], " ")


print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    a, b, k = list(map(int, readline().split()))
    print(a - (k + 2 - 1) // 2, b - (k - (k + 2 - 1) // 2))


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(a, b)

Submission status: Wrong Answer

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

sys.setrecursionlimit(1000000)
mod = 1000000007

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

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

Submission status: Wrong Answer

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

a, b, k = list(map(int, sys.stdin.buffer.readline().split()))
t = min(a, k)
a -= t
k -= t
b -= k
print(a, b)

Submission status: Time Limit Exceeded

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

for x in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1
  else:
    break

print(a,b)

Submission status: Time Limit Exceeded

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

for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        pass

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
T,A,K = map(int,input().split())
for i in range(K):
    if T > 0:
        T -= 1
    elif A > 0:
        A -= 1
print(str(T) + " " + str(A))

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
  if a!=0:
    a-=1
  elif b!=0:
    b-=1
  else:
    break
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
  if a!=0:
    a-=1
  elif b!=0:
    b-=1
  else:
    continue
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
for i in range(K):
    if A>=1:
        A-=1
    elif B>=1:
        B-=1
    elif A==0 and B==0:
        break
print(A,B)

Submission status: Time Limit Exceeded

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

for i in range(K):
	if A >= 1:
		A = A - 1
	elif B >= 1:
		B = B -1
	else:
		break
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
for cnt in range(K):
  if A > 0:
    A = A-1
  elif B > 0:
    B = B-1

print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = list(map(int, input().rstrip().split()))
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
    else:
        break

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

Submission status: Time Limit Exceeded

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

for i in range(k):
  if a>=1:
    a-=1
  elif b>=1:
    b-=1
print(a,b)

Submission status: Time Limit Exceeded

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

for p in range(k):
  if a >= 1:
    a -= 1
  else:
    if b >= 1:
      b -= 1
    
print(str(a) + ' ' + str(b))

Submission status: Time Limit Exceeded

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

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: Time Limit Exceeded

Solution code:
A,B,N = map(int,input().split())
for i in range(N):
  if A>0:
    A-=1
  else:
    if B>0:
      B-=1
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
# ABC149 B - Greedy Takahashi
a,b,k = map(int,input().split())

for i in range(k):
    if a>0:
        a -=1
    else:
        if b>0:
            b -=1
print(str(a)+' '+str(b))

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
taka = a
aoki = b
recur = k
if (taka+aoki)<=k:
  print("0 0")
  exit()
for i in range(k):
  if taka == 0 and aoki == 0:
    break
  if taka >= 1:
    taka -=1
  elif taka == 0 and aoki >= 1:
    aoki -= 1
  
  
print("{} {}".format(taka,aoki))

Submission status: Time Limit Exceeded

Solution code:
data = [i for i in map(int,input().split())]
for i in range(data[2]):
  if data[0] >= 1:
    data[0] -= 1
  elif data[1] >=1:
    data[1] -=1
print(f'{data[0]} {data[1]}')

Submission status: Time Limit Exceeded

Solution code:
import sys

def main():
    
    a,b,k = map(int, input().split())
    if a + b <= k:
        print(0,0)
        sys.exit()
    else:    
        for i in range(k):
            if a > 0:
                a = a-1
            if a <= 0 and b > 0:
                b = b-1
                break
        print(a,b)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

while k > 0:
    if a >= 1:
        a -= 1
        k -= 1
    elif a == 0 and b >= 1:
        b -= 1
        k -= 1
    elif a == 0 and b == 0:
        k -= 1

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
for i in range(K):
    if  A==0 and B==0:
        A+=0
        B+=0
    elif A>=1:
        A-=1
    elif B>=1:
        B-=1
c=str(A)
d=str(B)
print(c+' '+d)

Submission status: Time Limit Exceeded

Solution code:
def main():
  A, B, K = map(int, input().split())
  
  for _ in range(K):
    if A >= 1:
      A -= 1
      continue
    elif B >= 1:
      B-= 1
      continue
    elif A == 0 and B == 0:
      break
  
  print(A, B)
  
  
  
main()

Submission status: Time Limit Exceeded

Solution code:
def main():
  A, B, K = map(int, input().split())
  
  for _ in range(K):
    if A >= 1:
      A -= 1
      continue
    elif B >= 1:
      B-= 1
      continue
  
  print(A, B)
  
  
  
main()

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
def main():
    A,B,K=map(int, input().split())
    if A + B <= K:
        print('0 0')
        return
    for _ in range(K):
        if A >= 1:
            A -= 1
        else:
            if B >= 1:
                B -= 1
    print(A,B)
main()

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
for i in range(0,K):
    if A>=1:
        A=A-1
    elif B>=1:
        B=B-1
    else:
        break
        
print(A,B)

Submission status: Time Limit Exceeded

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

if a == 0 and b == 0:
  print(a, b)
  exit()

ans = 0
while a >= 1:
  for i in range(k - 1):
    a -= 1
    ans += 1
if b >= 1:
  for i in range(k - ans):
    b -= 1
    
print(a, b)

Submission status: Time Limit Exceeded

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

for i in range(K):
    if A > 0:
        A -= 1
    elif A == 0 and B > 0:
        B -= 1
    elif A == B == 0:
        pass

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a,b,c = map(int, input().split())
 
for i in range(c):
  if(a == 0 and b > 0):
  	b -= 1
  elif(a > 0):
    a -= 1
print(str(a),str(b))

Submission status: Time Limit Exceeded

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

for i in range(K):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
    
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int, input().split())
for i in range (K):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
print(A,B)

Submission status: Time Limit Exceeded

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

while k > 0:
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    elif a == 0 and b == 0:
        continue
    k -= 1

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

Submission status: Time Limit Exceeded

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

for k in range(K):
    if A >= 1:
        A -= 1
        continue
    if B >= 1:
        B -= 1
        continue
        
print(A, B)

Submission status: Time Limit Exceeded

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

for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        break
print(a,b)

Submission status: Time Limit Exceeded

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

for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        break
print('{} {}'.format(a, b))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A,B,K = map(int,input().split())
for _ in range(K):
    if A > 0:
        A -= 1
    elif A == 0 and B > 0:
        B -= 1
print(A,B)

Submission status: Time Limit Exceeded

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

A = a
B = b
i = 1
while True:
  if A >= 1:
    A += -1
  else:
    if B >= 1:
      B += -1
    else:
      print(0, 0)
  if i == k:
    print(A, B)
    exit()
  else:
    i  += 1

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int, input().split())
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
print(str(a) + ' ' +str(b))

Submission status: Time Limit Exceeded

Solution code:
def main():

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

    for i in range(K):
        if A >= 1:
            A -= 1
        elif B >= 1:
            B -= 1

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
for i in range(K):
  if A>=1:
    A-=1
  elif B>=1:
    B-=1
print(A,B)

Submission status: Time Limit Exceeded

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

for i in range(k):
  if a > 0:
    a-=1
  elif b > 0:
    b-=1

print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
for i in range(k):
    if a == 0:
        b += -1
    if a:
        a += -1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int, input().split())
for _ in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
    if a==0 and b==0:
        break
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int, input().split())
for _ in range(k):
    if a>=1:
        a-=1
    elif b>=1:
        b-=1
    if a==0 and b==0:
        continue
print(a,b)

Submission status: Time Limit Exceeded

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

for i in range(K):
    if A > 0:
        A -= 1
    elif B > 0:
        B -= 1
    else:
        break

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
A,B,K=map(int,input().split())
for i in range(K):
    if A>0 :
        A=A-1
    elif B>0 :
        B=B-1
    else :
        break
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
for i in range(k):
    if  a >= 1:
        a -= 1
    elif b >= 1:
        b -=1
print(a, b)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
    if a>=1:
        a-=1
    elif a==0 and b>=1:
        b-=1
print(a,b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

# check
for i in range(K):
    if A >= 1:
         A -= 1
    elif B >= 1:
         B -= 1
    else:
        continue

print(A, B)

Submission status: Time Limit Exceeded

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

for i in range(k):
  if a >= 1:
    a -= 1
  elif a == 0 and b >= 1:
    b -= 1

print(a,b)

Submission status: Time Limit Exceeded

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

for i in range(k):
  if a >= 1:
    a -= 1
  elif a == 0 and b >= 1:
      b -= 1

print(a,b)

Submission status: Time Limit Exceeded

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

for i in range(K):
    if A>=1:
        A=A-1
    else:
        if B>=1:
            B=B-1
        else:
            pass
print(A, B)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
for _ in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1

print(a,b)

Submission status: Time Limit Exceeded

Solution code:
# B - Greedy Takahashi
a,b,k = map(int,input().split())
for i in range(k):
    if a >= 1:
        a -= 1
    else:
        b -= 1
print(a,b)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = [int(_) for _ in input().split()]
for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1
print(A, B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k = map(int,input().split())
for i in range(k):
    if a >= 1:
        a -= 1
    elif b >= 1:
        b -= 1
    else:
        continue
print(str(a)+" "+str(b))

Submission status: Time Limit Exceeded

Solution code:
a , b , k = map(int, input().strip().split())
for i in range(1, k+1):
    if a>0:
        a = a-1
    elif a==0 and b>0:
        b = b-1
print(a, b)

Submission status: Time Limit Exceeded

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

for i in range(k):
  if a > 0:
    a = a - 1
  elif b > 0:
    b = b - 1

print(str(a) + ' ' + str(b))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
  if a > 0:
    a -= 1
  elif a == 0 and b > 0:
    b -= 1
  elif a == 0 and b == 0:
    continue;
print(a,b)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys

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

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

for i in range(K):
    if A >= 1:
        A -= 1
    elif B >= 1:
        B -= 1

print(A, B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int,input().split())
if A <= 10**12 and B <= 10**12 and K <= 10**12:
  for _ in range(K):
    if A >= 1:
      A -= 1
    elif B >= 1:
      B -= 1
    else:
      break
print(A,B)

Submission status: Time Limit Exceeded

Solution code:
a,b,k=map(int,input().split())
for i in range(k):
  if a>0:
    a-=1
  elif b>0:
    b-=1
  else:
    pass
print(str(a)+' '+str(b))

Submission status: Time Limit Exceeded

Solution code:
A, B, K = (int(x) for x in input().split())
for i in range(K):
  if A >= 1:
    A -= 1
  elif B >= 1:
    B -= 1
print(A,B)

Submission status: Time Limit Exceeded

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

for x in range(0,t[2]):
    if t[0] > 0:
        t[0] = t[0] - 1
    elif t[0] == 0 and t[1] > 0:
        t[1] = t[1] - 1

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

Submission status: Time Limit Exceeded

Solution code:
a, b, k = map(int, input().split())
for i in range(k):
    if a > 0:
        a -= 1
    elif a == 0 and b > 0:
        b -= 1
    elif a == 0 and b == 0:
        break

print(a, b)

Submission status: Time Limit Exceeded

Solution code:
# ABC 149: B – Greedy Takahashi
A, B, K = [int(s) for s in input().split()]

for _ in range(K):
    if A > 0:
        A -= 1
    elif B > 0:
        B -= 1

print(A, B)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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


for _ in range(K):
    if A >= 1:
        A = A - 1
    elif A == 0 and B >=1:
        B = B - 1
    else:
        pass

print(A, B)

Submission status: Time Limit Exceeded

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


for _ in range(K):
    if A >= 1:
        A = A - 1
    elif A == 0 and B >=1:
        B = B - 1
    else:
        pass

print(A, B)

Submission status: Time Limit Exceeded

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


def solve(A: int, B: int, K: int):
    for i in range(K):
        if A >= 1:
            A -= 1
        elif B>=1:
            B-=1
        else:
            break
    print(A,B)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, K)

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

for i in range(K):
    if A>=1:
        A-=1
    elif B>=1:
        B-=1


print(A,B)

Submission status: Time Limit Exceeded

Solution code:
A, B, K = map(int, input().split())
for i in range(K):
    if A>=1:
        A -= 1
    elif A==0 and B >=1:
        B -= 1
    elif A == B == 0:
        break
print(A, B, sep=' ')

Submission status: Time Limit Exceeded

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