Problem:


Score: 200 points

Problem Statement

A country decides to build a palace.

In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.

There are N places proposed for the place. The elevation of Place i is H_i meters.

Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.

Print the index of the place where the palace should be built.

It is guaranteed that the solution is unique.

Constraints

1 \leq N \leq 1000

0 \leq T \leq 50

-60 \leq A \leq T

0 \leq H_i \leq 10^5

All values in input are integers.

The solution is unique.

Input

Input is given from Standard Input in the following format:

N
T A
H_1 H_2 ... H_N

Output

Print the index of the place where the palace should be built.

Sample Input 1

2
12 5
1000 2000

Sample Output 1

1

The average temperature of Place 1 is 12-1000 \times 0.006=6 degrees Celsius.

The average temperature of Place 2 is 12-2000 \times 0.006=0 degrees Celsius.

Thus, the palace should be built at Place 1.

Sample Input 2

3
21 -11
81234 94124 52141

Sample Output 2

3



Sample input:
2
12 5
1000 2000


Sample output:
1

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int,input().split())
lis = list(map(int, input().split()))
tmp = []
for i in lis:
    tmp.append(abs(int(t - i * 0.006) - a))
print(tmp.index(min(tmp))+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h= list(map(int,input().split()))

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
li = []
for i in range(n):
    diff = abs(int(t-(h[i]*0.006))-a)
    li.append(diff)
print(li.index(min(li))+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
temp1 = t - h[0] * 0.006
for i in range(1,n):
    temp2 = t - h[i] * 0.006
    if abs(temp1-a) > abs(temp2-a):
        ans = i + 1
        temp1 = temp2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
temp1 = t - h[0] * 0.006
for i in range(1,n):
    temp2 = t - h[i] * 0.006
    if abs(temp1-a) > abs(temp2-a):
        ans = i
        temp1 = temp2
print(ans)

Submission status: Wrong Answer

Solution code:
#Coding:Utf-8

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


for i in range(N):
    if i==0:
        temp=abs(A-(T-H[i]*0.006))
        point=i+1
    else:
        if temp>abs(A-(T-H[i]*0.006)):
            point=i+1

print(point)

Submission status: Wrong Answer

Solution code:
n=int(input())
t, a = map(int, input().split())
h = [int(i) for i in input().split()]
ans = 0
sa = 999999999999999

for i in range(n):
    if a-(t-h[i]*0.006) < sa:
        sa = a-(t-h[i]*0.006) 
        ans = i

print(ans+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
for i in range(N):
    diff = A - (T-H[i]*0.006)
    if i == 0:
        temp = diff
        ans = i+1
    else:
        if diff < temp:
            temp = diff
            ans = i+1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = list(map(int,input().split()))
h = list(map(int, input().split()))
ans = 1000000000
okok = 0

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

print(okok)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = list(map(int,input().split()))
h = list(map(int, input().split()))
ans = 100000
okok = 0

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

print(okok)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
min=10000 #  aとの差
ans=0

for i in range(n):
    temp=t-h[i]*0.006
    if abs(temp-a)<min:
        ans=i+1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

n=int(input())
h,t=list(map(int,input().split()))
x=list(map(int,input().split()))

res=[0]*n
for i in range(n):
	res[i]=abs(h-0.06*x[i]-t)

print(int(np.argmin(res)+1))

Submission status: Wrong Answer

Solution code:
import numpy as np

n=int(input())
h,t=list(map(int,input().split()))
x=list(map(int,input().split()))

res=[0]*n
for i in range(n):
	res[i]=abs(h-0.06*x[i]-t)

print(np.argmin(res)+1)

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#A
def A():
    x, y = LI()
    print(x+y//2)
    return

#B
def B():
    II()
    a, t = LI()
    h = LI()
    ans = [0,inf]
    for num, i in enumerate(h):
        if ans[1] > abs(t - a - i * 0.006):
            ans = [num, abs(t - a - i * 0.006)]
    print(ans[0] + 1)
    return

#C
def C():
    n, m = LI()
    py = LIR(m)
    pya = py[::1]
    py.sort(key=lambda x: x[1])
    city = [1 for i in range(n)]
    dicity = {}
    for p, y in py:
        dicity[(p,y)] = city[p-1]
        city[p-1] += 1    
    for p, y in pya:
        a = "00000" + str(p)
        a = a[-6:]
        b = "00000" + str(dicity[(p, y)])
        b = b[-6:]
        print(a+b)

    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Wrong Answer

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

ans = 0
min_diff = 10*5
for i in range(N):
  if abs((T - H[i]*0.006) - A) < min_diff:
    ans = i+1
    min_diff = abs((T - H[i]*0.006) - A)
print(ans)

Submission status: Wrong Answer

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

ans = 0
min_diff = 10*5
for i in range(N):
  if abs((T - H[i]*0.006) - A) < min_diff:
    ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))

res = float("inf")
ans = 0

for i in range(n):
    t = T - h[i]*0.006
    if abs(t-A) < res:
        res = t
        ans = i+1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))

