Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
# template: v1.3.1

import io
import sys
import math

### DEBUG ###
_DEB = 0  # 1:ON / 0:OFF

_INPUT = """\
RWRWRW
"""
_EXPECTED = """\
2

"""
if _DEB:
    sys.stdin = io.StringIO(_INPUT)
    print("!! Debug Mode !!")

def logd(str):
    if _DEB: print(f"[deb] {str}")


### INPUT ####
n = int(input())
c = input()
c=c.replace("R","0")
c=c.replace("W","1")
c=[int(x) for x in c]

### Solve ####
def solve():
    # Process
    ans=0
    id1=0
    for i in reversed(range(n)):
        id0=-1
        if c[i] == 0:
            id0=i
            for j in range(id1,id0):
                if c[j]==1:
                    id1=j
                    c[i]=1
                    c[j]=0
                    ans+=1
                    break
                
            if[i]==0:
                c[i]=1
                ans+=1

    # OUPUT
    ans = str(ans)
    print(ans)
    return ans

### MAIN ###
if __name__ == "__main__":
    ans = solve()

    # Checker
    if _DEB:
        if _EXPECTED.strip() == ans.strip(): print("\n!! Success !!")
        else: print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")

Fixed submission:
# -*- coding: utf-8 -*-
# template: v1.3.1

import io
import sys
import math

### DEBUG ###
_DEB = 0  # 1:ON / 0:OFF

_INPUT = """\
200000
"""+("R"*200000)
_EXPECTED = """\
2

"""
if _DEB:
    sys.stdin = io.StringIO(_INPUT)
    print("!! Debug Mode !!")

def logd(str):
    if _DEB: print(f"[deb] {str}")


### INPUT ####
n = int(input())
c = input()
c=c.replace("R","0")
c=c.replace("W","1")
c=[int(x) for x in c]

### Solve ####
def solve():
    # Process
    ans=0
    id1=0
    for i in reversed(range(n)):
        if id1 > i:
            break
        id0=-1
        if c[i] == 0:
            id0=i
            not_found=True
            for j in range(id1,id0):
                if c[j]==1:
                    id1=j
                    c[i]=1
                    c[j]=0
                    ans+=1
                    not_found=False
                    break
            if not_found:
                break
                
            if[i]==0:
                c[i]=1
                ans+=1
        

    # OUPUT
    ans = str(ans)
    print(ans)
    return ans

### MAIN ###
if __name__ == "__main__":
    ans = solve()

    # Checker
    if _DEB:
        if _EXPECTED.strip() == ans.strip(): print("\n!! Success !!")
        else: print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")
Buggy python submission (verdict: Time Limit Exceeded):
# にぶたん練習
n,k=map(int,input().split())
a=list(map(int,input().split()))

# カット後のaの最大長を取り、カット数をシミュレートする。
# k以下でカット可能ならばTrueを返す。
# にぶたんは、効率良くT/Fを判定できる関数が作れるかがみそ。
def f(n):
  cnt=0
  for aa in a:
    cuta=aa
    i=0
    while cuta>n:
      i+=1
      cuta=aa/(i+1)
    cnt+=i
  if cnt>k:
    return False
  return True

# にぶたん実装
l,r=0,max(a)
while r-l>1:
  m=(r+l)//2
  if f(m):
    r=m
  else:
    l=m

# 今回は、rが必要な値。厳密な値は(l<x<=r)になるので、小数点切り上げでrとなる。
print(r)


Fixed submission:
# -*- coding: utf-8 -*-
# template: v1.3.1

# 丸太の分割分割問題。
# 速度の観点から、「答えの二分探索」が必要。典型らしい。



import io
import sys
import math

### DEBUG ###
_DEB = 0   # 1:ON / 0:OFF

_INPUT = """\
2 1
1 50
"""

# Worst
# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"
# _INPUT = f"{str(2*(10**5))} {str(10**9)}\n{(str(10**9)+' ')*(2*(10**5)) }"


_EXPECTED = """\
ABC
"""
if _DEB:
    sys.stdin = io.StringIO(_INPUT)
    print("!! Debug Mode !!")


def logd(str):
    if _DEB: print(f"[deb] {str}")

# is_m_OK?
def f(m):
    cut=0
    for aa in a:
        c=math.ceil(aa/m)
        cut+=c-1
        if cut > k:
            return False
    return True
