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

Solution (Python):
import sys
readline = sys.stdin.readline

def main():
    N = int(readline())
    T, A = map(int, readline().rstrip().split())
    H = list(map(int, readline().rstrip().split()))
    temp = [T - x*0.006 for x in H]
    d = 10 ** 5
    res = -1
    for i, t in enumerate(temp):
        if abs(A - t) < d:
            res = i + 1
            d = abs(A - t)
    
    print(res)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
T, A = map(int, input().split())
xs = list(map(int, input().split()))

ans_ind = -1
ans_d = 100000000000

for i, x in enumerate(xs):
  t = T - x*0.006
  
  if abs(A - t) < ans_d:
    ans_ind = i+1
    ans_d = abs(A - t)
    
print(ans_ind)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = [int(i) for i in input().split()]

cur  = float('inf')
ans = 0
for i in range(N):
    x = abs(A - (T - H[i] * 0.006))
    if cur > x:
        cur = x
        ans = i + 1
print(ans)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
temp = list(map(lambda x: abs(a - (t-0.006*x)), h))
p = temp.index(min(temp))
print(p + 1)

Solution (Python):
n = int(input())
t, a = map(int, input().strip().split())
hs = list(map(int, input().strip().split()))

best_i = 0
best_diff = 1e9

for i in range(n):
    h = hs[i]
    temp = t - 0.006 * h
    diff = abs(a - temp)
    if diff < best_diff:
        best_i = i
        best_diff = diff

print(best_i + 1)

Solution (Python):
import numpy as np
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
h = list(map(lambda x:abs(t-0.006*x-a),h))
print(np.argmin(h)+1)

Solution (Python):
n = int(input())
t,a = tuple(map(int,input().split()))
h = tuple(map(int,input().split()))
ans = n
m = abs(t-h[-1]*0.006-a)
for i in range(n-1):
  t_i = t-h[i]*0.006
  diff = abs(t_i-a)
  m = min(diff,m)
  if m==diff:
    ans = i+1
print(ans)

Solution (Python):
n = int(input())
t,a = map(int,input().split())
l = list(map(int,input().split()))
d = 10**6
point = -1
for i in range(n):
  if abs(t-l[i]*0.006-a) < d:
    d = abs(t-l[i]*0.006-a)
    point = i+1
print(point)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
dis = float('inf')
ans = -1
for i in range(n):
    tmpdis = abs(t - h[i] * 0.006 - a)
    if tmpdis < dis:
        ans = i + 1
        dis = tmpdis
print(ans)

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

min_diff = 10000
plan = 0
for i in range(N):
    tmpe = T - 0.006 * H[i]
    diff_A = abs(A - tmpe)
    if min_diff > diff_A:
        plan = i+1
        min_diff = diff_A

print(plan)

Solution (Python):
N = int(input())
T, A = list(map(int,input().split()))
H = list(map(int,input().split()))
diffs = [abs(A - (T - h * 0.006)) for h in H]
min_idx = -1
min = float('inf')
for i in range(len(diffs)):
    if min > diffs[i]:
        min = diffs[i]
        min_idx = i
print(min_idx+1)

Solution (Python):
import itertools
import math
import fractions
import functools
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))

ans = 0
minimum = 100000000
for i in range(n):
    subs = abs(a - (t-h[i]*0.006))
    if minimum > subs:
        minimum = subs
        ans = i

print(ans+1)

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

Solution (Python):

n = int(input())

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

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

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

MinH = min(h_list)
print(h_list.index(MinH)+1)

Solution (Python):
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
A = []

for i in range(n):
    tmp = abs((t-int(H[i])*0.006)-a)
    A.append(tmp)

