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):
n = int(input())
t,a = map(int,input().split())
H = [t-h*0.006 for h in list(map(int,input().split()))]
min_abs = float('inf')
index = 0
for h in H:
  if abs(h-a) < min_abs:
    min_abs = abs(h-a)
    index = H.index(h)
print(index +1)

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

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


dif_list = []
for i in range(N):
    iTemp = T - (H_list[i] * 0.006)
    dif = abs(A - iTemp)
    dif_list.append(dif)

M = min(dif_list)
l = dif_list.index(M)

print(l + 1)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

ans = 0
for i in range(n):
    if(abs(a-(t-h[i]*0.006)) <= abs(a-(t-h[ans]*0.006))):
        
        ans = i
print(ans+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]= abs(t-H[i]*0.006-a)

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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = [int(h) for h in input().split()]
dt = [(i, abs(T - h * 0.006 - A)) for i, h in enumerate(H, 1)]
print(min(dt, key=lambda x: x[1])[0])

Solution (Python):
n=int(input())
t,a=map(int,input().split())
H=[int(i) for i in input().split()]

Ans=[abs(t-x*0.006-a) for x in H]
print(Ans.index(min(Ans))+1)

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

sa = 10000
for i in range(n):
    if sa > abs(a - (t - array[i] * 0.006)):
        sa = abs((a - (t - array[i] * 0.006)))
        ans = i + 1

print(ans)

Solution (Python):
N = int(input())
T,A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
mi = 1000
ans = 0
for i in range(N):
  t=T-H[i]*0.006
  if mi>abs(A-t):
    mi = abs(A-t)
    ans = i
print(ans+1)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
min_diff = float("inf")
min_idx = 0
for i in range(N):
    diff = abs(A - (T - H[i] * 0.006))
    if min_diff > diff:
        min_diff = diff
        min_idx = i
print(min_idx + 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]=abs(t - h[i] * 0.006 - a)
print(h.index(min(h))+1)

Solution (Python):

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

t_ = [0]*n
tmp = float('inf')
for i in range(n):
    t_[i] = T-h[i]*0.006
    if tmp>abs(t_[i]-a):
        tmp = abs(t_[i]-a)
        ans = i
print(ans+1)

Solution (Python):
import sys


		
def main():
	n = int(input())
	t , a = map(int, input().split())
	hl = list(map(int, input().split()))
	get_t=lambda x : t - x * 0.006
	get_e=lambda x : abs(a-get_t(x))
	
	mv=None
	mi=None
	
	for i,h in enumerate(hl):
		mm= get_e(h)
		if mv is None or mm < mv:
			mv = mm
			mi = i
	
	print(mi+1)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

sub = 10**5
for i, h in enumerate(H):
    temp = t - h * 0.006
    if sub > abs(a - temp):
        sub = abs(a - temp)
        ans = i + 1
print(ans)

Solution (Python):
n = int(input())
zero_t, ans_t = map(int, input().split())
high = [int(i) for i in input().split()]
abs_val = [abs(ans_t - (zero_t - h * 0.006)) for h in high]
print(abs_val.index(min(abs_val))+1)

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
T, A = map(int, input().split())
array = list(map(int, input().split()))
ans = abs(A - (T - (array[0] * 0.006)))
ans_num = 1
for i in range(1,N):
    if abs(A - (T - (array[i] * 0.006))) <= ans:
        ans = abs(A - (T - (array[i] * 0.006)))
        ans_num = i + 1
print(ans_num)

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

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

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

m = 0.006
candidate_num = 0

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

Solution (Python):
n = int(input())
t, a = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

m = min(h, key=lambda x: abs(t - x * 0.006- a))
print(h.index(m)+1)

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

avet=[]
for c in h:
  avet.append(abs((t-6/1000*c)-a))



for i in range(n):
  if avet[i] == min(avet):
    ans = i+1
print(ans)

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

H_ = [abs(A-(T-0.006*h)) for h in H]

temp = 10**7
ans = 1

for i in range(N):
    if H_[i] < temp:
        temp = H_[i]
        ans = i+1
print(ans)

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

temps = [abs(a - (t - h * 0.006)) for h in hs]

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

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

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

An = [abs(A - (T - 0.006*i)) for i in Hn]
print(An.index(min(An))+1)

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

An = [T - 0.006*i for i in Hn]

tp = [10000000]*(N+1)
tpa = N
for i in range(N):
  tp[i] = abs(A - An[i])
  tpa = i if tp[i] < tp[tpa] else tpa