#m=7,a=[7,9]


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

### Solve ####
def solve():
    # Process

    ans=0
    l,r=0,10**9
    while abs(r-l)!=1:
        m=(l+r)//2
        if f(m): # m is ok: Go left
            r=m
        else: # m is ng : Go right
            l=m
    
    ans=r
    # ans=min(r,max(a))

    # OUPUT
    ans = str(ans)
    print(ans)
    return ans

### MAIN ###
if __name__ == "__main__":
    ans = solve()

    # Checker
    if _DEB:
        if _EXPECTED.strip() == ans.strip(): print("\n!! Success !!")
        else: print(f"\n!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
ans=0
for aa in set(a):
  ca=a.count(aa)
  if ca>=aa:
    ans+=ca-aa
  else:
    ans+=ca
print(ans)

Fixed submission:
from collections import defaultdict
n=int(input())
a=list(map(int,input().split()))

dd=defaultdict(lambda:0)
for aa in a: dd[aa]+=1

ans=0
for aa in dd.keys():
  ca=dd[aa]
  if ca>=aa:
    ans+=ca-aa
  else:
    ans+=ca
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-

import io
import sys
import math

def solve(n, k, a_lst):
    # implement process
    a_set = set(a_lst)
    ak = len(a_set)
    diff = ak - k
    if diff < 1:
        return 0
    
    min_change = float("inf")
    cnt_lst = []
    for a in a_set:
        cnt_lst.append(a_lst.count(a))
    cnt_lst.sort()
    return sum(cnt_lst[0:diff])

def main():
    # input
    n, k = map(int,input().split())
    a_lst = list(map(int,input().split()))

    # process
    ans = str( solve(n, k, a_lst) )
    
    # output
    print(ans)
    return ans
        
### DEBUG I/O ###
_DEB = 0   # 1:ON / 0:OFF

_INPUT = """\
10 3
5 1 3 2 4 1 1 2 3 4
"""
_EXPECTED = """\
0
"""

def logd(str):
    """usage:
    if _DEB: logd(f"{str}")
    """
    if _DEB: print(f"[deb] {str}")

### MAIN ###
if __name__ == "__main__":
    if _DEB:
        sys.stdin = io.StringIO(_INPUT)
        print("!! Debug Mode !!")

    ans = main()

    if _DEB:
        print()
        if _EXPECTED.strip() == ans.strip(): print("!! Success !!")
        else: print(f"!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")

Fixed submission:
# -*- coding: utf-8 -*-

import io
import sys
import math

def solve(n, k, a_lst):
    # implement process
    a_set = set(a_lst)
    ak = len(a_set)
    diff = ak - k
    if diff < 1:
        return 0
    
    #ソート済み配列を検査することで、count処理を線形にする
    a_lst.sort()
    tmp = a_lst[0]
    cnt = 0
    cnt_lst = []
    for i in range(len(a_lst)):
        if tmp != a_lst[i]:
            tmp = a_lst[i]
            cnt_lst.append(cnt)
            cnt = 0
        cnt += 1
    cnt_lst.append(cnt)
    cnt_lst.sort()
    return sum(cnt_lst[0:diff])

def main():
    # input
    n, k = map(int,input().split())
    a_lst = list(map(int,input().split()))

    # process
    ans = str( solve(n, k, a_lst) )
    
    # output
    print(ans)
    return ans
        
### DEBUG I/O ###
_DEB = 0   # 1:ON / 0:OFF

_INPUT = """\
5 2
1 1 2 2 5
"""
_EXPECTED = """\
0
"""

def logd(str):
    """usage:
    if _DEB: logd(f"{str}")
    """
    if _DEB: print(f"[deb] {str}")

### MAIN ###
if __name__ == "__main__":
    if _DEB:
        sys.stdin = io.StringIO(_INPUT)
        print("!! Debug Mode !!")

    ans = main()

    if _DEB:
        print()
        if _EXPECTED.strip() == ans.strip(): print("!! Success !!")
        else: print(f"!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")
Buggy python submission (verdict: Runtime Error):
Y_DIR[-1,0,1]
X_DIR[-1,0,1]
def count_bomb(y,x):
  cnt=0
  for yd in Y_DIR:
    yy=y+yd
    if not (0<=yy<h):
      continue
    for xd in X_DIR:
      xx=x+xd
      if not (0<=xx<w):
        continue
      if s[yy][xx]=="#":
        cnt+=1
  return cnt

h,w=map(int,input().split())
s=[]
for i in range(h):
  s.append(input())
for y in range(h):
  for x in range(w)
    if s[y][x] == ".":
      s[y][x]=str(count_bomb(y,x))

print("\n".join(s)) 
      


Fixed submission:
Y_DIR=[-1,0,1]
X_DIR=[-1,0,1]
def count_bomb(y,x):
  cnt=0
  for yd in Y_DIR:
    yy=y+yd
    if not (0<=yy<h):
      continue
    for xd in X_DIR:
      xx=x+xd
      if not (0<=xx<w):
        continue
      if s[yy][xx]=="#":
        cnt+=1
  return cnt

h,w=map(int,input().split())
s=[]
for i in range(h):
  s.append(input())
  
ans=["" for _ in range(h)]
for y in range(h):
  for x in range(w):
    if s[y][x] == ".":
      c=count_bomb(y,x)
      ans[y]+=str(c)
    else:
      ans[y]+=s[y][x]

print("\n".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a_lst = []
for i in range(m):
  a_lst.append( list(map(int,input().split())) )

ans = "IMPOSSIBLE"

start_lst = []
goal_lst = []
for a in a_lst:
  if a[0] == 1:
    start_lst.append(a[1])
  if a[1] == n:
    goal_lst.append(a[0])
    
for s in start_lst:
  if s in goal_lst:
    ans = "POSSIBLE"
    
print(ans)

Fixed submission:
n,m = map(int,input().split())

start_set = set()
goal_set = set()
for i in range(m):
  s,g = map(int,input().split())
  if s == 1:
    start_set.add(g)
  if g == n:
    goal_set.add(s)    

ans = "POSSIBLE" if (start_set & goal_set) else "IMPOSSIBLE"
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
for i in (a,b,a+b):
  i%3==0:
    print("Possible")
    exit()
    
print("Impossible")


Fixed submission:
a,b=map(int,input().split())
for i in (a,b,a+b):
  if i%3==0:
    print("Possible")
    exit()
    
print("Impossible")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())
for i in (a,b,a+b):
  i%3==0:
    print("Possible")
    exit()
    
print("Impossible")

Fixed submission:
a,b=map(int,input().split())
for i in (a,b,a+b):
  if i%3==0:
    print("Possible")
    exit()
    
print("Impossible")
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input())
n=a-b
if n >= 0:
  print("delicious")