res = float("inf")
ans = 0

for i in range(n):
    t = T - h[i]*0.006
    if abs(t-A) < res:
        res = t
        ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
m = float("INF")
num = 0
for i in range(n):
    if abs(a - h[i] * 0.006) < m:
        num = i
        m = abs(a - h[i] * 0.006)

print(num + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
m = float("INF")
num = 0
for i in range(n):
    if abs(t - h[i] * 0.006) < m:
        num = i
        m = abs(t - h[i] * 0.006)

print(num + 1)

Submission status: Wrong Answer

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

B=abs(A)*9999999
X=0
for i in range(N):
  if B>abs((T-H[i]*0.006)-A):
    X=i+1
    B=min(abs((T-H[i]*0.006)-A),B)

print(X)

Submission status: Wrong Answer

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

B=abs(A)*9999999
X=0
for i in range(N):
  if B>abs((T-H[i]*0.006)-A):
    X=i+1
    B=min(abs((T-H[i]*0.006)-A),B)
  print(B)

print(X)

Submission status: Wrong Answer

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

ans=[]


for i in range(len(H)):
    relay=int(abs(A-(T-H[i]*0.006)))
    ans.append([i+1,relay])
    ans=sorted(ans,key=lambda x:x[1])
    
print(ans[0][0])

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np

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

m = abs(A - 0.006 * H[0])
num = 1

for n in range(1, N):
    d = abs(A - 0.006 * H[n])
    if d < m:
        m = d
        num = n+1

print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
r = []
for h in Hs:
  r.append(abs(abs(round((T-h*0.006))) - A))
print(r.index(min(r))+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
r = []
for h in Hs:
  r.append(abs(round((T-h*0.006))) - A)
print(r.index(min(r))+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
r = []
for h in Hs:
  r.append(abs(round((T-h*0.006)) - A))
print(r.index(min(r))+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_diff_list = list(map(lambda x: abs(t - x * 0.006 - a), t_mean_list))
 
print(t_diff_list.index(min(t_diff_list)))

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_val_list = list(map(lambda x: t - x * 0.006, t_mean_list))
 
diff_min = abs(t_val_list[0] - a)
a_min = 0
for i in range(1, n):
  diff = abs(t_val_list[i] - a)
  if diff <= diff_min:
    diff_min = diff
    a_min = i + 1
  else:
    continue

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_val_list = list(map(lambda x: t - x * 0.006, t_mean_list))
 
diff_min = abs(t_val_list[0] - a)
a_min = 0
for i in range(1, n):
  diff = abs(t_val_list[i] - a)
  if diff < diff_min:
    diff_min = diff
    a_min = i + 1
  else:
    continue
 
print(a_min)

Submission status: Wrong Answer

Solution code:
#ある国で、宮殿を作ることになりました。
#この国では、標高が x メートルの地点での平均気温は T−x×0.006 度です。
#宮殿を建設する地点の候補は N 個あり、地点 i の標高は Hi メートルです。
#joisinoお姫様は、これらの中から平均気温が A 度に最も近い地点を選んで宮殿を建設するようにあなたに命じました。
#宮殿を建設すべき地点の番号を出力してください。
#ただし、解は一意に定まることが保証されます。

N = int(input())
T, A = map(int, input().split())
H = input().split()
h = list(map(int, H))
for i in range(N):
    tmp = T - 0.006*h[i]
    if abs(A - tmp) <= abs(A - (T - 0.006*h[i-1])):
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(x) for x in input().split()]
temperature = 0
ans = 0
diff = 10**5
for place in range(N):
    temperature = T-H[place]*0.06
    kari_diff = abs(A - temperature)
    if diff > kari_diff:
        diff = kari_diff
        ans = place + 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
cont=10000
x=0
for i in range(1,n):
    x=t-h[i]*0.006
    if x<cont:
        ans=i
        cont=x
print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(N):
    if i == 0:
        palce = H[i]
        ans = i+1
    else:
        if (palce - A)**2 > (H[i] - A)**2:
            palce = H[i]
            ans = i+1

print(ans)

Submission status: Wrong Answer

Solution code:
candidates = input()
T, A = map(int, input().split())
heights = input().split()
ans = []
for i in range(len(heights)):
  ans.append(A - (T - int(heights[i])*0.006))
answer = ans.index(min(ans))
print(answer + 1)

Submission status: Wrong Answer

Solution code:
candidates = input()
T, A = map(int, input().split())
print(T,A)
heights = input().split()
print(heights)
ans = []
for i in range(len(heights)):
  ans.append(A - (T - int(heights[i])*0.006))
answer = ans.index(min(ans))
print(answer + 1)

Submission status: Wrong Answer

Solution code:
candidates = input()
T, A = map(int, input().split())
print(T,A)
heights = input().split()
print(heights)
ans = []
for i in range(len(heights)):
  ans.append(A - (T - int(heights[i])*0.006))
answer = ans.index(min(ans))
print(answer + 1)

Submission status: Wrong Answer

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

min = float('inf')
idx = None
for i in range(len(H)):
    if min > abs(A - T + H[i] * 0.006):
        idx = i + 1

print(idx)

Submission status: Wrong Answer

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

min = float('inf')
idx = None
for i in range(len(H)):
    if min > abs(A - T + H[i] * 0.006):
        idx = i + 1

print(i)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
tlist=[]
for i in range(N):
    tlist.append(float(T-H[i]*0.006))
ans=1
for i in range(1,N):
    if abs(tlist[i]-A)<abs(tlist[0]-A):
        ans=i+1
    if tlist[i]-A==0:
        break

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy; input(); t,a=map(int,input().split())
h=list(map(lambda x: abs(a-(t-int(x)*0.006)),input().split()))
print(numpy.argmin(h))

Submission status: Wrong Answer

Solution code:
N=int(input())
T, A=map(int, input().split())
N=list(map(int,input().split()))
temp=list(map(lambda x: abs(A-(T-0.006*x)),N))
temp.index(min(temp))

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
tem=[]
for i in range(n):
    tem.append(t-h[i]*0.006)
print(tem.index(min(tem)))

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
 
 
min = 10000
mini = 0
 
for i, x in enumerate(h):
  val = T - x*0.006
  gap = abs(A-val)
  if gap < min:
    min = gap
    mini = i
 
print(mini)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))


min = 10000
mini = 0

for i, x in enumerate(h):
  val = T - x*0.006
  gap = abs(A-val)
  if gap < min:
    min = gap
    mini = i

print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int, input().split())
H = list(input().split())
L = []