print(tpa+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
S=list(map(int,input().split()))
ans = -1
minsa = 10**10
for point,s in enumerate(S):
  sa = (t-s*0.006 - a)**2
  if minsa > sa:
    minsa = sa
    ans = point

print(ans+1)

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

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

Solution (Python):
import numpy as np
N = int(input())

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

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

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

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

p=0
m=10**10

for i in range(N):
  d=abs(A-(T-0.006*H[i]))
  if d < m:
    m=d
    p=i+1
    
print(p)

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

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

def T(x):
  return t - x*0.006

lis = []
for i in range(n):
  lis.append(abs(a-T(h[i])))
print(1+lis.index(min(lis)))

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

Solution (Python):
n = int(input())
t, a = map(int, input().split())
cand = []
xs = list(map(int, input().split()))
for i in range(n):

    temp = t - xs[i] * 0.006
    cand.append(abs(a - temp))
copy = cand[:]
cand.sort()
print(copy.index(cand[0]) + 1)

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

Solution (Python):



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


ans = 0
min_ave_temp = T - H[0] * 0.006
for i in range(1, N):
    ave_temp = T - H[i] * 0.006
    if abs(A - ave_temp) < abs(A - min_ave_temp):
        ans = i
        min_ave_temp = ave_temp


print(ans + 1)

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

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

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

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

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

ans = 0
difmin = 10**7

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

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

ans = 0
difmin = float("inf")

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

Solution (Python):
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
before=math.fabs(t-h[0]*0.006-a)
num=1
for i in range(n-1):
  diff=before-math.fabs(t-h[i+1]*0.006-a)
  if diff>0:
    before=math.fabs(t-h[i+1]*0.006-a)
    num=i+2
print(num)

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

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

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

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

print(ans)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))
ts = [t - 0.006 * h for h in hs]

temp = int(10**9)
res = 0
for i, t in enumerate(ts):
    d = abs(a - t)
    if d < temp:
        res = i
        temp = d
print(res + 1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
points = map(int, input().split())
result = 0
_min = None
for i, p in enumerate(points):
    temp = t - p * 0.006
    diff = abs(a - temp)
    if _min is None or _min > diff:
        _min = diff
        result = i + 1
print(result)

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

Solution (Python):
import sys
N = int(sys.stdin.readline())  
T, A = map(int, sys.stdin.readline().strip().split())  
H = list(map(int, sys.stdin.readline().strip().split()))

ans = 0


gosa = 1e+9

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

print(ans+1)

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

Solution (Python):
n = int(input())
t,a = map(int, input().split())
h = map(int, input().split())
x = {abs(a-(t-i*0.006)): j for j,i in enumerate(h)}
print(x[min(x)]+1)

Solution (Python):
n = int(input())
t,a = map(int, input().split())
h = list(map(lambda x: abs(a-(t-(x*0.006))),map(int, 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()))
D_Temp_H = [abs(a-t+0.006*x) for x in H]
print(D_Temp_H.index(min(D_Temp_H))+1)

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

T_1 = T - 0.006 * int(H[0])
diff = abs(T_1 - A)
index = 1
for i in range(1, N):
    T_new = T - 0.006 * int(H[i])
    diff_new = abs(T_new - A)
    if diff_new < diff:
        diff = diff_new
        index = i + 1
        
print(index)

Solution (Python):

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

ave = 0
tmp = 0
ans_t = 10**5
ans = 0
for i in range(N):
    ave = T - H[i]*0.006
    tmp = abs(A - ave)
    if ans_t > tmp:
        ans_t = tmp
        ans = i + 1
    else:
        pass

print(ans)

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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
I = min(range(N), key=lambda i: abs(T-Hs[i]*0.006-A))
r = I+1
print(r)

Solution (Python):
N=int(input())
T,A=map(int, input().split())
H=[abs(A-(T-(int(i)*0.006))) for i 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()))
c=10000000
n=0
for i in range(N):
  d=abs(A-(T-(H[i]*0.006)))
  if c>d:
    c=d
    n=i+1
print(n)

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

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

Solution (Python):
import numpy as np
N = int(input())
T,A = map(int, input().split())
Hs = input().split()
for i in range(N):
  Hs[i] = int(Hs[i])
Hs = np.array(Hs)

Ts = T - Hs*0.006

Ts_A = np.abs(Ts - A)

print(np.argmin(Ts_A)+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)):
        ans=i
        tmp=abs(a-(t-h[i]*0.006))
print(ans+1)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
lst = list(map(int, input().split()))
x = 10**9
loc = 0
for i in range(N):
    a = abs(A-T+0.006*lst[i])
    if a < x:
        loc = i
        x = a
print(loc+1)

Solution (Python):
N = int(input())
T, A = map(int, input().split(" "))
arr = list(map(int, input().split(" ")))
near = 100000
index = 1

for i in range(N):
  avg = T - arr[i] * 0.006
  avg_sub = A - avg
  
  if avg_sub < 0:
    avg_sub *= -1
  if near > avg_sub:
    near = avg_sub
    index = i + 1

print(index)

Solution (Python):
import math

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