elif x+n >=0:
  print("safe")
else:
  print("dangerous")

Fixed submission:
x,a,b=map(int,input().split())
n=a-b
if n >= 0:
  print("delicious")
elif x+n >=0:
  print("safe")
else:
  print("dangerous")
Buggy python submission (verdict: Runtime Error):
import sys
n,k,x,y = map(int,sys.stdio.read().split())
high=n-k
ans=0
if high > 0:
  ans=x*k+high*y
else:
  ans=n*x
print(ans)

Fixed submission:
# -*- coding: utf-8 -*-
# template: v1.2

import io
import sys
import math

def solve(n,k,x,y):
    # implement process
    higher = n-k
    if higher < 1:
        return n*x
    else:
        return k*x + higher*y



def main():
    # input
    n,k,x,y = map(int,sys.stdin.read().split())
    
    # process
    ans = str( solve(n,k,x,y) )
    
    # output
    print(ans)
    return ans
        
### DEBUG I/O ###
_DEB = 0   # 1:ON / 0:OFF

_INPUT = """\
2
3
10000
9000
"""
_EXPECTED = """\
20000
"""

def logd(str):
    if _DEB: print(f"[deb] {str}")

### MAIN ###
if __name__ == "__main__":
    if _DEB:
        sys.stdin = io.StringIO(_INPUT)
        print("!! Debug Mode !!")

    ans = main()

    if _DEB:
        print()
        if _EXPECTED.strip() == ans.strip(): print("!! Success !!")
        else: print(f"!! Failed... !!\nANSWER:   {ans}\nExpected: {_EXPECTED}")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N , K = map(int, input().split())

    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))

    import itertools
    p = itertools.permutations(A_list, K)
    ans = 100000000000
    for val in p :
        ans_new = sum(val)
        if ans_new < ans :
            ans = ans_new
        #print(val)

    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N , K = map(int, input().split())

    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))

    A_list.sort()
    #print(A_list)
    ans = 0
    for i in range(0,K) :
        ans = ans + A_list[i]

    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #print(A_list)
    A_list.sort()
    #print(A_list)
    ans = 1
    for a in A_list :
        ans = ans * a
        if ans == 0 :
            break
    if ans > 10 ** 18 :
        ans = -1

    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #print(A_list)
    A_list.sort()
    #print(A_list)
    ans = 1
    for a in A_list :
        ans = ans * a
        if ans == 0 :
            break
        elif ans > 10 ** 18 :
            ans = -1
            break

    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    ans = 1
    for a in A_list :
        ans = ans * a
        if ans == 0 :
            break
    if ans > 10 ** 18 :
        ans = -1

    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #print(A_list)
    A_list.sort()
    #print(A_list)
    ans = 1
    for a in A_list :
        ans = ans * a
        if ans == 0 :
            break
        elif ans > 10 ** 18 :
            ans = -1
            break

    print(ans)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    ans = 1
    for a in A_list :
        ans = ans * a
    if ans > 10 ** 18 :
        ans = -1

    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #print(A_list)
    A_list.sort()
    #print(A_list)
    ans = 1
    for a in A_list :
        ans = ans * a
        if ans == 0 :
            break
        elif ans > 10 ** 18 :
            ans = -1
            break

    print(ans)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
