Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#coding utf-8
import math
N,M=map(int,input().split())

def soinsu(m):
  fact =[]
  i = 2
  while i*i<=m:
    if m%i==0:
      fact.append(i)
      m //=i
    else:
      i +=1
  if m>1:
    fact.append(m)
  return fact

fact=soinsu(M)
counting=[]
for i in fact:
  counting.append(fact.count(i))
  del fact[:fact.count(i)-1]
  if fact==[]:
    break

def permi(n,r):
  return math.factorial(n)//math.factorial(n-r)
def combi(n,r):
  return permi(n,r)//math.factorial(r)

ans = 1
for i in counting:
  ans *=combi(i+N-1,N-1)

print(ans%(10**9+7))

Fixed submission:
#coding utf-8
import math
from operator import mul
from functools import reduce
N,M=map(int,input().split())

def soinsu(m):
  fact =[]
  i = 2
  while i*i<=m:
    if m%i==0:
      fact.append(i)
      m //=i
    else:
      i +=1
  if m>1:
    fact.append(m)
  return fact

fact=soinsu(M)
counting=[]
for i in fact:
  counting.append(fact.count(i))
  del fact[:fact.count(i)-1]
  if fact==[]:
    break

def combi(n,r):
  r =min(r,n-r)
  if r==0:
    return 1
  over = reduce(mul, range(n, n - r, -1))
  under = reduce(mul, range(1, r + 1))
  return over // under

ans = 1
for i in counting:
  ans *=combi(i+N-1,N-1)

print(ans%(10**9+7))
Buggy python submission (verdict: Runtime Error):
#coding utf-8
from collections import deque
H,W=map(int,input().split())

s = [list(input().strip()) for _ in range(H)]
d = [[ 0 for i in range(W)] for j in range(H)]
q = deque([])
q.append([0,0,0])
y,x,z=q.popleft()

H = H-1
W = W-1

while y!=H or x!=W:
  if s[y][x]=="." and d[y][x]==0:
    if y<H:
      q.append([y+1,x,z+1])
    if x<W:
      q.append([y,x+1,z+1])
    if y>0:
      q.append([y-1,x,z+1])
    if x>0:
      q.append([y,x-1,z+1])
    d[y][x]=1  
  y,x,z=q.popleft()

ans1=0
for i in range(H+1):
  for j in range(W+1):
    if s[i][j]=="#":
      ans1 +=1
      
ans = (H+1)*(W+1)-ans1-z-1
print(ans)

  


Fixed submission:
#coding utf-8
from collections import deque
H,W=map(int,input().split())

s = [list(input().strip()) for _ in range(H)]
d = [[ 0 for i in range(W)] for j in range(H)]
q = deque([])
q.append([0,0,0])
y,x,z=q.popleft()

H = H-1
W = W-1
ans2=0
while y!=H or x!=W:
  if s[y][x]=="." and d[y][x]==0:
    if y<H:
      q.append([y+1,x,z+1])
    if x<W:
      q.append([y,x+1,z+1])
    if y>0:
      q.append([y-1,x,z+1])
    if x>0:
      q.append([y,x-1,z+1])
    d[y][x]=1
  if q==deque([]):
    ans2 = -1
    break
  y,x,z=q.popleft()
  

ans1=0
for i in range(H+1):
  for j in range(W+1):
    if s[i][j]=="#":
      ans1 +=1
      
ans = (H+1)*(W+1)-ans1-z-1
if ans2==-1:
  print(ans2)
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
input_lines=input().split()
K = int(input_lines[0])
S = int(input_lines[1])
M=0
for i in range(K+1):
  for j in range(i,K+1):
    for k in range(j,K+1):
      if i+j+k==S:
        if i==j==k:
          M+=1
        elif i==j or j==k:
          M+=3
        else:
          M+=6
print(M)

