Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

def main():
    a, b = [int(_) for _ in input().split()]
    diff = b - a

    cur_tower = 1
    ts = []
    for add in range(2, 1000):
        next_tower = cur_tower + add
        ts.append((cur_tower, next_tower))

        cur_tower = next_tower

    for snow in range(1, 499951):
        if (a + snow, b + snow) in ts:
            print(snow)
            break

main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

def main():
    a, b = [int(_) for _ in input().split()]
    diff = b - a

    tower = 0
    ts = []
    for add in range(1, 1000):
        tower += add
        ts.append(tower)

    print(ts[diff-2] - a)

main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

def main():
    a, b = [int(_) for _ in input().split()]
    diff = b - a

    tower = 0
    ts = []
    for add in range(1, 1000):
        tower += add
        ts.append(tower)

    for snow in range(1, 499951):
        if a + snow in ts:
            if b + snow == ts[ts.index(a + snow) + 1]:
                print(snow)
                break

main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

def main():
    a, b = [int(_) for _ in input().split()]
    diff = b - a

    tower = 0
    ts = []
    for add in range(1, 1000):
        tower += add
        ts.append(tower)

    print(ts[diff-2] - a)

main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

def main():
    S = input()
    K = int(input())

    A = []
    for i in range(len(S)):
        for j in range(i+1, len(S)+1):
            A.append(S[i:j])

    print(sorted(list(set(A)))[K-1])

main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# --------------------------------------------

dp = None

def main():
    S = input()
    K = int(input())

    A = []
    for i in range(len(S)):
        for j in range(i+1, min(i+6, len(S)+1)):
            A.append(S[i:j])

    print(sorted(list(set(A)))[K-1])

main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output


def chkprint(*args):
    names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))

# Binary converter


def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]

# --------------------------------------------


dp = None


def main():
    N = int(input())
    X = li_input()

    sX = sorted(X)

    for x in X:
        if sX.index(x) < len(sX) // 2:
            print(sX[len(sX) // 2])
        else:
            print(sX[len(sX) // 2 - 1])


main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output


def chkprint(*args):
    names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))

# Binary converter


def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]

# --------------------------------------------


dp = None


def main():
    N = int(input())
    X = li_input()

    sX = sorted(X)
    med = sX[len(sX) // 2]
    med_min = sX[len(sX) // 2 - 1]

    for x in X:
        if x < med:
            print(med)
        else:
            print(med_min)


main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output


def chkprint(*args):
    names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))

# Binary converter


def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]

# --------------------------------------------


dp = None


def main():
    N = int(input())
    X = li_input()

    sX = sorted(X)

    for x in X:
        idx = sX.index(x)
        sX.pop(idx)
        print(sX[len(sX) // 2])
        sX.insert(idx, x)


main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output


def chkprint(*args):
    names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg), '???')+' = '+repr(arg) for arg in args))

# Binary converter


def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]

# --------------------------------------------


dp = None