from decimal import *
def main():
    A , B = input().split()
    A = float(A)
    B = float(B)
    C = Decimal(A) * Decimal(B)
    #print(C)
    D = str(C)
    D = D.split(".")[0]
    #print(D)
    E = int(D)
    print(E)



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import decimal
    A , B = map(decimal.Decimal, input().split())
    C = decimal.Decimal(A) * decimal.Decimal(B)
    #print(C)
    D = str(C)
    D = D.split(".")[0]
    #print(D)
    E = int(D)
    print(E)



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
from decimal import *
def main():
    A , B = input().split()
    A = float(A)
    B = float(B)
    C = Decimal(A) * Decimal(B)
    #print(C)
    D = str(C)
    D = D.split(".")[0]
    #print(D)
    E = int(D)
    print(E)



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    import decimal
    A , B = map(decimal.Decimal, input().split())
    C = decimal.Decimal(A) * decimal.Decimal(B)
    #print(C)
    D = str(C)
    D = D.split(".")[0]
    #print(D)
    E = int(D)
    print(E)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #ans_list = []

    for n_cycle in range(N) :
        n_cycle = n_cycle + 1
        #ans_list.append(A_list.count(n_cycle))
        print(A_list.count(n_cycle))
    #for ans in ans_list :
    #    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from collections import Counter
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #ans_list = []
    ans = Counter(A_list)

    for n_cycle in range(N) :
        n_cycle = n_cycle + 1
        #ans_list.append(A_list.count(n_cycle))
        print(ans[n_cycle])

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #ans_list = []

    for n_cycle in range(1,N+1) :
        #ans_list.append(A_list.count(n_cycle))
        print(A_list.count(n_cycle))
    #for ans in ans_list :
    #    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from collections import Counter
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #ans_list = []
    ans = Counter(A_list)

    for n_cycle in range(N) :
        n_cycle = n_cycle + 1
        #ans_list.append(A_list.count(n_cycle))
        print(ans[n_cycle])

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    ans_list = []
    i_cycle = 1
    manage_dict = {}
    for n_cycle in range(1,N+1) :
        ans_list.append(A_list.count(n_cycle))
    for ans in ans_list :
        print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    from collections import Counter
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #ans_list = []
    ans = Counter(A_list)

    for n_cycle in range(N) :
        n_cycle = n_cycle + 1
        #ans_list.append(A_list.count(n_cycle))
        print(ans[n_cycle])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K = map(int, input().split())
    value_diff_abs = 0

    if N == 0 :
        print("0")
    elif K == 1 and N != 0 :
        print("0")
    elif K == 2 and N % 2 == 0 and N != 0 :
        print("0")
    elif K == 2 and N % 2 != 0 and N != 0 :
        print ("1")
    else :
        for i in range(0 , N + 1) :
            value_diff_abs = N
            N = abs(N - K)
            if value_diff_abs < N :
                print(str(value_diff_abs))
                break


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    value_diff_abs = 0

    if N == 0 or N == K :
        print("0")
    elif N > K :
        ans = N % K
        #print(ans)
        N = ans
        for i in range(0 , N + 1) :
            value_diff_abs = N
            N = abs(N - K)
            #print(str(value_diff_abs))
            if value_diff_abs < N :
                print(str(value_diff_abs))
                break
            elif value_diff_abs == N :
                print(str(value_diff_abs))
                break
    else :
        for i in range(0 , N + 1) :
            value_diff_abs = N
            N = abs(N - K)
            if value_diff_abs < N :
                print(str(value_diff_abs))
                break
            elif value_diff_abs == N :
                print(str(value_diff_abs))
                break


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    N, K = map(int, input().split())
    value_diff_abs = 0

    if K == 1 :
        print("0")
    elif K == 2 and N % 2 == 0 :
        print("0")
    elif K == 2 and N % 2 != 0 :
        print ("1")
    else :
        for i in range(0 , (10^18 // N) + 2) :
            value_diff_abs = N
            N = abs(N - K)
            if value_diff_abs < N :
                print(str(value_diff_abs))
                break


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N, K = map(int, input().split())
    value_diff_abs = 0

    if N == 0 or N == K :
        print("0")
    elif N > K :
        ans = N % K
        #print(ans)
        N = ans
        for i in range(0 , N + 1) :
            value_diff_abs = N
            N = abs(N - K)
            #print(str(value_diff_abs))
            if value_diff_abs < N :
                print(str(value_diff_abs))
                break
            elif value_diff_abs == N :
                print(str(value_diff_abs))
                break
    else :
        for i in range(0 , N + 1) :
            value_diff_abs = N
            N = abs(N - K)
            if value_diff_abs < N :
                print(str(value_diff_abs))
                break
            elif value_diff_abs == N :
                print(str(value_diff_abs))
                break


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import os
import sys
import heapq

def main():
    H , K = map(int , input().split())
    n_list = [s for s in input().split()]
    n_list = list(map(int,n_list))
    #print (n_list)
    #c = sum(int(i) for i in list)
    list_small = []
    new_list = []
    if K >= len(n_list) :
        print (str(0))
    elif K == 0 :
        c = sum(int(i) for i in n_list)
        print (str(c))
    else :
        list_small = heapq.nlargest(K,n_list)
        list_small = list(map(int,list_small))
        #print (list_small)
        #new_list = list(set(n_list)-set(list_small))
        new_list = list_difference(n_list, list_small)
        #print (list_small)
        #print (new_list)
        c = sum(int(i) for i in new_list)
        print (str(c))
    #print (str(X))
def list_difference(list1, list2):
    result = list1.copy()
    for value in list2:
        if value in result:
            result.remove(value)

    return result

if __name__ == '__main__':
    main()

Fixed submission:
import os
import sys
import heapq

def main():
    H , K = map(int , input().split())
    n_list = [s for s in input().split()]
    n_list = list(map(int,n_list))
    #print (n_list)
    #c = sum(int(i) for i in list)
    list_small = []
    new_list = []
    if K >= len(n_list) :
        print (str(0))
    elif K == 0 :
        c = sum(int(i) for i in n_list)
        print (str(c))
    else :
        list_small = heapq.nlargest(K,n_list)
        list_small = list(map(int,list_small))
        #print (list_small)
        #new_list = list(set(n_list)-set(list_small))
        #new_list = list_difference(n_list, list_small)
        #print (list_small)
        #print (new_list)
        c = sum(int(i) for i in n_list)
        d = sum(int(i) for i in list_small)
        print (str(c-d))
    #print (str(X))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import os
import sys

def main():
    A , B , K = map(int , input().split())
    for i in range(0 , K) :
        if A >= 1 :
            A = A - 1
        elif A == 0 and B >= 1 :
            B = B - 1
        else :
            pass
    print (str(A) + " " + str(B))

if __name__ == '__main__':
    main()

Fixed submission:
import os
import sys

def main():
    A , B , K = map(int , input().split())
    if K >= A :
        KK = K - A
        A = 0

        if KK >= B :
            B = 0
        else :
            B = B - KK
    else :
        A = A - K
    print (str(A) + " " + str(B))

if __name__ == '__main__':
    main()