ZhenlongDai/ACPR huggingface dataset:
Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import heapq

N, M = map(int, input().split())
A = [int(a) * (-1) for a in input().split()]

for _ in range(M):
    B, C = map(int, input().split())
    tmp = [C * (-1)] * B
    A.extend(tmp)

print(A)
heapq.heapify(A)

ans = 0
for _ in range(N):
    ans += heapq.heappop(A)
            
print(ans * (-1))

Failing test case input:
10 2
0 4 5 7 100 1 7 29 24 5
3 10
4 10
0 4

Expected output:
223


Actual output:
[0, -4, -5, -7, -100, -1, -7, -29, -24, -5, -10, -10, -10, -10, -10, -10, -10]
223


Fixed submission (verdict: Accepted):
import heapq

N, M = map(int, input().split())
A = [int(a) * (-1) for a in input().split()]

B_array = []
for _ in range(M):
    B, C = map(int, input().split())
    B_array.append([C * (-1), B])
B_array.sort()

cnt = 0
i = 0
B_list = []
while cnt < N and i < M:
    B_list.extend([B_array[i][0]] * B_array[i][1])
    cnt += B_array[i][1]
    i += 1

A.extend(B_list)
heapq.heapify(A)

ans = 0
for _ in range(N):
    ans += heapq.heappop(A)
        
print(ans * (-1))

Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
cards = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

c = []
for i in bc:
    for j in range(i[0]):
        c.append(i[1])
        
c.sort(reverse = True)

for i in c:
    if cards[0] < i:
        cards[0] = i
    else:
        break
    
print(sum(cards))

Failing test case input:
10 2
0 4 5 7 100 4 7 33 33 5
3 24
1 30
1 4

Expected output:
287


Actual output:
228


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
cards = [[1, int(i)] for i in input().split()]
bc = [list(map(int, input().split())) for _ in range(m)]
cards += bc
cards.sort(key = lambda x: x[1], reverse = True)

l = []
flag = 0
for i in cards:
    for j in range(i[0]):
        l.append(i[1])
        if len(l) == n:
            flag = 1
            break
    if flag:
        break

print(sum(l))

Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, M = map(int, input().split())
A = [int(_) for _ in input().split()]
BC = [[int(_) for _ in input().split()] for _ in range(M)]

BC.sort(key = lambda x: x[1], reverse = True)
ABC = []
for x, y in BC:
    A.extend([y] * x)
    
    if len(A) > M + 1:
        break

A.sort(reverse = True)
print(sum(A[:N]))

Failing test case input:
10 2
0 8 0 7 100 4 10 33 24 5
3 15
4 47
1 2

Expected output:
390


Actual output:
370


Fixed submission (verdict: Accepted):
N, M = map(int, input().split())
A = [int(_) for _ in input().split()]
BC = [[int(_) for _ in input().split()] for _ in range(M)]

BC.sort(key = lambda x: x[1], reverse = True)
ABC = []
for x, y in BC:
    A.extend([y] * x)
    
    if len(A) > N * 2:
        break

A.sort(reverse = True)
print(sum(A[:N]))
Problem: p03038
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import heapq

N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
B = [list(map(int,input().split())) for i in range(M)]
B = sorted(B, key = lambda x: x[1])[::-1]

heapq.heapify(A)
cnt = 0
for i in range(M):
    for _ in range(B[i][0]):  heapq.heappush(A, -max(-heapq.heappop(A), B[i][1]))
    cnt += B[i][0]
    if cnt >= N:  break
print(-sum(A))

Failing test case input:
11 3
1 1 1 1 1 1 1 1 1 1 1
3 1000000000
4 1000000000
3 1001000000

Expected output:
10003000001


Actual output:
1000999990


Fixed submission (verdict: Accepted):
import heapq

N, M = list(map(int,input().split()))
A = list(map(int,input().split()))
B = [list(map(int,input().split())) for i in range(M)]
B = sorted(B, key = lambda x: x[1])[::-1]

heapq.heapify(A)
cnt = 0
for i in range(M):
    for _ in range(B[i][0]):  heapq.heappush(A, max(heapq.heappop(A), B[i][1]))
    cnt += B[i][0]
    if cnt >= N:  break
print(sum(A))

Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr)
q=[list(map(int,input().split())) for _ in range(m)]
q=sorted(q,reverse=True,key=lambda x:x[1])
q=sorted(q,reverse=True,key=lambda x:x[0])
pos=0
for i in range(n):
  if arr[i]<=q[pos][1]:
    arr[i]=q[pos][1]
    q[pos][0]-=1
    if q[pos][0]==0:
      pos+=1
      if pos==m:
        break