for i in range(N):
    point = T - int(H[i]) * 0.006
    focus_point = A - point
    L.append(focus_point)

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
num = 0
temp = abs(T-H[0]*0.006-A)
for i in range(N):
    if abs(T-H[i]*0.006-A) < temp:
        num = i
print(num+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(input().split())
a = []
b = 0
c = 0
for i in range(N):
        a.append(A - (T - int(H[i]) * 0.006))
b = min(a)
for i in range(N):
    if b == a[i]:
        c += i
print(c + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(input().split())
a = []
b = 0
c = 0
for i in range(N):
    if T >= 0:
        a.append(A - (T - int(H[i]) * 0.006))
    else:
        a.append((T - int(H[i]) * 0.006) - A)
b = min(a)
for i in range(N):
    if b == a[i]:
        c += i
print(c + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
tmp = 0
ans_no = 1
ans_val = abs(t - (li[0] * 0.006))
print("test",ans_val)
for i in range(1,len(li)):
    tmp = abs(t - (li[i] * 0.006))
    if ans_val > tmp:
        ans_val = tmp
        ans_no = i + 1
print(ans_no)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
a = []
for i in range(N):
    a.append(int(abs(6 - (T - H[i]*0.006))))
b = min(a)
print(a.index(b) + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
a = []
for i in range(N):
    a.append(int(6 - (T - H[i]*0.006)))
b = min(a)
print(a.index(b) + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
temp = 50
t, a = map(int, input().split())
h = list(map(int, input().split()))
for i in range(n):
    if abs(a - t - (h[i] * 0.006)) < temp:
        temp = abs(a - t - h[i] * 0.006)
        ans = i + 1
        
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
m=a
ans=0
for i in range(n):
  if abs((t-h[i]*0.006)-a) < m:
    m=abs((t-h[i]*0.006)-a)
    ans=i+1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
m=a
ans=0
for i in h:
  if abs((t-i*0.006)-a) < m:
    m=abs((t-i*0.006)-a)
    ans=i+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a =  map(int,input().split())
h = list(map(int,input().split()))
b = 0

b = t-a
c = b-0.006*h[0]
best = 0
for i in range(0,len(h)):
    if min(abs(b-0.006*h[i]),c) == abs(b-0.006*h[i]):
        c = abs(b-0.006*h[i])
        best = i

print(best+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a =  map(int,input().split())
h = list(map(int,input().split()))
b = 0

b = (t-a/0.006)
c = abs(h[0]-b)
best = 0
for i in range(0,len(h)):
    if min(abs(h[i]-b),c) == abs(h[i]-b):
        c = abs(h[i]-b)
        best = i

print(best+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = li[0]
for i in li:
    if abs(abs(t - nearest * 0.006) - abs(a)) > abs(abs((t - i * 0.006)) - abs(a)):
        nearest = i
print(li.index(nearest) + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = li[0]
for i in li:
    if abs(nearest - a) < abs((t - i * 0.006) - a):
        nearest = i
print(li.index(nearest) + 1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
for i in range(n):
  h[i]=t-h[i]*0.006
d=abs(a-h[0])
c=1
for i in range(1,n):
  if d>abs(a-h[i]):
    c=i+1
print(c)

Submission status: Wrong Answer

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())
T, A = list(map(int, sys.stdin.readline().split()))
H = list(map(int, sys.stdin.readline().split()))

H = np.array(H)
H = abs(A - T - H * 0.006)
print(H.argmin() + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))

kouho = 100000000000
'''
3
21 -11
81234 52141 94124
'''
for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        kouho = T - h * 0.006
        continue
    kion = T - h * 0.006
    #print(A)
    if abs(A - kion) < abs(A - kouho):
        #print(kion)
        #print(pre)
        #print(abs(A - kion),'kion')
        #print(abs(A - pre),'pre')
        ans = i
        kouho = h
print(ans + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))

pre = 100000000000
'''
3
21 -11
81234 52141 94124
'''
for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        pre = T - h * 0.006
        continue
    kion = T - h * 0.006
    if abs(A - kion) < abs(A - pre):
        #print(kion)
        #print(pre)
        #print(abs(A - kion),'kion')
        #print(abs(A - pre),'pre')
        ans = i
print(ans + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))

pre = A
'''
3
21 -11
81234 52141 94124
'''
for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        pre = T - h * 0.006
        continue
    kion = T - h * 0.006
    if abs(A - kion) < abs(A - pre):
        #print(kion)
        #print(pre)
        #print(abs(A - kion),'kion')
        #print(abs(A - pre),'pre')
        ans = i
print(ans + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))

pre = -100000
'''
3
21 -11
81234 52141 94124
'''
for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        pre = T - h * 0.006
        continue
    kion = T - h * 0.006
    if abs(A - kion) < abs(A - pre):
        #print(kion)
        #print(pre)
        #print(abs(A - kion),'kion')
        #print(abs(A - pre),'pre')
        ans = i
print(ans + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))

for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        continue
    kion = T - h * 0.006
    prekion = T - H_list[i - 1] * 0.006
    if abs(A - kion) < abs(A - prekion):
        ans = i
print(ans + 1)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))

    temp1 = abs(int(A - (T - H[0] * 0.006)))
    pos = 0

    for i in range(1, N):
        temp2 = abs(int(A - (T - H[i] * 0.006)))
        if temp1 > temp2:
            temp1 = temp2
            pos = i
    print(pos+1)

if __name__  == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))

