Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())
count = 0
if K*3 < S:
    print(count)
else:
    for i in range(K, -1, -1):
        X = i
        YZ = S - X
        for j in range(K, -1, -1):
            Y = j
            Z = YZ - Y
            if Z > K:
                continue
            elif Z < 0:
                continue
            else:
                count += 1
                #print(X,Y,Z)
print(count)

Fixed submission:
S = list(map(str, input().split(",")))
ans = ""
for i in S:
    ans += i + " "
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int, input().split())
count = 0
if K*3 < S:
    print(count)
else:
    for i in range(K, -1, -1):
        X = i
        for j in range(K, -1, -1):
            Y = j
            Z = S - (X + Y)
            if Y > K or Z > K:                
                continue
            elif Z < 0:
                continue
            else:
                count += 1
                #print(X, Y, Z)
print(count)

Fixed submission:
K, S = map(int, input().split())
count = 0
if K*3 < S:
    print(count)
else:
    for i in range(K, -1, -1):
        X = i
        YZ = S - X
        for j in range(K, -1, -1):
            Y = j
            Z = YZ - Y
            if Z > K:
                continue
            elif Z < 0:
                continue
            else:
                count += 1
                #print(X,Y,Z)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = [int(i) for i in input().split()]

ans = []
for i in range(1, len(A)+1):
  ans.append(str(A.index(i)+1))

print(' '.join(ans))

Fixed submission:
n = int(input())
A = [int(i) for i in input().split()]

pre = {}
for i in range(0, len(A)):
  pre[A[i]]  = i+1

tmp = sorted(pre.items())

ans = []
for tp in tmp:
  ans.append(str(tp[1]))