print(sum(arr))

Failing test case input:
3 2
5 1 1
2 3
1 5

Expected output:
13


Actual output:
11


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
arr=list(map(int,input().split()))
arr=sorted(arr)
q=[list(map(int,input().split())) for _ in range(m)]
q=sorted(q,reverse=True,key=lambda x:x[0])
q=sorted(q,reverse=True,key=lambda x:x[1])
pos=0
for i in range(n):
  if arr[i]<=q[pos][1]:
    arr[i]=q[pos][1]
    q[pos][0]-=1
    if q[pos][0]==0:
      pos+=1
      if pos==m:
        break
print(sum(arr))

Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int, input().split())
a = sorted(list(map(int,input().split())))
bc = [list(map(int, input().split())) for _ in range(m)]
bc.sort(key=lambda x: x[1], reverse=True )

count = 0
for b,c in bc:
    for i in range(b):
        if i == n or a[i] >= c:
            break

        a[i] = c
        count += 1

print(sum(a))

Failing test case input:
11 2
1 1 1 1 1 1 1 1 1 1 1
3 1000000000
4 1000000000
3 1100000000

Expected output:
7000000004


Actual output:
3000000008


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())
a = sorted(list(map(int,input().split())))
bc = [list(map(int, input().split())) for _ in range(m)]
bc.sort(key=lambda x: x[1], reverse=True )
count = 0
for b,c in bc:
    for _ in range(b):
        if count == n or a[count] >= c:
            break

        a[count] = c
        count += 1

print(sum(a))
Problem: p03038
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math

n, m = map(int, input().split(" "))
aL = sorted(list(map(int, input().split(" "))))
bcL = sorted([list(map(int,
                       input().split(" "))) for _ in range(m)],
             key=lambda x: x[1],
             reverse=True)

csl = 0
for cnt, point in bcL:
    for i in range(cnt):
        if aL[csl] >= point or csl == n - 1:
            print(sum(aL))
            exit()
        aL[csl] = point
        csl += 1

print(sum(aL))
exit()

Failing test case input:
11 3
1 1 1 1 1 1 1 0 2 1 1
5 1000000000
4 1000000000
3 1000000001

Expected output:
11000000003


Actual output:
10000000005


Fixed submission (verdict: Accepted):
import math

n, m = map(int, input().split(" "))
aL = sorted(list(map(int, input().split(" "))))
bcL = sorted([list(map(int,
                       input().split(" "))) for _ in range(m)],
             key=lambda x: x[1],
             reverse=True)

csl = 0
for cnt, point in bcL:
    for i in range(cnt):
        if csl == n or aL[csl] >= point:
            print(sum(aL))
            exit()
        aL[csl] = point
        csl += 1

print(sum(aL))
exit()

Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [(A[i], 1) for i in range(N)]
for _ in range(M):
    B, C = map(int, input().split())
    BC.append((C,B))
BC = sorted(BC,reverse = True)
ans = 0
a = 0
count = N
for c,b in BC:
  print(b,c)
  lamb = min(count,b)
  ans += c * lamb
  count -= lamb

print(ans)

Failing test case input:
3 2
5 1 1
2 3
2 6

Expected output:
17


Actual output:
2 6
1 5
2 3
1 1
1 1
17


Fixed submission (verdict: Accepted):
N,M = map(int,input().split())
A = list(map(int,input().split()))
BC = [(A[i], 1) for i in range(N)]
for _ in range(M):
    B, C = map(int, input().split())
    BC.append((C,B))
BC = sorted(BC,reverse = True)
ans = 0
a = 0
count = N
for c,b in BC:
  lamb = min(count,b)
  ans += c * lamb
  count -= lamb

print(ans)
Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    n,m = tuple([int(t)for t in input().split()])
    a = [int(t)for t in input().split()]

    e = [tuple([int(t)for t in input().split()])for _ in [0]*m]

    e.sort(key=lambda x:x[1])
    t = 0
    for _ in [0]*m:
        b,c = e.pop()
        if t+b<=n:
            t+=b
            for _ in [0]*b:
                a.append(c)
        else:
            break
    
    a.sort(reverse = True)
    print(sum(a[:n]))
if __name__ == "__main__":
    main()

Failing test case input:
11 3
1 1 1 1 0 2 1 1 1 1 1
6 1000001000
4 1000000000
3 1100000000