li = []

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

data1 = list(map(int, input().split()))

data2 = map(lambda x:abs(t-x*0.006-a), data1)

print(np.argmin(data2) +1)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

data1 = list(map(int, input().split()))

data2 = map(lambda x:t-x*0.006, data1)

print(np.argmin(data2) +1)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
L=list(map(int,input().split()))
temp=[]
for i in L:
  temp.append(abs(T-i*0.006-A))
print(L.index(min(L))+1)

Submission status: Wrong Answer

Solution code:
n,t,a,*h = map(int,open(0).read().split())
b=[]
for i in range(n):
   b.append(abs(t*h[i]*0.006-a))
print(b.index(min(b))+1)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    position = 1
    bestPos = 0
    res = []
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, position])
        position += 1

    bestPos = arr[0][1]
    bestEvaluation = abs(A - arr[0][0])

    for j in range(N):
        if abs(A - arr[j][0]) < bestEvaluation:
            bestEvaluation = arr[j][0]
            bestPos = arr[j][1]
    print(bestPos)

main()

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
input()
T,A=list(map(int,input().split(" ")))
H=list(map(int,input().split(" ")))
X=[abs(A-T-h*0.006) for h in H]

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

Submission status: Wrong Answer

Solution code:
input()
T,A=list(map(int,input().split(" ")))
H=list(map(int,input().split(" ")))
avg=[]
for h in H:
    avg.append(T-h*0.006)