print(' '.join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
v = input().split()
c = input().split()

answer = 0
for i in range(1 << n):
  tmp = 0
  for j in range(n):
    if i & (1 << j):
      tmp += int(v[j]) - int(c[j])
  if answer < tmp:
    answer = tmp

print(answer)


Fixed submission:
n = int(input())
v = input().split()
c = input().split()

vc = []
for i in range(n):
  vc.append(int(v[i]) - int(c[i]))

answer = 0
for i in vc:
  if i > 0:
    answer += i

print(answer)
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
import functools

N = int(input())
A = [int(i) for i in input().split()]

answer = 0
for i in range(N):
  tmp = A[:]
  tmp.pop(i)
  m = functools.reduce(fractions.gcd, tmp)
  if answer < m:
    answer = m
print(answer)

Fixed submission:
import fractions as math

n = int(input()) # 入力データの個数
a = list(map(int, input().split())) # 入力データ
 
l = [a[0] for _ in range(n+2)] # データの左端を初期値として追加
r = [a[-1] for _ in range(n+2)] # データの右端を初期値として追加
 
for i in range(n): # データのどこを置き換えるか
    l[i+1] = math.gcd(l[i], a[i]) # 置きかえる部分より左の最大公約数と置きかえる部分の最大公約数を更新する
    r[-(i+2)] = math.gcd(r[-(i+1)], a[-(i+1)]) # 置きかえる部分より右の最大公約数と置きかえる+1の最大公約数を更新する 
l[0] = r[0] = l[-1] = r[-1] = 0 # 初期値形に0を入れていく
 
ans = [math.gcd(l[i], r[i+2]) for i in range(n)] # 最大公約数のセットを改めて配列へ
print(max(ans)) # 最大公約数を出力

Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = input().split()

max_gcd = 0
for i in range(N-1):
  for j in range(i+1, N):
    tmp = math.gcd(int(A[i]), int(A[j]))
    if max_gcd < tmp:
      max_gcd = tmp

print(max_gcd)

Fixed submission:
import fractions as math

n = int(input()) # 入力データの個数
a = list(map(int, input().split())) # 入力データ
 
l = [a[0] for _ in range(n+2)] # データの左端を初期値として追加
r = [a[-1] for _ in range(n+2)] # データの右端を初期値として追加
 
for i in range(n): # データのどこを置き換えるか
    l[i+1] = math.gcd(l[i], a[i]) # 置きかえる部分より左の最大公約数と置きかえる部分の最大公約数を更新する
    r[-(i+2)] = math.gcd(r[-(i+1)], a[-(i+1)]) # 置きかえる部分より右の最大公約数と置きかえる+1の最大公約数を更新する 
l[0] = r[0] = l[-1] = r[-1] = 0 # 初期値形に0を入れていく
 
ans = [math.gcd(l[i], r[i+2]) for i in range(n)] # 最大公約数のセットを改めて配列へ
print(max(ans)) # 最大公約数を出力
Buggy python submission (verdict: Time Limit Exceeded):
k, s = [int(i) for i in input().split()]
answer = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x+y+z==s:
        answer += 1
        break

print(answer)

Fixed submission:
k, s = [int(i) for i in input().split()]

ans = 0
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if z>=0 and z<=k:
      ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

a = stdin.readline().rstrip()
print(a.upper())
print(output)

Fixed submission:
s = input()
n = 0
ans = 0
for n in range( 1 << len(s) -1):
    p = 0
    for i in range(len(s) - 1):
        if n & (1 << i):
            ans += int(s[p:i + 1])
            p = i + 1
    if p < len(s):
        ans += int(s[p:])
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(n)
a = input().split()
b = input().split()
c = input().split()
a = [int(i) for i in a]
b = [int(i) for i in b]
c = [int(i) for i in c]

d = 0
for i in b:
  d += i

for i in range(n):
  if i + 1 < n:
    if a[i] +1  == a[i+1]:
      d += c[i-1]
  
print(d)

Fixed submission:
n = input()
n = int(n)
a = input().split()
b = input().split()
c = input().split()
a = [int(i) for i in a]
b = [int(i) for i in b]
c = [int(i) for i in c]

d = 0
for i in b:
  d += i

for i in range(n):
  if i + 1 < n:
    if a[i] +1  == a[i+1]:
      p = a[i]-1
      d += c[p]
  
print(d)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=[int(input()) for i in range(N)]
index1=L.index(max(L))
index2=L.index(sorted(L)[-2])
for i in range(N-1):
	if i==index1:
		print(sorted(L)[-2])
	print(max(L))

Fixed submission:
N=int(input())
L=[int(input()) for i in range(N)]
tl=sorted(L)
index1=L.index(tl[-1])
index2=L.index(tl[-2])
for i in range(N):
	if i==index1:
		print(L[index2])
	else:
		print(L[index1])
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
A,B,C,D=map(int,input().split())
# L=[0]*(B-A)
L=set()
t1=B
while True:
	if t1%C==0:
		while t1>=A:
			L.add(t1)
			t1-=C
		break
	else:
		t1-=1

t2=B
while True:
	if t2%D==0:
		while t2>=A:
			L.add(t2)
			t2-=D
		break
	else:
		t2-=1
print(B-A+1-len(L))

Fixed submission:
from fractions import gcd
def lcm(x, y):
  return (x * y) // gcd(x, y)
def num(n1,n2,n3):
  return n1-(n1//n2)-(n1//n3)+(n1//lcm(n2,n3))
A,B,C,D=map(int,input().split())
print(num(B,C,D)-num(A-1,C,D))
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
A=[int(input()) for _ in range(M)]
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(50000)
N,M=map(int,input().split())
L=[int(input()) for _ in range(M)]
ans=0

def dfs(i):
	global ans
	if i==N:
		ans+=1
		return True
	if i>N:return False
	if i in L:return True
	if dfs(i+1)==False:return True
	if dfs(i+2)==False:return True

dfs(0)
print(ans%1000000007) 

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(50000)
N,M=map(int,input().split())
L=[int(input()) for _ in range(M)]
ans=0

def dfs(i):
	global ans
	if i==N:
		ans+=1
		return True
	if i>N:return False
	if i in L:return True
	if dfs(i+1)==False:return True
	if dfs(i+2)==False:return True

dfs(0)
print(ans%1000000007) 

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)
N,M=map(int,input().split())
L=[int(input()) for _ in range(M)]
ans=0

def dfs(i):
	global ans
	if i==N:
		ans+=1
		return True
	if i>N:return False
	if i in L:return True
	if dfs(i+1)==False:return True
	if dfs(i+2)==False:return True

dfs(0)
print(ans%1000000007) 

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=[int(input()) for _ in range(M)]
ans=0
dp=[]
def dfs(i):
	global ans
	if i==N:
		ans+=1
		# print(i)
		return True
	if i>N:return False
	if i in L:return True
	if dfs(i+1)==False:return True
	if dfs(i+2)==False:return True

dfs(0)
print(ans%1000000007) 

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=[int(input()) for _ in range(M)]
ans=0
def dfs(i):
	global ans
	if i==N:
		ans+=1
		# print(i)
		return True
	if i>N:return False
	if i in L:return False
	dfs(i+1)
	dfs(i+2)

dfs(0)
print(ans%1000000007) 

Fixed submission:
N,M=map(int,input().split())
A=set([int(input()) for _ in range(M)])
dp=[0]*(N+1)
dp[0]=1
for i in range(1,N+1):
	dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
	if i in A:
		dp[i]=0
print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
import collections
n,m=map(int,input().split())
l=[[]*i for i in range(m)]
a=set()
for i in range(m):
  s,e=map(int,input().split())
  for j in range(s,e+1):
    l[i].append(j)
for i in range(m):
  if i==0:
    a=set(l[i])
  else:
    a=a&set(l[i])
print(len(a))

Fixed submission:
n,m=map(int,input().split())
l,r=0,1000000
for i in range(m):
  a,b=map(int,input().split())
  l=max(l,a)
  r=min(r,b)
print(len(range(l,r+1)))
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
from copy import deepcopy
N=int(input())
l=list(map(int,input().split()))
dp=[]
for i in range(N):
	t=deepcopy(l)
	t.pop(i)
	dp.append(reduce(gcd,t))
print(max(dp))

Fixed submission:
from fractions import gcd
N=int(input())
L=list(map(int,input().split()))
l=[0]*(N+1)
r=[0]*(N+1)
ans=0
for i in range(N):
  l[i+1]=gcd(L[i],l[i])
  r[N-i-1]=gcd(L[N-i-1],r[N-i])
for i in range(N):
  ans=max(ans,gcd(l[i],r[i+1]))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
d=defaultdict(int)
N,M=map(int,input().split())
ans=0
t=M
for i in range(N):
	a,b=map(int,input().split())
	d[a]+=b
while t>0:
	for i in range(d[min(d)]):
		ans+=min(d)
		t-=1
		if t==0:break
	d.pop(min(d))
print(ans)

Fixed submission:
N,m=map(int,input().split())
L=sorted([list(map(int,input().split())) for _ in range(N)])
ans=0
for i in range(N):
	ans+=L[i][0]*min(m,L[i][1])
	m-=min(m,L[i][1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
d=defaultdict(int)
N,M=map(int,input().split())
ans=0
t=M
for i in range(N):
	a,b=map(int,input().split())
	d[a]+=b
while t>0:
	for i in range(d[min(d)]):
		ans+=min(d)
		t-=1
		if t==0:break
	d.pop(min(d))
print(ans)

Fixed submission:
N,m=map(int,input().split())
L=sorted([list(map(int,input().split())) for _ in range(N)])
ans=0
for i in range(N):
	ans+=L[i][0]*min(m,L[i][1])
	m-=min(m,L[i][1])
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
L=list(map(int,input().split()))
while len(L)>1:
	m=L.index(max(L))
	L[m]=max(L)-min(L)
	if L[m]<=0:
		L.pop(m)
print(L[0])

Fixed submission:
from functools import reduce
from fractions import gcd
input()
print(reduce(gcd,map(int,input().split())))
Buggy python submission (verdict: Runtime Error):
print(head + str(len(mid)) + tail)


Fixed submission:
s   = input()

head, mid, tail = s[0], s[1:-1], s[-1]

print(head + str(len(mid)) + tail)
Buggy python submission (verdict: Time Limit Exceeded):
int(input())
vals    = input()

vals    = vals.split()
#　数値変換
vals    = list(map(lambda v:int(v), vals))

def solve(remain, a):
    '''bは指定必須とする'''

    if len(remain) == 1:
        if (a*remain[0]) % 4 == 0:
            return True
        return False

    # len > 1の場合

    for i in range(len(remain)):
        if (a * remain[i]) % 4 == 0:
            res = solve(remain[0:i] + remain[i+1:], remain[i])
            if res == True:
                return True



for i in range(len(vals)):
    a   = vals[i]
    if solve(vals[0:i] + vals[i+1:], a) == True:
        print("Yes")
        break;
else:
    print("No")


Fixed submission:

input()
vals    = input()
vals    = vals.split()
vals    = list(map(lambda v:int(v), vals))


kisu    = 0
div4    = 0
div2    = 0

for e in (vals):
    if e % 4 == 0:
        div4    += 1
    elif e % 2 == 1:
        kisu    += 1
    else:
        div2    += 1

if div4 >= kisu:
    print("Yes")
elif div4 == kisu - 1 and len(vals) == div4 + kisu:
    print("Yes")
elif div2 == len(vals):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,k =  map(int,input().split())
h = list(map(int,input().split()))

count =	0
for ii in range(n):
    if h[ii] >=	k:
	count += 1

print(count)

Fixed submission:
n,k =  map(int,input().split())
h = list(map(int,input().split()))

count = 0
for ii in range(n):
    if h[ii] >= k:
        count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = tuple(map(int,input().split()))

for ii in range(n):
    print(a.index(ii+1)+1)



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

a_new = sorted(range(len(a)), key=lambda k: a[k])
for ii in range(n):
    print(a_new[ii]+1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

for ii in range(n):
    print(a.index(ii+1)+1)



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

a_new = sorted(range(len(a)), key=lambda k: a[k])
for ii in range(n):
    print(a_new[ii]+1)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
a_new = sorted(a)

order = [0] * n

for ii in range(n):
    order[ii] = a.index(a_new[ii])+1
    print(order[ii])



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

a_new = sorted(range(len(a)), key=lambda k: a[k])
for ii in range(n):
    print(a_new[ii]+1)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a =list( map(int,input().split()))

for ii in range(m):
    a[a.index(max(a))] = int(a[a.index(max(a))] / 2)

print(sum(a))


Fixed submission:
S=str(input())

if S ==	"Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
import fractions

a,b,c,d = map(int,input().split())
lcm = c * d // fractions.gcd(c , d) 

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

if a % lcm == 0:
        lcm_start = int(a/lcm)
else:
        lcm_start = int(a/lcm)+1

c_end = int(b/c)
d_end = int(b/d)
lcm_end = int(b/lcm)

c_num = c_end - c_start + 1
d_num = d_end - d_start + 1
lcm_num=lcm_end - lcm_start + 1

print(b - a + 1 - c_num - d_num + lcm_num)


Fixed submission:
s = list(str(input()))
ans = 0

for ii in range(len(s)-1):
    if s[ii] == s[ii+1]:
        ans = 1

if ans == 1:
    print("Bad")
else:
    print("Good")
Buggy python submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())

def calc(n):
    return n-n//c-n//d+n//(c*d//math.gcd(c, d))


print(calc(b)-calc(a-1))


Fixed submission:
import fractions

a,b,c,d = map(int,input().split())

def calc(n):
    return n-n//c-n//d+n//(c*d//fractions.gcd(c, d))

print(calc(b)-calc(a-1))

Buggy python submission (verdict: Runtime Error):
import math

a,b,c,d = map(int,input().split())
lcm = c * d / math.gcd(c , d) 

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

if a % lcm == 0:
        lcm_start = int(a/lcm)
else:
        lcm_start = int(a/lcm)+1

c_end = int(b/c)
d_end = int(b/d)
lcm_end = int(b/lcm)

c_num = c_end - c_start + 1
d_num = d_end - d_start + 1
lcm_num=lcm_end - lcm_start + 1

print(b - a + 1 - c_num - d_num + lcm_num)


Fixed submission:
import fractions

a,b,c,d = map(int,input().split())

def calc(n):
    return n-n//c-n//d+n//(c*d//fractions.gcd(c, d))

print(calc(b)-calc(a-1))

Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
count = 0

if a % c == 0:
    c_start = int(a/c)
else:
    c_start = int(a/c)+1

if a % d == 0:
    d_start = int(a/d)
else:
    d_start = int(a/d)+1

c_end = int(b/c)
d_end = int(b/d)

c_list=[0]*(c_end-c_start+1)
d_list=[0]*(d_end-d_start+1)

for ii in range(len(c_list)):
    jj = c_start + ii
    c_list[ii] = jj * c

for ii in range(len(d_list)):
    jj = d_start + ii
    d_list[ii] = jj * d

union = set(c_list) | set(d_list)

print(b - a + 1 - len(union))


Fixed submission:
import fractions

a,b,c,d = map(int,input().split())

def calc(n):
    return n-n//c-n//d+n//(c*d//fractions.gcd(c, d))

print(calc(b)-calc(a-1))
Buggy python submission (verdict: Time Limit Exceeded):
# -- coding:utf-8 --
n,m = map(int,input().split())
lr = [list(map(int,input().split())) for ii in range(m)]
L = [lr[jj][0] for jj in range(m) ]
R = [lr[jj][1] for jj in range(m) ]

count = 0

for nn in range(1,n+1):
    check = [0]*m
    for kk in range(m):
        if nn >= L[kk] and nn <= R[kk]:
            check[kk] = 1
        if sum(check) == m:
            count += 1

print(count)


Fixed submission:
# -- coding:utf-8 --
n,m = map(int,input().split())
lr = [list(map(int,input().split())) for ii in range(m)]
L = [lr[jj][0] for jj in range(m) ]
R = [lr[jj][1] for jj in range(m) ]

if min(R)-max(L) < 0:
    print(0)
else:
    print(min(R)-max(L)+1)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

S=list(str(input()))
S1=int("".join(S[0:2]))
S2=int("".join(S[2:4]))

if S1 > 12  and 1 <= S2 <= 12 :    
    print("YYMM")
elif S2 > 12 and 1 <= S1 <= 12 :
    print("MMYY")
elif S1 == 0 and 1 <= S2 <= 12:
    print("YYMM")
elif S2 == 0 and 1 <= S1 <= 12:
    pirnt("MMYY")    
elif 1 <= S1 <= 12 and 1 <= S2 <= 12  :
    print("AMBIGUOUS")
else:
    print("NA")


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

S=list(str(input()))
S1=int("".join(S[0:2]))
S2=int("".join(S[2:4]))

if 1 <= S1 <= 12:
    s1="MM"
else:
    s1="YY"
    
if 1 <= S2 <= 12:
    s2="MM"
else:
    s2="YY"


if s1 != s2:
    print(s1+s2)
else:
    if s1 == "MM" and s2 == "MM":
        print("AMBIGUOUS")
    elif S1 == 0 and s2 =="MM":
        print("YYMM")
    elif s1 == "MM" and S1 == 0:
        print("MMYY")
    else:
        print("NA")
Buggy python submission (verdict: Runtime Error):
# -- coding: utf-8 --

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

count = []

for ii in range(1, 101):
    if a % ii == 0 and b % ii == 0:
        count.append(ii)

print(count[-k])


Fixed submission:
# -- coding: utf-8 --
a, b, c= map(int, input().split())

mon_lim = int(b/a)
if mon_lim < c:
    print(mon_lim)
else:
    print(c)
Buggy python submission (verdict: Runtime Error):
N=int(input())
L=list(map(int,input().split())
to=[]
for i in range(N):
  to.append([i,L[i]])
to=sorted(to, key=lambda x:x[1])
for i in range(N):
       print(total[i][0],end='')

Fixed submission:
N=int(input())
L=list(map(int,input().split()))
to=[]
for i in range(N):
  to.append([i,L[i]])
to=sorted(to, key=lambda x:x[1])
for i in range(N):
       print(to[i][0]+1,end=' ')
Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
ans=[]
L=[]
for _ in range(N):
    L.append(0)
for _ in range(Q):
  ans.append(int(input()))
for k in range(N):
  L[k]=ans.count(k+1)
for j in range(N):
  if K-(Q-L[j])>0:
    print('Yes')
  else:
    print('No')
            
 
  

Fixed submission:
N,K,Q=map(int,input().split())
ans=[]
L=[]
for _ in range(N):
    L.append(0)
for _ in range(Q):
  ans.append(int(input()))
for k in range(Q):
  L[ans.pop()-1]+=1
for j in range(N):
  if K-(Q-L[j])>0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
first=list(map(int,input().split()))
first.sort()
for l in range(M):
  first[N-1]=(first[N-1])/2
  if first[N-2]>first[N-1]:
    i=0
    while i<=N-2:
        if first[i]>=first[N-1]:
            first.insert(i,first.pop())
            break
        else:
            i+=1
          

second=[]
for _ in range(N):
  second.append(0)
for i in range(N):
  second[i]=int(first[i])
print(sum(second))

Fixed submission:
import heapq
N,M=map(int,input().split())
kakaku=list(map(int,input().split()))
han=[]
for i in range(N):
  han.append(-kakaku[i])
  
heapq.heapify(han)
for _ in range(M):
  k=heapq.heappop(han)
  k=k/2
  heapq.heappush(han,k)

sum=0
for j in range(N):
  sum+=int(-han[j])
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
first=list(map(int,input().split()))
for l in range(M):
  first.sort()
  first[N-1]=(first[N-1])/2

second=[]
for _ in range(N):
  second.append(0)
for i in range(N):
  second[i]=int(first[i])
print(sum(second))

Fixed submission:
import heapq
N,M=map(int,input().split())
kakaku=list(map(int,input().split()))
han=[]
for i in range(N):
  han.append(-kakaku[i])
  
heapq.heapify(han)
for _ in range(M):
  k=heapq.heappop(han)
  k=k/2
  heapq.heappush(han,k)

sum=0
for j in range(N):
  sum+=int(-han[j])
print(sum)
Buggy python submission (verdict: Runtime Error):
a,b,c=int(input())
if a-b>=c:
  print(0)
else:
  print(c-(a-b))

Fixed submission:
a,b,c=map(int,input().split())
if a-b>=c:
  print(0)
else:
  print(c-(a-b))
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==100000:
  print(90909)
elif 10000<=n<=99999:
  print((n-10000)+910)
elif 1000<=n<=9999:
  print(909)
elif 100<=n<=999:
  print(n-100)+10
elif 10<=n<=99:
  print(9)
elif 1<=n<=9:
  print(n)


Fixed submission:
n=int(input())
if n==100000:
  print(90909)
elif 10000<=n<=99999:
  print((n-10000)+910)
elif 1000<=n<=9999:
  print(909)
elif 100<=n<=999:
  print((n-100)+10)
elif 10<=n<=99:
  print(9)
elif 1<=n<=9:
  print(n)
Buggy python submission (verdict: Runtime Error):
x,a=int(input())
if x<a:
  print(0)
else:
  print(10)

Fixed submission:
x,a=map(int,input().split())
if x<a:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=0
high=0
for i in range(n+1):
  if high>x:
    break
  else:
    count+=1
    if i<n+1:
        high+=L[i]

print(count)

Fixed submission:
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=1
high=0
for i in range(n):
    high+=L[i]
    if high<=x:
        count+=1


print(count)

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=0
high=0
for i in range(n+1):
  if high>x:
    break
  else:
    count+=1
    high+=L[i]
print(count)
    

Fixed submission:
n,x=map(int,input().split())
L=list(map(int,input().split()))
count=1
high=0
for i in range(n):
    high+=L[i]
    if high<=x:
        count+=1


print(count)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
ab = int(b / a)
if a < c < b or b < c < a:
    print('Yes')
else:
    print('No')


Fixed submission:
# -*- coding: utf-8 -*-
a, b, c = map(int, input().split())
if a < c < b or b < c < a:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w)


Fixed submission:
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
h, w = map(int, input().split())
print((H-h)*(W-w))