distance = float('inf')
answer = 0
for i, h in enumerate(H, 1):
    d = abs(A - (T - h * 0.006))
    distance = min(d, distance)
    if distance == d:
        answer = i

print(answer)

Solution (Python):
N = int(input())
T,A=map(int,input().split())
h_list =list(map(int,input().split()))
dif_list = [abs(A-(T-x*0.006)) for x in h_list]
mn =min(dif_list)
for i in range(N):
	if mn == dif_list[i]:
		break
print(i+1)

Solution (Python):
N=int(input())
T,A=map(int,input().split())
height_list =list(map(int,input().split()))
val =10000
site=0
for i in range(N):
	dif=T-0.006*height_list[i]
	if abs(A-dif)<=val:
		val = abs(A-dif)
		site = i
print(site+1)

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

Solution (Python):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
z = [abs(a-(t-x*0.006)) for x 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()))
m = []
for i in range(n):
  m.append(abs(a - (t - h[i]*0.006)))
print(m.index(min(m))+1)

Solution (Python):

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

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

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

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
temp = 10**10
ans = 0
for i in h:
    avet = t - i*0.006
    if temp > abs(avet-a):
        temp = abs(avet-a)
        ans = h.index(i)+1
print(ans)

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

ans = 0
tmp = 1000
for i, h in enumerate(H):
    k = abs(A - (T - h * 0.006))
    if k < tmp:
        tmp = k
        ans = i

print(ans + 1)

Solution (Python):
N = int(input())
T,A = map(int,input().split())
HList = list(map(int,input().split()))
AList = list(map(lambda x: abs((T-x*0.006)-A),HList))
min1 = min(AList)
print( AList.index(min1) + 1)

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

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

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

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

z =  [abs(T-0.006*i-A) for i in H_list]
print(z.index(min(z))+1)

Solution (Python):

N = int(input())
T,A = map(int,input().split())
def calc(A):
  return((T - A) / 0.006)

H = list(map(int,input().split()))
x = calc(A)
ans=max(H) - x
for i in range(N):
  if abs(H[i] - x) < abs(ans):
    ans = H[i] - x
    
ans = int(ans + x)
print(H.index(ans)+1)

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

Solution (Python):
N,T,A,*H = map(int, open(0).read().split())
B=[]
ans = -1;
minim = 10000000000000000;
for i in range(N):
  B.append(T - H[i] * 0.006)
for i in range(N):
  if(abs(B[i]-A) < minim):
    ans = i+1
    minim = abs(B[i]-A)

print(ans)

Solution (Python):
N=int(input())
T,A=map(int, input().split(' '))
H=list(map(lambda h : T - float(h) * 0.006 , input().split(' ')))

ans = -1
min = 1000000000
for i in range(len(H)):
  dif=abs(A - H[i])
  if dif < min:
    ans = i + 1
    min = dif
print(ans)

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

minT = 651
ans = 1

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

Solution (Python):
n = int(input())
t, a = map(int, input().split())
H = [abs(t-int(h)*0.006-a) 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()))
dmin = 10**5
ans = 0
for i in range(n):
    d = abs(a - (t - h[i] * 0.006))
    if d < dmin:
        dmin = d
        ans = i
print(ans + 1)

Solution (Python):


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

import numpy as	np

ans = (T-A) / 0.006

h = np.abs(np.array(list(map(int, input().split()))) - ans)

print(np.argmin(h) + 1)

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

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

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

arr = [abs(A - (T - Hs[i] * 0.006)) for i in range(N)]
print(arr.index(min(arr)) + 1)

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

i = 0
d_min = 1000

for j, h in enumerate(map(int, input().split())):
  d = abs(t - h * 0.006 - a)
  if d < d_min:
    d_min = d
    i = j

else:
  print(i+1)

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

before = max(h)
ans = 0
i = 0
for i in range(n):
  if abs(h[i]-x) < before:
    before = abs(h[i]-x)
    ans = i+1
print(ans)

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

tmp = 10 ** 9 + 7
ind = -1

for i, j in zip(H, list(range(1, N + 1))):
    c_tmp = abs(A - T + i * 0.006)
    if c_tmp < tmp:
        tmp = c_tmp
        ind = j
print(ind)

Solution (Python):
N = int(input())
L = list(range(1, N + 1))
T, A = map(int, input().split())
H = list(map(int, input().split()))
tmp = 10 ** 9 + 7
ind = -1
for i, j in zip(H, L):
    if abs(A - T + i * 0.006) < tmp:
        tmp = abs(A - T + i * 0.006)
        ind = j
print(ind)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = 999 
p = 0 
for i in range(len(H)):
  if t > abs(A - T + H[i]*0.006):
    t = abs(A - T + H[i]*0.006)
    p = i+1
print(p)

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