#print(avg)

#平均気温が近い方のIndexを表示
mini=abs(A-avg[0])
re=10000
for i in range(1,len(avg)):
    #print(abs(A-avg[i]),mini)
    if abs(A-avg[i])<mini:
        mini=abs(A-avg[i])
        #print(mini)
        re=i
print(re+1)

Submission status: Wrong Answer

Solution code:
input()
T,A=list(map(int,input().split(" ")))
H=list(map(int,input().split(" ")))
avg=[]
for h in H:
    avg.append(T-h*0.006)
print(avg)

#平均気温が近い方のIndexを表示
mini=1000
re=10000
for i in range(len(avg)):
    print(abs(A-avg[i]),mini)
    if abs(A-avg[i])<mini:
        mini=abs(A-avg[i])
        #print(mini)
        re=i
print(re+1)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    cnt = 1
    for i in range(N):
        ondo = 0
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, cnt])
        cnt += 1
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    ondo = 0
    cnt = 1
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, cnt])
        cnt += 1
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    ondo = 0
    cnt = 0
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, cnt+1])
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int, input().split())
h = [int(x) for x in range(n)]

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int, input().split())
h = [int(x) for x in range(n)]

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

print(h.index(min(h)))

Submission status: Wrong Answer

Solution code:

def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    ondo = 0
    cnt = 0
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, cnt+1])
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main()

Submission status: Wrong Answer

Solution code:

# 平均気温は T − H × 0.006

def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    ondo = 0
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, i+1])
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
n = int(input())
data = list(map(int,input().split()))
t = data[0]
a = data[1]
del data
h = list(map(int,input().split()))
result = n
for i in range(1,n+1):
        if abs(a - (t-h[i-1]*0.006)) < a - (t-h[result-1]*0.006):
                result = i
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())


tmp = []
for h in list(map(int, input().split())):
  tmp.append(A - int(T - h * 0.006))

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())


tmp = []
for h in list(map(int, input().split())):
  tmp.append(abs(A - int(T - h * 0.006)))

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(x) for x in input().split()]
list = []

for i in range(N):
    temp = T - H[i] * 0.006
    list.append(temp)

A_list = []
for i in range(N):
    A_list.append(5)

sabun = [x - y for (x, y) in zip (list, A_list)]
abs_sabun = [abs(x) for x in sabun]
index = abs_sabun.index(min(abs_sabun))
print(index + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))
ans = 10**4
for i in range(N):
    ans = min(ans, abs(A - T + H[i]*6*10**(-3)))
print(int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))
ans = 10**4
for i in range(N):
    ans = min(ans, abs(A - T + H[i]*0.006))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = (int(i) for i in input().split())
p = float('inf')
for i,h in enumerate([int(i) for i in input().split()]):
    tmp = T-h*0.006
    if p > abs(A-tmp):
        p = A-tmp
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = (int(i) for i in input().split())
p = float('inf')
for i,h in enumerate([int(i) for i in input().split()]):
    tmp = 12-h*0.006
    if p > abs(A-tmp):
        p = A-tmp
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
# print(N,T,A)
# print(H)

def tmpt(T, x):
  return(T - x * 0.006)

mindiff = 100000
for iter, i in enumerate(H):
  diff = A - tmpt(T, i)
  if mindiff > diff:
    mindiff = diff
    ans = iter + 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(ta) for ta in input().split()]
H = [int(h) for h in input().split()]
mn_T = 100
ans = 0
for n in range(N):
  abs_T = abs(A-(T-H[n]*0.006))
  if abs_T < mn_T:
    mn_T = abs_T
    ans = n+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

d = sorted(h, key=lambda x: abs(a - t - x * 0.006))

print(h.index(d[0]) + 1)