B = min(A)
print(A.index(B)+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
L=list(map(int,input().split()))

res=10**10


for i in range(n):
	if res>abs((t-L[i]*0.006)-a):
		res=abs((t-L[i]*0.006)-a)
		ress=i+1
		
print(ress)

Solution (Python):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
ans = [100000,100000]

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

Solution (Python):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
min_dif = 10**9
for i in range(N):
    dif = abs(A-(T-H[i]*0.006))
    if min_dif > dif:
        min_dif = dif
        res_i = i
print(res_i+1)

Solution (Python):
def main():
    N = int(input())
    T, A = map(float, input().split())
    H = list(map(float, input().split()))

    diff = list()
    for i in range(N):
        diff.append(abs((T-H[i]*0.006)-A))
    print(diff.index(min(diff))+1)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
plc = 0
ctemp = float(10**5)
for i in range(n):
  htemp = abs(t-h[i]*0.006-a)
  if htemp<ctemp:
    plc = i+1
    ctemp = htemp
print(plc)

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

diff = []

for each_h in h:
  diff.append(abs(a - (t - each_h*0.006)))

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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
Hlist = list(map(int, input().split()))

answer_id = 10000
answer_height_diff = 10000

for i, hight in enumerate(Hlist, 1):
    tempareture = T - hight * 0.006
    if answer_height_diff > abs(A - tempareture):
        answer_height_diff = abs(A - tempareture)
        answer_id = i

print(answer_id)

Solution (Python):

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

list = [abs(A-(T - i * 0.006)) for i in H]

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

Solution (Python):
n = input()

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

def it():
    for i, x in enumerate(map(int, input().split()), 1):
        yield abs(a - (t - x * 0.006)), i

print(min(it())[1])

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

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

mn = None
for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    mn = (i, d) if mn is None or mn[1] > d else mn
print(mn[0] + 1)

Solution (Python):
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()))
    tempabs=[abs(a-(t-i*0.006)) for i in h]
    minabs=min(tempabs)
    print(tempabs.index(minabs)+1)
resolve()

Solution (Python):
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()

Solution (Python):
n = int(input())
t,a = map(int,input().split())
ls = list(map(int,input().split()))
p = 0
j = 0
for i in range(n):
    if i ==0:
        tem = t - 0.006*ls[i]
        ans = abs(tem-a)
        j = 1
    else:
        tem = t - 0.006*ls[i]
        if ans - abs(tem-a) >0:
            ans = abs(tem-a)
            j = i + 1
print(j)

Solution (Python):
n = int(input())
t, a = [int(x) for x in input().split()]
h_list = [int(x) for x in input().split()]
temp_list = sorted([(abs((t - h * 0.006) - a), i + 1) for i, h in enumerate(h_list)])
print(temp_list[0][1])

Solution (Python):
n = int(input())
t,a = map(int, input().split())
arr = map(int, input().split())

ans = (-1,float('inf'))
for i,h in enumerate(arr):
  tmp = t - h * 0.006
  if abs(tmp - a) < abs(ans[1]):
    ans = (i, tmp-a)
    
print(ans[0]+1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = [int(i) for i in input().split()]
x = 10 ** 5
b = 0
for i in range(n):
    d = abs(a - (t - h[i] * 0.006))
    if d < x:
        x = d
        b = i + 1
print(b)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
res = 0
sa = -1

for i in range(N):
  t = T - 0.006 * H[i]
  s = abs(A - t)
  if sa < 0 or s < sa:
    sa = s
    res = i + 1

print(res)

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

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

temp=[]
for i in range(n):
    at = t - h[i] * 0.006
    t2 = a - at
    if t2 < 0: t2 *= -1
    temp.append(t2)

ans = 0
diff = 10000.0
for i in range(n):
    if temp[i] < diff:
        ans = i + 1
        diff = temp[i]

print(ans)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
d = 10**10
ans = -1
for i, x in enumerate(h):
  di = abs((t - x * 0.006) - a)
  if di < d:
    d = di
    ans = i + 1
print(ans)

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

H_list = list(map(int, input().split()))
ans_list = []

for i in H_list:
  kion = T - (i * 0.006)
  kion_abs = abs(kion - A)
  ans_list.append(kion_abs)

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

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

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

diff = 0
m = 1000
n = 0
for i in range(N):
    temp = T - H[i] * 0.006
    diff = abs(temp - A)
    if diff < m:
        m = diff
        n = i+1
print(n)

Solution (Python):
n=input()
t,a=map(int,input().split())
h=list(map(int,input().split()))
place=[abs(a+i*0.006-t) for i in h]
m=min(place)
basyo=place.index(m)+1
print(basyo)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
s = input().rstrip().split(' ')
gap = 300
loc = 0
for i in range(n):
  temp = t-int(s[i])*0.006
  if abs(temp-a) < gap:
    gap = abs(temp-a)
    loc = i+1
print(loc)

Solution (Python):

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

Solution (Python):


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

Solution (Python):

import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, T: int, A: int, H: "List[int]"):
    print(1 + min(range(N), key=lambda i: abs(T - H[i] * 0.006 - A)))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    T = int(next(tokens))  
    A = int(next(tokens))  
    H = [int(next(tokens)) for _ in range(N)]  
    solve(N, T, A, H)