Expected output:
11300006000


Actual output:
9300006003


Fixed submission (verdict: Accepted):
def main():
    n,m = tuple([int(t)for t in input().split()])
    a = [int(t)for t in input().split()]

    e = [tuple([int(t)for t in input().split()])for _ in [0]*m]

    e.sort(key=lambda x:x[1])
    t = 0
    for _ in [0]*m:
        b,c = e.pop()
        t+=b
        for _ in [0]*b:
            a.append(c)
        if t>n:break
    
    a.sort(reverse = True)
    print(sum(a[:n]))
if __name__ == "__main__":
    main()

Problem: p03038
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, m = map(int, input().split())
cards = list(map(int, input().split()))
bc = [list(map(int, input().split())) for _ in range(m)]

c = []
flag = 0
for i in bc:
    for j in range(i[0]):
        c.append(i[1])
        if len(c) >= n:
            flag = 1
            break
    if flag:
        break
c.sort(reverse = True)

for i in c:
    if min(cards) < i:
        cards[cards.index(min(cards))] = i
    else:
        break
    
print(sum(cards))

Failing test case input:
10 2
0 0 1 7 100 4 7 33 33 5
3 5
8 35
1 8

Expected output:
413


Actual output:
411


Fixed submission (verdict: Accepted):
n, m = map(int, input().split())
cards = [[1, int(i)] for i in input().split()]
bc = [list(map(int, input().split())) for _ in range(m)]
cards += bc
cards.sort(key = lambda x: x[1], reverse = True)

l = []
flag = 0
for i in cards:
    for j in range(i[0]):
        l.append(i[1])
        if len(l) == n:
            flag = 1
            break
    if flag:
        break

print(sum(l))
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = (int(x) for x in input().split())
H = [int(x) for x in input().split()]
print(H)


def calcTemp(x, y):
    return x - y * 0.006


min = 1000000
counter = 1
numPlace=0
for height in H:
    tmp = abs(A - calcTemp(T, height))
    if min > tmp:
        min = tmp
        numPlace = counter
    counter += 1
print(numPlace)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[1000, 2000]
1


Fixed submission (verdict: Accepted):
N = int(input())
T, A = (int(x) for x in input().split())
H = [int(x) for x in input().split()]


def calcTemp(x, y):
    return x - y * 0.006


min = 1000000
counter = 1
numPlace=0
for height in H:
    tmp = abs(A - calcTemp(T, height))
    if min > tmp:
        min = tmp
        numPlace = counter
    counter += 1
print(numPlace)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
x = list(map(int, input().split()))
h = list(map(int, input().split()))

t = x[0]
a = x[1]
cnt = 1000000000000000000000
ans = 0
for i in range(n):
  tmp = a - t-h[i]*0.006
  if cnt > tmp:
    cnt = tmp
    ans = i+1
print(ans)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
x = list(map(int, input().split()))
h = list(map(int, input().split()))

t = x[0]
a = x[1]
cnt = 1000000000000000000000
ans = 0
for i in range(n):
  tmp = abs(t-(h[i]*0.006)-a)
  if cnt > tmp:
    cnt = tmp
    ans = i+1
print(ans)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif

N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]

lisnew = [tempDif(H,T,A) for H in lis]
print(i for i,x in enumerate(lisnew) if x == min(lisnew))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
<generator object <genexpr> at 0x7fa8d5538e50>


Fixed submission (verdict: Accepted):
def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif
 
N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]
 
lisnew = [tempDif(H,T,A) for H in lis]
print(lisnew.index(min(lisnew))+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
diff = 10000000
index = 0

for i in range(n):
    temp_diff = abs(t - 0.006 * h[i] -a)
    if temp_diff <= diff:
        index = i+1

print(index)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
num = 0
min_temp = 10000000
for i in range(n):
    temp = t - (0.006*h[i])
    temp_diff = abs(a - temp)
    if temp_diff < min_temp:
        min_temp = temp_diff
        num = i

print(num+1)
Problem: p03220
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))

ans = 0
for i in range(n):
    tha = abs(t-h[i]*0.006-a)
    if abs(t-h[ans]*0.006-a)>tha:
        ans = i
    print(tha)
print(i+1)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1.0
5.0
2


Fixed submission (verdict: Accepted):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ha = []
for i in range(n):
    ha.append(abs(t-h[i]*0.006-a))