Fixed submission:
# coding: utf-8
input_lines=input().split()
K = int(input_lines[0])
S = int(input_lines[1])
M=0
for i in range(K+1):
  for j in range(i,K+1):
    k =S-i-j
    if i<=j<=k<=K:
      if i==j==k:
        M+=1
      elif i==j or j==k:
        M+=3
      else:
        M+=6
print(M)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = str(input())

s1 = S[:K-1]
smid = S[K-1:K].lower()
s1 = S[K:]

print(s0 + smid + s1)

Fixed submission:
N, K = map(int, input().split())
S = str(input())

s0 = S[:K-1]
smid = S[K-1:K].lower()
s1 = S[K:]

print(s0 + smid + s1)
Buggy python submission (verdict: Runtime Error):
import math

n, k = map(int, input().split())

l = []
for i in range(n):
    if i <= k:
        m = math.ceil(math.log2(k/(i+1)))
        l.append(1/2**m)
    else:
        l.append(1)

print(1/n*sum(l))print(1/n*sum(l))

Fixed submission:
import math

n, k = map(int, input().split())

l = []
for i in range(n):
    if i <= k:
        m = math.ceil(math.log2(k/(i+1)))
        l.append(1/2**m)
    else:
        l.append(1)

print(1/n*sum(l))
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))

for i in range(len(n)):
  if n[i] == 1:
    n[i] = 1
  elif n[i] == 7:
    n[i] = 10
  elif n[i] == 9:
    n[i] = 100
  elif n[i] == 4:
    n[i] = 1000
    
if sum(n) == 1111:
  print("YES")
else:
  print("NO")