def main():
    N = int(input())
    X = li_input()

    sX = sorted(X)
    med = sX[len(sX) // 2]
    med_min = sX[len(sX) // 2 - 1]

    for x in X:
        if x < med:
            print(med)
        else:
            print(med_min)


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

def main():
    N, H = map(int, input().split())

    cuts = []
    throws = []
    for i in range(N):
        tmp = [int(j) for j in input().split()]
        cuts.append(tmp[0])
        throws.append(tmp[1])

    max_cut = max(cuts)
    t1 = 0

    throws.sort(reverse=True)

    for throw in throws:
        if throw < max_cut:
            break
        H -= throw
        t1 += 1

    t2 = math.ceil(H / max_cut)

    print(t1 + t2)




main()


Fixed submission:
S = input()
S = S[:3] + "8" + S[4:]
print(S)
Buggy python submission (verdict: Time Limit Exceeded):

def main():
    N, Y = map(int, input().split())

    # 最低限必要な諭吉を計算
    if 5000 * N < Y:
        n_yukichi = 1
        while True:
            if n_yukichi * 10000 + (N - n_yukichi) * 5000 >= Y:
                yukichi_need = n_yukichi
                break
            n_yukichi += 1
    else:
        yukichi_need = 0

    # 1000円の開始枚数を計算
    noguchi_start = (Y % 5000) // 1000


    for yukichi in range(yukichi_need, N+1):
        for higuchi in range(N-yukichi+1):
            if yukichi + higuchi > N:
                continue

            for noguchi in range(noguchi_start, N-yukichi-higuchi+1, 5):
                if yukichi + higuchi + noguchi > N:
                    break

                if yukichi + higuchi + noguchi < N:
                    continue

                if yukichi*10000 + higuchi*5000 + noguchi*1000 == Y:
                    print(yukichi, higuchi, noguchi)
                    return

    print(-1, -1, -1)
    return

main()


Fixed submission:

def main():
    N, Y = map(int, input().split())

    # 最低限必要な諭吉を計算
    if 5000 * N < Y:
        n_yukichi = 1
        while True:
            if n_yukichi * 10000 + (N - n_yukichi) * 5000 >= Y:
                yukichi_need = n_yukichi
                break
            n_yukichi += 1
    else:
        yukichi_need = 0

    # 1000円の開始枚数を計算
    noguchi_start = (Y % 5000) // 1000

    for yukichi in range(yukichi_need, N+1):
        for higuchi in range(N+1):
            if yukichi + higuchi > N:
                break

            noguchi = N - yukichi - higuchi

            if yukichi + higuchi + noguchi == N:
                if yukichi*10000 + higuchi*5000 + noguchi*1000 == Y:
                    print(yukichi, higuchi, noguchi)
                    return

    print(-1, -1, -1)
    return

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

    cuts = []
    throws = []
    for i in range(N):
        tmp = [int(j) for j in input().split()]
        cuts.append(tmp[0])
        throws.append(tmp[1])

    max_cut = max(cuts)

    # 切るだけでおｋ
    if max_cut >= max(throws):
        n_cut = H // sum(max_cut)
        if H % max_cut != 0:
            n_cut += 1
        print(n_cut)

    else:
        throws_new = list(filter((lambda x: x > max_cut), throws))
        n_throw = len(throws_new)

        # 必要な切る回数を計算
        n_cut = (H - sum(throws_new)) // max_cut

        if (H - sum(throws_new)) % max_cut != 0:
            n_cut += 1

        print(n_throw + n_cut)


main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


# --------------------------------------------

dp = None


def main():
    N, H = li_input()
    S = [li_input() for _ in range(N)]

    ans = 0
    strong_throw = []

    maxcut = -1
    for s in S:
        if s[0] > maxcut:
            maxcut = s[0]

    for s in S:
        if s[1] > maxcut:
            strong_throw.append(s[1])

    strong_throw.sort(reverse=True)

    for st in strong_throw:
        H -= st
        ans += 1

        if H <= 0:
            break

    if H > 0:
        ans += math.ceil(H / maxcut)

    print(ans)


main()
Buggy python submission (verdict: Runtime Error):
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


# --------------------------------------------

dp = None


def main():
    X, t = li_input()

    print(max(X - t), 0)


main()


Fixed submission:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


# --------------------------------------------

dp = None


def main():
    X, t = li_input()

    print(max(X - t, 0))


main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [input() for i in range(2)]
a = ""
for i in s:
    a = a + i
print(a)

Fixed submission:
n = int(input())
s = input().split(" ")
b = list(s[0])
c = list(s[1])
a = ""
for i in range(n):
    a = a + b[i] + c[i]
print(a)
Buggy python submission (verdict: Runtime Error):
a=input()
b=(a+1)/2*a
if a%2==0:
  print(0.5)
else:
  print(b)


Fixed submission:
a=int(input())
b=(a+1)/(2*a)
if a%2==0:
  print(0.5)
else:
  print(b)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=(a+1)/2*a
if a%2=1:
  print(0.5)
else:
  print(b)

Fixed submission:
a=int(input())
b=(a+1)/(2*a)
if a%2==0:
  print(0.5)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
a=list(map(input().split()))
b=list(map(input().split()))
if a[0]==b[0]:
  A=1
else:
  A=0
if a[1]==b[1]:
  B=1
else:
  B=0
if a[2]==b[2]:
  C=1
else:
  C=0
print(A+B+C)


Fixed submission:
a=input()
b=input()
if a[0]==b[0]:
  A=1
else:
  A=0
if a[1]==b[1]:
  B=1
else:
  B=0
if a[2]==b[2]:
  C=1
else:
  C=0
print(A+B+C)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(input().split())
d,e,f=map(input().split())
if a==d:
  A=1
else:
  A=0
if b==e:
  B=1
else:
  B=0
if c==f:
  C=1
else:
  C=0
print(A+B+C)

Fixed submission:
a=input()
b=input()
if a[0]==b[0]:
  A=1
else:
  A=0
if a[1]==b[1]:
  B=1
else:
  B=0
if a[2]==b[2]:
  C=1
else:
  C=0
print(A+B+C)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if abs(a-c)==abs(b-c):
  print(c)
else:
  print('IMPOSSIBLE')


Fixed submission:
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().aplit())
if abs(a-c)==abs(b-c):
  print(c)
else:
  print('IMPOSSIBLE')

Fixed submission:
a,b=map(int,input().split())
if (a+b)%2==0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
a=input()
if a[0]=a[1] and a[2]=a[3]:
  print('Yes')
elif a[0]=a[2] and a[1]=a[3]:
  print('Yes')
elif a[0]=a[3] and a[1]=a[2]:
  print('Yes')  
else:
  print('No')

Fixed submission:
a=input()
if a[0]==a[1] and a[2]==a[3] and a[0]!=a[2]:
  print('Yes')
elif a[0]==a[2] and a[1]==a[3] and a[0]!=a[1]:
  print('Yes')
elif a[0]==a[3] and a[1]==a[2] and a[0]!=a[1]:
  print('Yes')  
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
s=input()
if s[k-1]==A:
  s=s[:k-1]+'a'+s[k:]
elif s[k-1]==B:
  s=s[:k-1]+'b'+s[k:]
else:
  s=s[:k-1]+'c'+s[k:]
print(s)

Fixed submission:
n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s=s[:k-1]+'a'+s[k:]
elif s[k-1]=='B':
  s=s[:k-1]+'b'+s[k:]
else:
  s=s[:k-1]+'c'+s[k:]
print(s)
Buggy python submission (verdict: Runtime Error):
a=list[int(input()) for i in range(5)]
b=int(input())
if a[4]-a[0]>b:
  print('Yay!')
else:
  print(':(')

Fixed submission:
a=[int(input()) for i in range(5)]
b=int(input())
if a[4]-a[0]<=b:
  print('Yay!')
else:
  print(':(')
Buggy python submission (verdict: Runtime Error):
a,b=map((int,input()).split())
c,d=map((int,input()).split())
print(a*b-c*b-d*a)

Fixed submission:
a,b=map(int,input().split())
c,d=map(int,input().split())
print((a-c)*(b-d))
Buggy python submission (verdict: Runtime Error):
a=int(input())
if a=25:
  print('Christmas')
elif a=24:
  print('Christmas Eve')
elif a=23:
  print('Christmas Eve Eve')
elif a=22:
  print('Christmas Eve Eve Eve')

Fixed submission:
a=int(input())
if a==25:
  print('Christmas')
elif a==24:
  print('Christmas Eve')
elif a==23:
  print('Christmas Eve Eve')
elif a==22:
  print('Christmas Eve Eve Eve')

Buggy python submission (verdict: Runtime Error):
a=int(input())
if a=25:
  print('Christmas')
elif a=24:
  print('Christmas Eve')
elif a=23:
  print('Christmas Eve Eve')
elif a=22:
  print('Christmas Eve Eve Eve')



Fixed submission:
a=int(input())
if a==25:
  print('Christmas')
elif a==24:
  print('Christmas Eve')
elif a==23:
  print('Christmas Eve Eve')
elif a==22:
  print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
a=int(input())
if a==3 or a==5 or a==7:
  print(YES)
else:
  print(NO)

Fixed submission:
a=int(input())
if a==3 or a==5 or a==7:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print(max(a,b,c)*10 + sorted(nums)[-2] + min(a,b,c))

Fixed submission:
a,b,c=map(int,input().split())
print(a+b+c+max(a,b,c)*9)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('Yes')
else:
  print('No')


Fixed submission:
n=input()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n[0]=n[1]=n[2] or n[1]=n[2]=n[3]:
  print('Yes')
else:
  print('No')

Fixed submission:
n=input()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a=input()
b=input()
print(2*b-a)

Fixed submission:
a=int(input())
b=int(input())
print(2*b-a)
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if abs(x-a)>=abs(x-b)
  print('B')
else:
  print('A')


Fixed submission:
x,a,b=map(int,input().split())
if abs(x-a)>=abs(x-b):
  print('B')
else:
  print('A')

Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if |x-a|>=|x-b|:
  print('B')
else:
  print('A')

Fixed submission:
x,a,b=map(int,input().split())
if abs(x-a)>=abs(x-b):
  print('B')
else:
  print('A')
Buggy python submission (verdict: Runtime Error):
a,b=map(input().split())
if a=='H':
  print(b)
elif b=='H':
  print('D')
else:
  print('H')

Fixed submission:
a,b=map(str,input().split())
if a=='H':
  print(b)
elif b=='H':
  print('D')
else:
  print('H')
Buggy python submission (verdict: Runtime Error):
a=input()
print(800*a-200*(a//15))

Fixed submission:
a=int(input())
print(800*a-200*(a//15))
Buggy python submission (verdict: Runtime Error):
a=int,input()
if a<1200:
  print('ABC')
else:
  print('ARC')

Fixed submission:
a=int(input())
if a<1200:
  print('ABC')
else:
  print('ARC')
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
cnt=1

for i in range(N):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)

Fixed submission:
N=int(input())
S=str(input())
cnt=1

for i in range(len(S)-1):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
cnt=1

for i in range(len(S)):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)

Fixed submission:
N=int(input())
S=str(input())
cnt=1

for i in range(len(S)-1):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
cnt=1

for i in range(len(S)):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1

print(cnt)

Fixed submission:
N=int(input())
S=str(input())
cnt=1

for i in range(len(S)-1):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=str(input())
slime_cnt=0

for i in range(n-1):
  if s[i]==s[i+1]:
    slime_cnt=slime_cnt
  if s[i]!=s[i+1]:
    slime_cnt+=1
if s[-1]==s[-2]:
  print(slime_cnt)
else:
  print(slime_cnt+1)

Fixed submission:
N=int(input())
S=str(input())
cnt=1

for i in range(len(S)-1):
  if S[i]==S[i+1]:
    continue
  else:
    cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int,input().split()))

ans = 0

for i in h:
    if i >= k:
        ans += 1

print(ans)

Fixed submission:
n = int(input())
if n % 2 == 0:
  p = (n/2)/n
  print(p)
else:
  p = (n/2+0.5)/n
  print(p)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=map(int,input().split())
listA = []

for num in range(N):
  if num == (list(A))[i]:
    listA.append(num)


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

B=[[A[i],i] for i in range(N)]
B.sort()

for i in B:
  print((i[1]+1))
Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=list(input().split())
H=list(input().split())
L=list()

for i in range(H):
  Ave_temparature=abs(float(a)-(float(t)-float(H[i])*0.006))
  L.append(Ave_temparature)
  
print(min(L))


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

for i in range(0,len(H)):
  H[i]=abs(1000*a-t*1000+H[i]*6)
  
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=list(input().split())
H=list(input().split())
L=list()

for i in range(H):
  Ave_temparature=abs(float(a)-float(t)-float(H[i])*0.006)
  L.append(Ave_temparature)
  
print(min(L))


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

for i in range(0,len(H)):
  H[i]=abs(1000*a-t*1000+H[i]*6)
  
print(H.index(min(H))+1)

Buggy python submission (verdict: Runtime Error):
n=int(input())
t,a=list(input().split())
H=list(input().split())
L=list()

for i in range(H):
  Ave_temparature=abs(float(a)-float(t-H[i]*0.006))
  L.append(Ave_temparature)
  
print(min(L))

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

for i in range(0,len(H)):
  H[i]=abs(1000*a-t*1000+H[i]*6)
  
print(H.index(min(H))+1)