print(ha.index(min(ha))+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
minval=10**5
ans=0
for i in range(N):
    val=abs(T-(12-H[i]*0.006))
    if val<minval:
        val=minval
        ans=i
print(ans+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
minval=10**5
ans=0
for i in range(N):
    val=abs(A-(T-H[i]*0.006))
    if val<minval:
        minval=val
        ans=i
print(ans+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def solve(N, T, A, H):
  best = (T - A) / 0.006
  index = -1
  diff = -1
  for i in range(N):
    d = abs(best - H[i])
    if diff == -1 or d < diff:
      diff = d
      index = i
  return i + 1


N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))


print(solve(N, T, A, H))


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
def solve(N, T, A, H):
  best = (T - A) / 0.006
  index = -1
  diff = -1
  for i in range(N):
    d = abs(best - H[i])
    if diff == -1 or d < diff:
      diff = d
      index = i
  return index + 1


N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))


print(solve(N, T, A, H))

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
print(H)

temp=[0]*N
gap=[0]*N

for i in range(N):
	temp[i]=0.006*(T-H[i])
	gap[i]=abs(temp[i]-A)

for i in range(N):
	if(gap[i]==min(gap)):
		print(i+1)





Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[1000, 2000]
1


Fixed submission (verdict: Accepted):

N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))


temp=[0]*N
gap=[0]*N

for i in range(N):
	temp[i]=T-0.006*H[i]
	gap[i]=abs(temp[i]-A)


for i in range(N):
	if(gap[i]==min(gap)):
		print(i+1)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
judge = abs(A - (T - 0.006*H[0]))
k = 0

for i in range(N):
  a = abs(A - (T - 0.006*H[i]))
  if judge > a:
    judge = a
    k = i
    
print(k)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
judge = abs(A - (T - 0.006*H[0]))
k = 0

for i in range(N):
  a = abs(A - (T - 0.006*H[i]))
  if judge > a:
    judge = a
    k = i
    
print(k+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 0
diff_min = T

for cnt, t in enumerate(temp):
  if abs(T-t) < diff_min:
    diff_min = abs(T-t)
    place = cnt

print(place)
  

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 1
diff_min = abs(temp[0]-A)

for cnt, t in enumerate(temp,1):
  if abs(A-t) < diff_min:
    diff_min = abs(A-t)
    place = cnt

print(place)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2000


Fixed submission (verdict: Accepted):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = i
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T,A = map(int,input().split(' '))
H = [int(h) for h in input().split(' ')]

best_place = -float('inf')

point = 0
for i,x in enumerate(H):
  TEM = T-x*0.006
  if abs(A-best_place)> abs(A-TEM):
    point = i
    best_place = TEM
print(i+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
T,A = map(int,input().split(' '))
H = [int(h) for h in input().split(' ')]

best_place = -float('inf')

point = 0
for i,x in enumerate(H):
  TEM = T-x*0.006
  if abs(A-best_place)> abs(A-TEM):
    point = i
    best_place = TEM
print(point+1)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def calc_height(t, h):
    return (t - h) * 0.006

n = int(input())
t, a = map(int, input().split())
hs = input().split()

ans = 1
diff = abs(calc_height(t, int(hs[0])))
for i, h in enumerate(hs):
    if calc_height(t, int(h)) < diff:
        ans = i + 1

print (ans)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):

n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))


ans = 0
ans_diff = float("inf")


for i in range(n):
    i_diff = abs(t - hs[i] * 0.006 - a)
    if i_diff < ans_diff:
        ans = i + 1
        ans_diff = i_diff
print (ans)

Problem: p03220
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
idx=0
m=1000000000
for i in range(n):
    tmp=t-(h[i]*0.006)
    print(tmp)
    if abs(a-tmp)<m:
        idx=i
        m=abs(a-tmp)