"""

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

for i in range(len(n)):
  if n[i] == 1:
    n[i] = 1
  elif n[i] == 7:
    n[i] = 10
  elif n[i] == 9:
    n[i] = 100
  elif n[i] == 4:
    n[i] = 1000
    
if sum(n) == 1111:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))

for i in range(len(n)):
  if n[i] == 1:
    n[i] = 1
  elif n[i] == 7:
    n[i] = 10
  elif n[i] == 9:
    n[i] = 100
  elif n[i] == 4:
    n[i] = 1000
    
if sum(n) == 1111:
  print("YES")
else:
  print("NO")


S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[len(x)-1])
  else:
    x.append(0)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[len(y)-1])
  else:
    x.append(0)

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Fixed submission:
S = list(input())
s1 = list("keyence")

x = []
y = []
for i in range(7):
  if S[i] == s1[i]:
    x.append(1)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(1)
  

if sum(x) + sum(y) >= 7:
  print("YES")  
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[i])
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[i])
  

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Fixed submission:
S = list(input())
s1 = list("keyence")

x = []
y = []
for i in range(7):
  if S[i] == s1[i]:
    x.append(1)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(1)
  

if sum(x) + sum(y) >= 7:
  print("YES")  
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
S = list(input())
s1 = list("keyence")

x = [1]
y = [1]
for i in range(7):
  if S[i] == s1[i]:
    x.append(x[i-1])
  if S[len(S)-1-i] == s1[6-i]:
    y.append(y[i-1])
  

if sum(x) + sum(y) >= 9:
  print("YES")  
else:
  print("NO")

Fixed submission:
S = list(input())
s1 = list("keyence")

x = []
y = []
for i in range(7):
  if S[i] == s1[i]:
    x.append(1)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(1)
  

if sum(x) + sum(y) >= 7:
  print("YES")  
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
S = list(input())
s1 = list("keyence")

x = 0
y = 0
z = 0
for i in range(len(S)):
  if S[i] == s1[x]:
    x += 1
    z = 0
  elif z != 0:
    y += 1
    z = 1


if y <= 1 and x != 0:
  print("YES")  
else:
  print("NO")

Fixed submission:
S = list(input())
s1 = list("keyence")

x = []
y = []
for i in range(7):
  if S[i] == s1[i]:
    x.append(1)
  if S[len(S)-1-i] == s1[6-i]:
    y.append(1)
  

if sum(x) + sum(y) >= 7:
  print("YES")  
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N, P = map(int, input().split())
b=0
a = int(pow(P, 1/N))
for i in range(1, a+1):
  if P % pow(a+1-i,N) == 0:
     b = a+1-i
     break
print(b)

Fixed submission:
N = str(input())
count = 0

for i in N:
  if i=="2":
     count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
x = input().rstrip().split("")
count = 0
temp = ""
how = True
for i in x:
  if temp == i:
    how=False
  temp = i

if how:
  print("Good")
else:
  print("Bad")
  

Fixed submission:
x = input().rstrip()
count = 0
temp = ""
how = True
for i in x:
  if temp == i:
    how=False
  temp = i

if how:
  print("Good")
else:
  print("Bad")
Buggy python submission (verdict: Runtime Error):
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
    return x1[0]

y = makey(x1,x2)
print(y+1)


Fixed submission:
y = list(map(int,input().rstrip().split(" ")))
X,A = y[0],y[1]
if X < A:
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
    return i
y = makey(x1,x2)
print(y+1)


Fixed submission:
y = list(map(int,input().rstrip().split(" ")))
X,A = y[0],y[1]
if X < A:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
y = makey(x1,x2)
print(y+1)

Fixed submission:
x1 = list(map(int,input().rstrip().split(" ")))
x2 = list(map(int,input().rstrip().split(" ")))

def makey(x1,x2):
  total = 0
  for i in range(x1[0]):
    total += x2[i]
    if total > x1[1]:
      return i
  return i+1
y = makey(x1,x2)
print(y+1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

ans = 0
for i in range(2, N+1):
    for j in range(N-i+1):
        tmp = sorted(set(P[j:j+i]), reverse=True)[1]
        ans += tmp
print(ans)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))
 
index_lst = [0] * N
for index, i in enumerate(P):
    index_lst[i - 1] = index
 
left_next_Index = list(range(-1, N - 1)) + [-1, -1]
right_next_Index = list(range(1, N + 1)) + [N, N]
ans = 0
for i in range(1, N):
    index = index_lst[i - 1]
    # print (i, index)
    l1 = left_next_Index[index]
    l2 = left_next_Index[l1]
    r1 = right_next_Index[index]
    r2 = right_next_Index[r1]
    # print ('l1 =', l1, ' l2 =', l2, ' r1 =', r1, ' r2 =', r2)
    ans += i * ((index - l1) * (r2 - r1) + (r1 - index) * (l1 -l2))
 
    left_next_Index[r1] = l1
    right_next_Index[l1] = r1
 
print (ans)
Buggy python submission (verdict: Runtime Error):
import math

N,K = map(int, input().split())

ans1 = N - K + 1
ans2 = ans1 * (ans1 - 1)
ans3 = 1

# combination(N,K)を求める
for i in range(K):
    ans3 *= (N - i)

ans3 = int(ans3 / math.factorial(K) - ans1 - ans2 )

print(ans1 % (10**9 + 7))
print(ans2 % (10**9 + 7))
print(ans3 % (10**9 + 7))

Fixed submission:
from scipy.misc import comb

N,K = map(int, input().split())

red_ball_count = N - K

for i in range(1, K + 1):
    if red_ball_count + 1 - i < 0:
        print(0)
    else:
        print(comb(red_ball_count + 1, i, exact=True) * comb(K - 1, i - 1, exact=True) % (10**9 + 7))

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

ans1 = N - K + 1
ans2 = ans1 * (ans1 - 1)
ans3 = 1

# combination(N,K)を求める
for i in range(K):
    ans3 *= (N - i)

ans3 = int(ans3 / 6 - ans1 - ans2 )

print(ans1 % (10**9 + 7))
print(ans2 % (10**9 + 7))
print(ans3 % (10**9 + 7))

Fixed submission:
from scipy.misc import comb

N,K = map(int, input().split())

red_ball_count = N - K

for i in range(1, K + 1):
    if red_ball_count + 1 - i < 0:
        print(0)
    else:
        print(comb(red_ball_count + 1, i, exact=True) * comb(K - 1, i - 1, exact=True) % (10**9 + 7))
Buggy python submission (verdict: Time Limit Exceeded):
tmp = input().split()
N = int(tmp[0])
M = int(tmp[1])

cardlist = []
for i in range(M):
  cardlist.append(list(map(int, input().split())))

count = 0
for i in range(1, N+1):
  flag = True
  for j in range(M):
    if (cardlist[j][0] > i or cardlist[j][1] < i):
      flag = False
      break
  
  if (flag):
    count += 1

print(count)

Fixed submission:
tmp = input().split()
N = int(tmp[0])
M = int(tmp[1])

max = N
min = 0
for i in range(M):
  inputcard = list(map(int, input().split()))
  if min < inputcard[0]:
    min = inputcard[0]
  
  if max > inputcard[1]:
    max = inputcard[1]
  
if (max - min + 1 < 0):
  print(0)
else:
  print(max - min + 1)
Buggy python submission (verdict: Time Limit Exceeded):
# 入力
N = input()

A1 = input()

total = float('INF')
for i in range(int(N)):
    tmpW = A1[:i].count('W')
    tmpE = A1[i+1:].count('E')
    tmp = tmpW + tmpE
    if(total > tmp):
        total = tmp
print(total)

Fixed submission:
# 入力
N = input()

A1 = [ n=='E' for n in input()]


minimum = sum(A1[1:])
count = minimum

for i in range(1,int(N)):
    if(not A1[i-1]):
        count += 1
    if(A1[i]):
        count -= 1
    if(count<minimum):
        minimum = count
print(minimum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

def get_ans(a):
    mods = list()
    
    if 2 not in a:
        print(-1)
        return True
    
    count = 0
    mod = 1
    while(True):
        mod = a[mod-1]
        count += 1
        if (mod == 2):
            print(count)
            return True
        elif mod in mods:
            print(-1)
            return True
        else:
            mods.append(mod)

ret = get_ans(a)

Fixed submission:
N = int(input())
a = []
for i in range(N):
    a.append(int(input())-1)
index = 0
#indexが1になったら（２ボタンを押したら）おしまい
flag = False 
count = 0
for i in range(N):
    count+=1
    index=a[index]
    if(index == 1):
        flag = True
        break
if(flag):
    print(count)
else:
    print(-1)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

mods = list()
count = 0
mod = 1
while(True):
    mod = a[mod-1]
    count += 1
    if (mod == 2):
        print(count)
        break
    elif mod in mods:
        print(-1)
        break
    else:
        mods.append(mod)
    

Fixed submission:
N = int(input())
a = []
for i in range(N):
    a.append(int(input())-1)
index = 0
#indexが1になったら（２ボタンを押したら）おしまい
flag = False 
count = 0
for i in range(N):
    count+=1
    index=a[index]
    if(index == 1):
        flag = True
        break
if(flag):
    print(count)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int, input().split())

#for i in range(1, 101):
mods = list()
while(True):
    #print("A * i = " + str(A * i) + ", mod = " + str((A * i) % B))
    mod = (A * i) % B
    if (mod == C):
        print("Yes")
        break
    elif(mod in mods):
        print("No")
        break
    else:
        mods.append(mod)

Fixed submission:
A,B,C = map(int, input().split())

#for i in range(1, 101):
mods = list()
i = 1
while(True):
    #print("A * i = " + str(A * i) + ", mod = " + str((A * i) % B))
    mod = (A * i) % B
    if (mod == C):
        print("YES")
        break
    elif(mod in mods):
        print("NO")
        break
    else:
        mods.append(mod)
    i += 1
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
power = 1

for i in range(1,N+1):
    power *= i

print(power % (10**9 + 7) )

Fixed submission:
N = int(input())
power = 1

for i in range(1,N+1):
    power *= i 
    power %= (10**9 + 7)

print(power)
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())

same_all = 0
same_two = 0
same_none = 0
K += 1

for i in range(1, K):
    if(i == S):
        same_two += 1
        
    for j in range(i,K):
        if (i + j == S):
            if (i == j):
                same_two += 1
            else:
                same_none += 1
            
        for k in range(j,K):
            if (i + j + k == S):
                if (i == j) and (j == k):
                    same_all += 1
                elif (i == j) or (j == k) or (i == k):
                    same_two += 1
                else:
                    same_none += 1                 

print(same_all + same_two*3 + same_none*6)

Fixed submission:
K,S = map(int,input().split())

same_all = 0
same_two = 0
same_none = 0

for i in range(K, -1, -1):
    for j in range(S - i, -1, -1):
        if ( K<j or i<j):
            continue
        k = S-i-j
#         print(i,j,k)
        if (k <= K and k<=j):
            if(i == j and j == k):
                same_all += 1
            elif(i == j or i == k or k == j):
                same_two += 1
            else:
                same_none += 1


print(same_all + same_two*3 + same_none*6)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

nq = input().split()
s = input()
td = []
for i in range(int(nq[1])):
    td.append(input().split())

g_list = [1] * int(nq[0])

for i in range(0, int(nq[1])):
    for j in range(0, int(nq[0])):
        if td[i][0] == s[j]:
            if td[i][1] == 'R':
                if j != int(nq[0]) -1:
                    g_list[j+1] += g_list[j]
                g_list[j] = 0
            else:
                if j != 0:
                    g_list[j-1] += g_list[j]
                g_list[j] = 0
#    print(g_list)

print(sum(g_list))

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

a = input().split()

if a[0] == a[1] and a[1] == a[2]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S = list(S)
cnt  = 0

while True:
    i = 0
    _cnt = 0
    while i<len(S)-1:
        if S[i] == 'B' and S[i+1] == 'W':
            S[i] = 'W'
            S[i+1] = 'B'
            _cnt += 1
            i += 1
        else:
            i += 1
    cnt += _cnt
    if _cnt == 0:
        break

print(cnt)


Fixed submission:
S = input()
cnt  = 0
nb = 0
for i in range(len(S)):
    if S[i] == 'B':
        nb += 1
    else:
        cnt += nb
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
S = list(S)
cnt  = 0

while True:
    i = 0
    _cnt = 0
    while i<len(S)-1:
        if S[i] == 'B' and S[i+1] == 'W':
            S[i] = 'W'
            S[i+1] = 'B'
            _cnt += 1
            i += 2
        else:
            i += 1
    cnt += _cnt
    if _cnt == 0:
        break

print(cnt)


Fixed submission:
S = input()
cnt  = 0
nb = 0
for i in range(len(S)):
    if S[i] == 'B':
        nb += 1
    else:
        cnt += nb
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math


N, M = map(int, input().split())
S = input()
T = input()

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
    
L = int(M*N/gcd(N, M))
X = 'A'*int(L)

for i, s in enumerate(S):
    j = int(L/N*i)
    if X[j] == 'A':
        X = X[:j]+s+X[j+1:]
    elif X[j] == s:
        continue
    else:
        print(-1)
        exit(0)

        
for i, t in enumerate(T):
    j = int(L/M*i)
    if X[j] == 'A':
        X = X[:j]+t+X[j+1:]        
    elif X[j] == t:
        continue
    else:
        print(-1)
        exit(0)

print(L)

        


Fixed submission:
import math


N, M = map(int, input().split())
S = input()
T = input()

if N>M:
    N,M = M,N
    S,T = T,S
    
def gcd(a, b):
    while b:
	    a, b = b, a % b
    return a
    
L = int(M*N/gcd(N, M))

for i in range(N):
    if (M*i)%N == 0:
        j = int((M*i)/N)
        if S[i] != T[j]:
            print(-1)
            exit(0)

print(L)

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

N, M = map(int, input().split())
S = input()
T = input()

L = int(M*N/math.gcd(N, M))
X = 'A'*int(L)

for i, s in enumerate(S):
    j = int(L/N*i)
    if X[j] == 'A':
        X = X[:j]+s+X[j+1:]
    elif X[j] == s:
        continue
    else:
        print(-1)
        exit(0)

        
for i, t in enumerate(T):
    j = int(L/M*i)
    if X[j] == 'A':
        X = X[:j]+t+X[j+1:]        
    elif X[j] == t:
        continue
    else:
        print(-1)
        exit(0)

print(L)

        


Fixed submission:
import math


N, M = map(int, input().split())
S = input()
T = input()

if N>M:
    N,M = M,N
    S,T = T,S
    
def gcd(a, b):
    while b:
	    a, b = b, a % b
    return a
    
L = int(M*N/gcd(N, M))

for i in range(N):
    if (M*i)%N == 0:
        j = int((M*i)/N)
        if S[i] != T[j]:
            print(-1)
            exit(0)

print(L)
Buggy python submission (verdict: Runtime Error):
N, x = input().split()
N = int(N)
x = int(x)
al = [int(a) for a in input().split()]

al.sort()

used = 0
ans = 0
for a in enumerate(al:
    if used+a > x:
        break
    used += a
    ans += 1

print(ans)
    
        
        


Fixed submission:
N, x = input().split()
N = int(N)
x = int(x)
al = [int(a) for a in input().split()]

al.sort()

cum = [sum(al[:i+1])for i in range(len(al))]

ans = N-1
for i in range(len(al)):
    if cum[i] == x:
        ans = i+1
        break
    elif cum[i]>x:
        ans = i
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
print(a ** 3)

Fixed submission:
a = int(input())
print(a ** 3)
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)
    
    

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)

Buggy python submission (verdict: Runtime Error):
n=input()
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)
    
    

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)

Buggy python submission (verdict: Runtime Error):
n=input()
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[abs(t-x*0.006) for x in h]
print(h2.index(min(h2))+1)
    
    

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)

Buggy python submission (verdict: Runtime Error):
n=input()
t,a=map(int,input().split())
h=list(map(int,input()))
h2=[t-x*0.006 for x in h]
print(h2.index(min(h2))+1)
    
    

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h2=[abs(t-x*0.006-a) for x in h]
print(h2.index(min(h2))+1)
Buggy python submission (verdict: Runtime Error):
tp=input()
ttl=700
for i in tp:
  if i = "o":
    ttl+=100
print(ttl)

Fixed submission:
tp=input()
ttl=700
for i in tp:
  if i == "o":
    ttl+=100
print(ttl)
Buggy python submission (verdict: Runtime Error):
n=input()
a=input()
if n%500<a:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
a=int(input())
if  n%500<=a:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n=input()
a=input()
if n<500 and a>=n:
  print("Yes")
elif n>=500 and n%500<a:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
a=int(input())
if  n%500<=a:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s=list(input())
s2=''
for i in range(len(s)):
  if i%==0:
    s2+=s[i]
print(s2)

Fixed submission:
s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)

Buggy python submission (verdict: Runtime Error):
s=list(input())
s2=""
for i in range(len(s)):
  if i%==0:
    s2+=s[i]
print(s2)

Fixed submission:
s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)

Buggy python submission (verdict: Runtime Error):
s=list(input())
s2=""
for i in range(len(s)):
  if i%==2:
    s2+=s[i]
print(s2)

Fixed submission:
s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)

Buggy python submission (verdict: Runtime Error):
s=list(input())
s2=""
for i in range(len(s)):
  if i%==2:
    s2+=a[i]
print(s2)

Fixed submission:
s=list(input())
s2=''
for i in range(len(s)):
  if i%2==0:
    s2+=s[i]
print(s2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=0
for i in 100:
  if a<n:
    a=2^(i+1)
print(2^(i-1))

Fixed submission:
n=int(input())
a=0
for i in range(100):
  if a<=n:
    a=2**(i+1)
  else:
    print(2**(i-1))
    exit()