if __name__ == '__main__':
    main()

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

Solution (Python):
import numpy as np

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

ans = 1
mn = np.inf
for i, h in enumerate(H):
    if mn > abs(A - (T - h * 0.006)):
        ans = i+1
        mn = abs(A - (T - h * 0.006))
print(ans)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
av_temp = []
for i in range(n):
    av_temp.append(t-h[i]*0.006)
preTmp = 100000
for i in range(n):
    tmp = abs(av_temp[i]-a)
    if tmp < preTmp:
        preTmp = tmp
        ans = i+1
print(ans)

Solution (Python):


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

    D = [abs(A -(T - 0.006*x)) for x in H]
    print(D.index(min(D)) + 1)


main()

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = []
for i, j in enumerate(input().split()):
    h.append((i+1, abs(t-int(j)*0.006-a)))
h.sort(key=lambda x:x[1])
print(h[0][0])

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
mi = 10**9
for ind, i in enumerate(h):
    tmp = abs(t-i*0.006-a)
    if tmp<mi:
        mi = tmp
        ans = ind+1
print(ans)

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

Solution (Python):
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  
    T, A = list(map(int,_in[1].split(' ')))  
    H_arr = list(map(int,_in[2].split(' ')))  
    
    x = (T-A)/0.006
    diff = [abs(h-x) for h in H_arr]
    cnt = diff.index(min(diff))+1
    
    print(cnt)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
lh = list(map(int, input().split()))

lt = list()
for i in range(N):
    lt.append(abs(A - (T - lh[i]*0.006)))

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

Solution (Python):
N=int(input())
T,A=map(int,input().split(" "))
H=[int(s) for s in input().split(" ")]

Temp=[]
for index in range(N):
    func=abs(A-(T-0.006*H[index]))
    func1=[func,index]
    Temp.append(func1)