print(idx+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
6.0
0.0
1


Fixed submission (verdict: Accepted):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
idx=0
m=1000000000
for i in range(n):
    tmp=t-(h[i]*0.006)
    if abs(a-tmp)<m:
        idx=i
        m=abs(a-tmp)
print(idx+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = map(int, (input().split(" ")))
H = list(map(int,input().split(" ")))
ans_t = 10000
ans = 0
 
for i in range(len(H)):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    ans = i
print(ans)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
T, A = map(int, (input().split(" ")))
H = list(map(int,input().split(" ")))
ans_t = 10000
ans = 0
 
for i in range(N):
  t = T - H[i] * 0.006
  l = abs(A - t)
  if l < ans_t:
    ans_t = l
    ans = i + 1
print(ans)

Problem: p03220
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
T=int(input())
a,b=map(int,input().split())
ll=list(map(int,input().split()))
mins=0
for i in range(len(ll)):
    ans=a-0.006*ll[i]
    if abs(ans-b)<abs(ans-ll[mins]):
        mins=i

print(mins+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
T=int(input())
a,b=map(int,input().split())
ll=list(map(int,input().split()))
mins=0
for i in range(len(ll)):
    ans=a-0.006*ll[i]
    if abs(ans-b)<abs((a-0.006*ll[mins])-b):
        mins=i

print(mins+1)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())
x = (A-T)/0.006
diff = float("inf")
ret = 0
for i,h in enumerate(H):
  if abs(h - x) < diff:
    diff = abs(h-x)
    ret = i
print(ret)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())

diff = float("inf")
ret = 0
for i,h in enumerate(H):
  if abs(T-h*0.006-A) < diff:
    diff = abs(T-h*0.006-A)
    ret = i
print(ret+1)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
t, a = map(int, input().split())
h = list(map(float, input().split()))

dt = 10000000
ans = 0
for i in range(len(h)):
    print(i)
    tmp = float(t) - 0.006 * h[i]
    print(i, h[i], tmp, dt, abs( a - tmp ))
    if dt > abs( a - tmp ):
        dt = abs( a - tmp )
        ans = i + 1

print(ans)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0
0 1000.0 6.0 10000000 1.0
1
1 2000.0 0.0 1.0 5.0
1


Fixed submission (verdict: Accepted):
n = int(input())
t, a = map(int, input().split())
h = list(map(float, input().split()))

dt = 10000000
ans = 0
for i in range(len(h)):
    tmp = float(t) - 0.006 * h[i]
    if dt > abs( a - tmp ):
        dt = abs( a - tmp )
        ans = i + 1

print(ans)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
t, a = map(int, input().split())
h_list = list(map(int, input().split()))

temp = abs(a - (t - h_list[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(i)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
3


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

temp = abs(a - (t - h_list[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(result)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + H[0] * 0.006)
for i in range(N):
  d = T - H[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i
print(ans)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + H[0] * 0.006)
for i in range(N):
  d = T - H[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i + 1
print(ans)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
u = []

for i in range(n):
    u.append(abs(a-(t-0.006*h[i])))

print(u)
print(u.index(min(u))+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[1.0, 5.0]
1


Fixed submission (verdict: Accepted):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
u = []

for i in range(n):
    u.append(abs(a-(t-0.006*h[i])))

print(u.index(min(u))+1)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def calc(T, x):
  return T - x * 0.0006

N = int(input())
T, A = map(int, input().split())
L = list(map(int, input().split()))
l = []
for i in L:
  l.append(abs(A - calc(T, i)))

mi = min(l)
print(l.index(mi)+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
def calc(T, x):
  return T - x * 0.006

N = int(input())
T, A = map(int, input().split())
L = list(map(int, input().split()))
l = []
for i in L:
  l.append(abs(A - calc(T, i)))

mi = min(l)
print(l.index(mi)+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    t,a=map(int, input().split())
    h=list(map(int,input().split()))
    ans=n+1
    minabs=10**18
    for i in range(n):
        tempabs=abs(a-(t-h[i]*0.006))
        if tempabs<minabs:
            minabs=tempabs
            ans=i+1
    print(ans)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:

Fixed submission (verdict: Accepted):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    t,a=map(int, input().split())
    h=list(map(int,input().split()))
    ans=n+1
    minabs=10**18
    for i in range(n):
        tempabs=abs(a-(t-h[i]*0.006))
        if tempabs<minabs:
            minabs=tempabs
            ans=i+1
    print(ans)
resolve()

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
I=[T-item*0.006 for item in H]
print(I)
D=[abs(A-item) for item in I]
print((D.index(min(D)))+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[6.0, 0.0]
1


Fixed submission (verdict: Accepted):
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
I=[T-item*0.006 for item in H]
D=[abs(A-item) for item in I]
print((D.index(min(D)))+1)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
T,A=map(int,input().split())
H=[int(x) for x in input().split()]
s=float("inf")
j=0
for i in range(N):
  tempgap=abs(T-H[i]*0.006-A)
  if tempgap<s:
    s,j=tempgap,i
print(i+1)
  

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
T,A=map(int,input().split())
H=[int(x) for x in input().split()]
s=float("inf")
j=0
for i in range(N):
  tempgap=abs(T-H[i]*0.006-A)
  if tempgap<s:
    s,j=tempgap,i
print(j+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = map(int, input().split())
N = map(int, input().split())
i = 9999
j = 1
for ids,k in enumerate(N):
  if abs(A - (T - k * 0.006)) < i : 
    i = abs(A - (T - k * 0.006))
    j = ids

print(j)    

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
B = int(input())
T, A = map(int, input().split())
N = map(int, input().split())
i = 9999
j = 1
for ids,k in enumerate(N):
  if abs(A - (T - k * 0.006)) < i : 
    i = abs(A - (T - k * 0.006))
    j = ids

print(j + 1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t, a = [ int(v) for v in input().split() ]
height_list = [ int(v) for v in input().split() ]
height_list = [ abs(t-a-i*0.006) for i in height_list ]
print(height_list.index(min(height_list))-1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
-1


Fixed submission (verdict: Accepted):
n = int(input())
t, a = [ int(v) for v in input().split() ]
height_list = [ abs(t-a-int(v)*0.006) for v in input().split() ]
print(height_list.index(min(height_list))+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = None
for x in range(n):
    cand = t * h[x] * 0.006
    if not palace or abs(t - cand) < abs(a - (t * h[palace] * 0.006)):
        palace = x + 1
print(palace)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = 1
for x in range(n):
    diff_cand = abs(a - (t - (h[x] * 0.006)))
    diff_curr = abs(a - (t - (h[palace - 1] * 0.006)))
    if diff_cand < diff_curr:
        palace = x + 1
print(palace)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
T, A = map(int, input().split())
H = list(map(int, input().split()))
T_H = [T - h*0.006 for h in H]
diff = [abs(A-t) for t in T_H]
print(diff.index(min(diff)))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = input()
T, A = map(int, input().split())
H = list(map(int, input().split()))
T_H = [T - h*0.006 for h in H]
diff = [abs(A-t) for t in T_H]
print(diff.index(min(diff)) + 1)
Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = H[i]
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans)
  


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1000


Fixed submission (verdict: Accepted):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = i
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input()) 
t,a = map(int,input().split())
x_li = list(map(int,input().split())) 

x_temp_li = []
x_a_li = []
for i in x_li:
    temp = t - i * 0.006
    x_temp_li.append(temp)

print(x_temp_li)

for i in x_temp_li:
    temp_a = i - a
    x_a_li.append(abs(temp_a))
    print(abs(temp_a))
print(x_a_li.index(min(x_a_li)) + 1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[6.0, 0.0]
1.0
5.0
1


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

x_temp_li = []
x_a_li = []
for i in x_li:
    temp = t - i * 0.006
    x_temp_li.append(temp)
for i in x_temp_li:
    temp_a = i - a
    x_a_li.append(abs(temp_a))
print(x_a_li.index(min(x_a_li)) + 1)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
T, A = map(int, input().split())
H = [int(i) for i in input().split()]
temp = []

for i in H:
    temp.append(abs(A - (T - i * 0.006)))
min_ind = temp.index(min(temp))
print(min_ind)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
T, A = map(int, input().split())
H = [int(i) for i in input().split()]
temp = []

for i in H:
    temp.append(abs(A - (T - i * 0.006)))
min_ind = temp.index(min(temp))
print(min_ind+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
minval=10**5
ans=0
for i in range(N):
    val=abs(A-(T-H[i]*0.006))
    if val<minval:
        val=minval
        ans=i
print(ans+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
minval=10**5
ans=0
for i in range(N):
    val=abs(A-(T-H[i]*0.006))
    if val<minval:
        minval=val
        ans=i
print(ans+1)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T,A = (int(i) for i in input().split())
H = [int(i) for i in input().split()]

place = 1
closest = abs(T - H[0]*0.006)

for i in range(1,N):
    temperature = abs(T-H[i]*0.006)
    if temperature < closest:
        place = i + 1
        closest = temperature

print(place)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
T,A = (int(i) for i in input().split())
H = [int(i) for i in input().split()]

place = 1
closest = abs(A - (T - H[0]*0.006))

for i in range(1,N):
    temperature = abs(A - (T - H[i]*0.006))
    if temperature < closest:
        place = i + 1
        closest = temperature

print(place)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T,A = map(int, input().split())
H = input().split() 
Hls = []

c = 1
for i in H:
    Hls.append((abs(A - (T - int(i)*0.006)),int(c)))
    c = c+1



Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
T,A = map(int, input().split())
H = input().split() 
Hls = []

c = 1
for i in H:
    Hls.append((abs(A - (T - int(i)*0.006)),int(c)))
    c = c+1

print(min(Hls)[1])

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t, a = map(int, input().split())
h_list = list(map(int,input().split()))

temp_list=[]

for h in h_list:
	temp_list.append(abs(t-h*0.006-a))

print(temp_list.index(min(temp_list)))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


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

temp_list=[]

for h in h_list:
	temp_list.append(abs(t-h*0.006-a))

print(temp_list.index(min(temp_list)) + 1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
t,a = MAP()
h = MAP()

res = MOD
for i in range(n):
    tmp = abs(a-(t-(h[i]*0.006)))
    print(tmp)
    if res>tmp:
        res = tmp
        ans = i+1
print(ans)



Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1.0
5.0
1


Fixed submission (verdict: Accepted):
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
t,a = MAP()
h = MAP()

res = MOD
for i in range(n):
    tmp = abs(a-(t-(h[i]*0.006)))
    if res>tmp:
        res = tmp
        ans = i+1
print(ans)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
T, A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]



def dif(h):
    return abs(T - h*0.006 - A)

neari = 0
nearDif = dif(H[0])
for i in range(N):
    
    idif = dif(H[i])
    if idif<nearDif:
        neari = i
        nearDif = idif
        
print(i+1)



Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):

N = int(input())
T, A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]



def dif(h):
    return abs(T - h*0.006 - A)

neari = 0
nearDif = dif(H[0])
for i in range(N):
    
    idif = dif(H[i])
    if idif<nearDif:
        neari = i
        nearDif = idif
        
print(neari+1)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+i*0.006
    if m>abs(b):
        m=abs(b)
        k=i+1


print(k)     

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
3


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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+h[i-1]*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t,a = map(int,input().split())
h = map(int,input().split())
tem = 1000
for i in h:
  c = t-0.006*i
  d = c - a
  if d**2 < tem:
    tem = c
print(int(tem))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
6


Fixed submission (verdict: Accepted):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tem = 1000
z = 0
for i in h:
  c = t-0.006*i
  d = c - a
  e = tem - a
  if d**2 < e**2:
    tem = c
    z = i 
aa = h.index(z) + 1
print(aa)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    n = int(input())
    t, a = list(map(float, input().split(' ')))

    min_diff = 100000000000000000000000000
    min_index = -1
    hs = list(map(float, input().split(' ')))
    for i in range(n):
        h = hs[i]
        cu_diff = abs(a - (t - h * 0.006))
        print(cu_diff)
        if cu_diff < min_diff:
            min_diff = cu_diff
            min_index = i

    print(min_index+1)

if __name__ == '__main__':
    main()


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1.0
5.0
1


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    t, a = list(map(float, input().split(' ')))

    min_diff = 100000000000000000000000000
    min_index = -1
    hs = list(map(float, input().split(' ')))
    for i in range(n):
        h = hs[i]
        cu_diff = abs(a - (t - h * 0.006))
        if cu_diff < min_diff:
            min_diff = cu_diff
            min_index = i

    print(min_index+1)

if __name__ == '__main__':
    main()
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

li = []
for i in range(len(h)):
  li.append(abs(a - (t - h[i]*0.006)))
  
print(li.index(min(li)))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


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

li = []
for i in range(n):
  li.append(abs(a - (t - h[i]*0.006)))
  
print(li.index(min(li))+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))

ans = 0
temp = 0
for i in range(len(H)):
	temp = T - H[i] * 0.006
	if abs(temp - A) <= abs(H[ans] - A):
		ans = i

print(ans+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))

ans = 0
anstemp = 2**20
temp = 0
for i in range(len(H)):
	temp = T - H[i] * 0.006
	if abs(temp - A) <= abs(anstemp - A):
		ans = i
		anstemp = temp

print(ans+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
t,a=map(int,input().split())
h = list(map(int, input().split()))
x = [abs(a-(t-b*0.006)) for b in h]
print(x.index(min(x)))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


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

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import fabs

def main():
  n = int(input())
  T, A = list(map(int, input().split()))
  H = list(map(int, input().split()))
  
  place = 0
  m = 1000000000
  for i, h in enumerate(H):
    t_h = T - h * 0.006
    dif = fabs(A - t_h)
    print(dif)
    if dif < m:
      m = min(m, dif)
      place = i+1
  print(place)
main()

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1.0
5.0
1


Fixed submission (verdict: Accepted):
from math import fabs

def main():
  n = int(input())
  T, A = list(map(int, input().split()))
  H = list(map(int, input().split()))
  
  place = 0
  m = 1000000000
  for i, h in enumerate(H):
    t_h = T - h * 0.006
    dif = fabs(A - t_h)
    if dif < m:
      m = min(m, dif)
      place = i+1
  print(place)
main()
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

print(H)

for i in range(N):
    H[i] = T - (H[i] * 0.006)
print(H)

for k in range(N):
    H[k] = abs(H[k] - abs(A))
print(H)

print(H.index(min(H))+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[1000, 2000]
[6.0, 0.0]
[1.0, 5.0]
1


Fixed submission (verdict: Accepted):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))



for i in range(N):
    H[i] = T - (abs(H[i]) * 0.006)


for k in range(N):
    H[k] = abs(H[k] - (A))


print((H.index(min(H)))+1)

Problem: p03220
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>t*(1000)-6*H[i]:
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2000


Fixed submission (verdict: Accepted):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = i
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
gap = float("inf")
for i in range(n):
    print(gap)
    if abs(t - h[i] * 0.006 - a) < gap:
        ans = i + 1
        gap = abs(t - h[i] * 0.006 - a)
print(ans)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
inf
1.0
1


Fixed submission (verdict: Accepted):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
gap = float("inf")
for i in range(n):
    if abs(t - h[i] * 0.006 - a) < gap:
        ans = i + 1
        gap = abs(t - h[i] * 0.006 - a)
print(ans)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
n = int(stdin.readline().rstrip())
t, a = [int(x) for x in stdin.readline().rstrip().split()]
hs = [int(x) for x in stdin.readline().rstrip().split()]
answers=[t-h*0.006 for h in hs]
answers=[abs(an-a)for an in answers]
print(min(answers))

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1.0


Fixed submission (verdict: Accepted):
from sys import stdin
n = int(stdin.readline().rstrip())
t, a = [int(x) for x in stdin.readline().rstrip().split()]
hs = [int(x) for x in stdin.readline().rstrip().split()]

answers=[t-h*0.006 for h in hs]

answers=[abs(an-a) for an in answers]

print(answers.index(min(answers))+1)
Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = [(T - H[i] * 0.006) for i in range(N)]
print(t)
cur = 100000
for i in range(N):
    if (abs(t[i] - A) < cur): ans = i
print(ans)


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
[6.0, 0.0]
1


Fixed submission (verdict: Accepted):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = [(T - H[i] * 0.006) for i in range(N)]
cur = 100000
for i in range(N):
    if (abs(t[i] - A) < cur): cur, ans = abs(t[i] - A), i + 1
print(ans)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
_=input()
T,A = map(int,input().split())
H = map(int, input().split())
min_i = -1
min_d = 10**10
for i,h in enumerate(H):
  d = abs(A-(T-h*0.006))
  print(d)
  if d<min_d:
    min_d=d
    min_i=i
print(min_i+1)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
1.0
5.0
1


Fixed submission (verdict: Accepted):
_=input()
T,A = map(int,input().split())
H = [int(x) for x in input().split()]
min_i = -1
min_d = 10**10
for i,h in enumerate(H):
  d = abs(A-(T-h*0.006))
  if d<min_d:
    min_d=d
    min_i=i
print(min_i+1)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

N = int(input())
T, A = map(int, input().split())
H = input().split()

tmp = 111

for i in range(N):
  tmp = min(tmp, abs(A - (T - int(H[i])*0.006)))
  ans = i+1
  
print(ans)

Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
2


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 1
min_tmp = 1000

for i in range(N):
  tmp = abs(A - (T - H[i]*0.006))
  if min_tmp > tmp:
    ans = i+1
    min_tmp = tmp

print(ans)

Problem: p03220
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
t,a = map(int,input().split())
height = list(map(int,input().split()))
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
ans = float(10**7)
lst = []
for i in range(N):
  if ans > subduction[i]:
    ans = subduction[i]
    lst.append(i)
print(lst[-1])
  


Failing test case input:
2
12 5
1000 2000

Expected output:
1

Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
t,a = map(int,input().split())
height = list(map(int,input().split()))
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
ans = float(10**7)
lst = []
for i in range(N):
  if ans > subduction[i]:
    ans = subduction[i]
    lst.append(i)
print(lst[-1]+1)