Solution (Python):
N=int(input())
T,A=map(int,input().split())
h=list(map(int,input().split()))
s=[]
for i in range(N):
  a=T-h[i]*0.006
  if a>=A:
    b=a-A
    s.append(b)
  elif a<A:
    b=A-a
    s.append(b)
f=min(s)
o=s.index(f)
print(o+1)

Solution (Python):
n = int(input())
t,a = [int(i) for i in input().split()]
h =  [int(i) for i in input().split()]

h2 = [abs(t -(i*0.006)-a) for i in h]
print(h2.index(min(h2)) + 1)

Solution (Python):
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
t, a = na()
hhh = na()
tmp = 100000000
for i, h in enumerate(hhh):
    dif = abs(t - h * 0.006 - a)
    if dif < tmp:
        ans = i + 1
        tmp = dif
print(ans)

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

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

Solution (Python):


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

S=[((T-i*0.006)-A)**2 for i in H]


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

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

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

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

s = []

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

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

Solution (Python):


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

temps = {}
for i in range(len(heights)):
    temp = t - heights[i] * 0.006
    temps[i] = abs(a - temp)

ranking = sorted(temps.items(), key = lambda x: x[1])

print(ranking[0][0] + 1)

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

Solution (Python):
n=int(input())
T, A = map(int,input().split())
H=list(map(int,input().split()))
ans=A-(T - H[0]* 0.006)
place=1
for i in range(1,n):
    if abs(ans)>abs(A-(T - H[i]* 0.006)):
        ans=A-(T - H[i]* 0.006)
        place=i+1
print(place)

Solution (Python):
N = int(input())

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

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

box = []

for x in H:
    tmp = T - x*0.006
    ans = abs(A-tmp)
    box.append(ans)
    
print(box.index(min(box))+1)

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


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

index = None
min_diff = float('inf')
for i in range(n):
    diff = abs(temp(t, hs[i]) - a)
    if diff < min_diff:
        min_diff = diff
        index = i
print(index + 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] = abs(a - (t - h[i] * 0.006))
tmp = float("inf")
ans = float("inf")
for i in range(n):
    if tmp > h[i]:
        tmp = h[i]
        ans = i + 1
print(ans)

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

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

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

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

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

Solution (Python):
import numpy as np

N = int(input())

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

def getTemp(T,h):
  return T - (h * 0.006)

def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx + 1

lst = list(map(int,input().split()))
anslist = []

for i in lst:
  tmp = getTemp(T,i)
  anslist.append(tmp)

print(int(getNearestValue(anslist,A)))

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
H = [abs(t-a-x * 6e-3) for x in h]
print(1 + H.index(min(H)))

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

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

print(j+1)

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

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

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

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

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

place=0
degree=10000000000
for i,h in enumerate(hs):
  if degree>abs(a-(t-h*0.006)):
    degree=abs(a-(t-h*0.006))
    place=i
print(place+1)

Solution (Python):

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

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

min_diff = float('inf')
ans = 0
for i in range(1,len(H)+1):
  diff = abs(T - H[i-1]*0.006 - A)
  if diff < min_diff:
    min_diff = diff
    ans = i

print(ans)

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

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

temp = [T-_*0.006 for _ in H]
li = [abs(A-_) for _ in temp]

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

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

    ans = float('inf')
    cnt = 0
    for i, h in enumerate(H):
        tmp = abs(A - (T - h * 0.006))
        if ans > tmp:
            ans = tmp
            cnt = i + 1

    print(cnt)


main()

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

at=list(map(lambda x:abs(a-(t-x*0.006)), h))

print(at.index(min(at))+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
minn = 10**5
for i in range(n):
    dif = abs(a-H[i])
    if dif == min(minn,dif):
        minn = dif
        p = i
print(p+1)

Solution (Python):
N = int(input())
T,A = map(int,input().split())
H = [int(x) for x in input().split()]
H_optim = (T-A)/0.006
_min = 1145141919
H_result = 1
for i,x in enumerate(H):
    if abs(x-H_optim) < _min:
        _min = abs(x-H_optim)
        H_result = i+1
print(H_result)

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

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

Solution (Python):
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
hl=[]
ttl=[]
for x in h:
    tt = t-(x*0.006)
    hl.append(tt)


for y in hl:
    result = abs(a-y)
    ttl.append(result)

rel=ttl.index(min(ttl))
print(rel+1)

Solution (Python):
N = int(input())
T,A = map(int,input().split())
Hn = list(map(int,input().split()))
minnum = 10**9
minindex = 0
for h in range(len(Hn)):
    if minnum>abs((T-Hn[h]*0.006)-A):
        minnum = abs((T-Hn[h]*0.006)-A)
        minindex = h
print(minindex+1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
H = map(int, input().split())
H = list(enumerate(H))
suitability = lambda x: abs(t - x[1] * 0.006 - a)
print(min(H, key=suitability)[0] + 1)