Temp.sort()
    
    
print(Temp[0][1]+1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
*h, = map(int, input().split())
calc_diff = lambda x: abs(a - (t - x * 0.006))
*hdif, = map(calc_diff, h)
ans = hdif.index(min(hdif)) + 1
print(ans)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = [abs(A-(T-float(h)*0.006)) for h in input().split()]
print(H.index(min(H))+1)

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

Solution (Python):
import numpy as np
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
h = np.array(h)
print(np.argmin(abs((t - h*0.006) - a))+1)

Solution (Python):
import numpy as np
n = int(input())
t, a = map(int,input().split())
h_ = list(map(int,input().split()))
b = []
for h in h_:
    b.append(abs(a - (t - 0.006 * h))) 

print(np.argmin(b)+1)

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

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

avg = [T - H[i] * 0.006 for i in range(N)]
diff = [abs(avg[i] - A) for i in range(N)]
idx = diff.index(min(diff))
print(idx + 1)

Solution (Python):
import numpy as np
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
cand = [abs(T-0.006*h-A) for h in H]
print(np.argmin(cand)+1)

Solution (Python):
import numpy as np
import sys
import math

n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
H=np.array(H)
T=t-H*0.006
T=abs(T-a)
print(np.argmin(T)+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
list=[]
for hh in h:
  list.append(t-0.006*hh)
ans=[]
for l in list:
  ans.append(abs(a-l))
print(ans.index(min(ans))+1)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

n=I()
t,a=MI()
hs=LI()
u=[]
mini=inf
for i in range(n):
    k=abs(t-a-hs[i]*0.006)
    if k<mini:
        mini=k
        num=i
        
print(num+1)

Solution (Python):
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)

Solution (Python):

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

Solution (Python):

import numpy as np
n = int(input()) 
t, a = map(int, input().split())
h = list(map(int, input().split()))
a_t = []
for i in h:
    a_t.append(t - i * 0.006)
print(np.abs(np.asarray(a_t) - a).argmin() + 1)

Solution (Python):
import sys
inf = 10**15
mod = 10**9+7
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
bi = []
bii = []
for i in range(n):
    bi.append(t-h[i]*0.006)
    bii.append([t-h[i]*0.006, i+1])
bi.sort()
import bisect
ind = bisect.bisect_left(bi, a)
tmp = 0
if ind == n:
    tmp = bi[n-1]
else:
    if abs(bi[ind]-a) > abs(bi[ind-1]-a):
        tmp = bi[ind-1]
    else:
        tmp = bi[ind]
for i in range(n):
    if tmp == bii[i][0]:
        print(bii[i][1])
        sys.exit()

Solution (Python):

def datain(num):

    data = []
    iscnt = True

    while iscnt:
        for val in map(int,input().split()):
            data.append(val)
            if len(data) == num:
                iscnt = False
                break
        
    return data

data = datain(int(input())+2)

minval = 1000000
ans = 0
temp = [abs(data[1]-(data[0]-0.006*temp)) for temp in data[2:]]


for i,val in enumerate(temp):
    if minval > val:
        minval = val
        ans = i

print(ans+1)

Solution (Python):
N=int(input())
a=input().split()
T=int(a[0])
A=int(a[1])
H=[int(x) for x in input().split()]
t=abs(T-0.006*H[0]-A)
s=0
for i in range(N):
    if t>abs(T-0.006*H[i]-A):
        t=abs(T-0.006*H[i]-A)
        s=i
        

print(s+1)

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

sa=1000
for i in range(0,n):
  sasa=abs(a-(t-0.006*h[i]))
  if sasa<sa:
    sa=sasa
    keep=i
print(keep+1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
tmp = float('inf')
ans = 0
for i in range(n):
    if tmp > abs(a - (t-h[i]*0.006)):
        tmp = abs(a- (t-h[i]*0.006))
        ans = i

print(ans+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))

tmp=10**10
num=0
for i in range(n):
    if abs(a-(t-l[i]*0.006)) < tmp:
        num=i+1
        tmp=abs(a-(t-l[i]*0.006))
    else:
        continue

print(num)

Solution (Python):
import sys
input=sys.stdin.readline
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
for i in range(n):
    H[i]=abs(t-H[i]*0.006-a)
L=list(enumerate(H,start=1))
L=sorted(L,key=lambda x:x[1])
print(L[0][0])

Solution (Python):


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

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

Solution (Python):
n = int(input())
t, a = list(map(int, input().split(' ')))
hn = list(map(int, input().split(' ')))

def get_dif(h):
    temp = t - h * 0.006
    dif = abs(temp - a)
    return dif

result = hn.index(min(hn, key=get_dif)) + 1
print(result)

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

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = [int(i) for i in input().split()]
diff_abs = [abs(a - (t - hi*0.006)) for hi in h]
print(diff_abs.index(min(diff_abs)) + 1)

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

ans = 0
tmp = 100000

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

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

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

    min_sub=100000
    min_ind=0
    for i in range(N):
        t = abs((T - H[i] * 0.006) - A)
        if t < min_sub:
            min_sub = t
            min_ind = i+1

    print(min_ind)



resolve()

Solution (Python):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
ans=0
t=10**18
for i,h in enumerate(H):
  x=T-h*0.006
  if abs(x-A)<t:
    t=abs(x-A)
    ans=i
print(ans+1)

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

Solution (Python):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
max = float("inf")
idx =1
s = 1
for i in h:
  if abs(t-i*0.006-a) < max:
    max = abs(t-i*0.006-a) 
    idx = s
  s += 1
print(idx)

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

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

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

print(ans)

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

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

temperature = 0

for a in range(0, N):
    temperature = T - h[a] * 0.006
    h[a] = abs(temperature - A)

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

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

T = [t-0.006*i for i in h]

ans = [abs(a-i) for i in T]

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

Solution (Python):
n=int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

tmp = T - H[0] * 0.006
ans = 1

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

print(ans)

Solution (Python):
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
Tmp = [T-H[i]*0.006 for i in range(N)]

D = 999
ind = 999
for i in range(N):
  if abs(A-Tmp[i]) < D:
    D = abs(A-Tmp[i]) 
    ind = i

print(ind+1)

Solution (Python):

from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
import itertools
from itertools import permutations, combinations
import sys
import bisect
import string
import math
import time



def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return [int(i) for i in input().split()]
def LI_(): return [int(i)-1 for i in input().split()]
def StoI(): return [ord(i)-97 for i in input()]
def ItoS(nn): return chr(nn+97)
def input(): return sys.stdin.readline().rstrip()

def show(*inp, end='\n'):
    if show_flg:
        print(*inp, end=end)

YN = ['Yes', 'No']
MOD = 10**9+7
inf = float('inf')
l_alp = string.ascii_lowercase
u_alp = string.ascii_uppercase
ts = time.time()
sys.setrecursionlimit(10**6)


show_flg = False


def main():
    N = I()
    T, A = MI()
    H = LI()
    TMP = []

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

    mn = 10**19
    ans = 0
    for i in range(N):
        if mn > abs(TMP[i] - A):
            mn = abs(TMP[i] - A)
            ans = i

    print(ans + 1)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
minitemp = 10*100
for i in range(len(H)):
  H[i] = abs(a-(t-H[i]*0.006))
  minitemp = min(minitemp,H[i])
for j in range(len(H)):
  if H[j] == minitemp:
    print(j+1)
    break

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

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

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

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
T, A = lr()
H = np.array(lr())
temp = np.abs(T - H * 0.006 - A)
answer = np.argsort(temp)
print(answer[0]+1)

Solution (Python):
option = int(input())
ref_t, tmp_id = (int(n) for n in input().split())
height = list((int(n) for n in input().split()))

ave_t = []
for i in range(option):
  ave_t.append(abs(tmp_id - (ref_t - height[i] * 0.006)))

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

Solution (Python):
n = int(input())    
t,a = map(int,input().split())
A =  list(map(int,input().split()))
B = [abs(t - A[i]*0.006 -a) for i in range(n)]
print(min(enumerate(B), key = lambda x:x[1])[0] +1 )

Solution (Python):
def deg(x):
    return t - x * 0.006


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

tmp = 1001001001
ans = 1
for i in range(len(h)):
    d = deg(h[i])
    if abs(a - d) < tmp:
        ans = i + 1
        tmp = abs(a - d)
print(ans)

Solution (Python):
N=int(input())
T,A=map(int, input().split())
list=list(map(int, input().split()))
l_b=[]
d=0
for i in range(N):
  d=A-(T-list[i]*0.006)
  if d<0:
    d=-d
  l_b.append(d)
print(l_b.index(min(l_b))+1)

Solution (Python):
'''
標高がxメートルの地点での平均気温はT−x×0.006度です。
宮殿を建設する地点の候補はN個あり、地点iの標高はHiメートルです。
平均気温がA度に最も近い地点を選んで宮殿を建設。
宮殿を建設すべき地点の番号を出力してください。
'''

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

Solution (Python):
N = int(input())
T,A = map(int, input().split())
*H, = map(int, input().split())

ans = 100000000
index = 0

for i in range(len(H)):
    temp = T-H[i]*0.006

    if abs(A-temp)<ans:
        ans = abs(A-temp)
        index = i


print(index+1)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
T, A = MAP()
H = LIST()

a = abs(T - H[0]*0.006 - A)
ans = 1

for i in range(1, N):
	b = abs(T - H[i]*0.006 -A)
	if b < a:
		ans = i + 1
		a = b

print(ans)

Solution (Python):
N = int(input())
T,A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
sub = [0 for i in range(N)]
for i in range(N):
    sub[i] = abs(A - (T - 0.006*H[i]))
print(sub.index(min(sub))+1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
m = abs(a-(t-h[0]*0.006))
ans = 0

for i in range(1, n):
    num = abs(a-(t-h[i]*0.006))
    if num < m:
        ans = i
        m = num

print(ans+1)

Solution (Python):
import numpy as np
N = input()
T, A = map(int, input().split())
H = np.array(input().split(), dtype=np.float64)
X = abs(T - H * 0.006 - A)
print(np.argmin(X) + 1)

Solution (Python):
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

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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
min_diff = 1000000
ans = 0

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

print(ans)

Solution (Python):
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7
INF = float('inf')

def main():
    N = int(readline())
    T, A = map(int, readline().split())
    H = list(map(int, readline().split()))
    small = INF
    for i in range(N):
        t = T - H[i]*0.006
        if abs(A-t)<small:
            ans = i + 1
            small = abs(A-t)
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
t,a=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[0]*n
for i in range(n):
  A[i]=abs(t-H[i]*0.006-a)

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

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