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

"""
Created on Sun Nov  4 18:53:53 2018
ABC113B
@author: maezawa
"""

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

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

near = min(dif)
ans = dif.index(near)+1

print(ans)

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

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

Solution (Python):
n = int(raw_input())
T,A = map(int, raw_input().split())

H = map(int, raw_input().split())

Htemp = []
for i in H:
	subs = abs(A - (T-i*0.006))
	Htemp.append(subs) 

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

Solution (Python):
inputs =  input()
inputs =  list(map(int, input().split()))
T = inputs[0]
A = inputs[1]
H =  list(map(int, input().split()))

minAveTemp = 999999999
num = 1
ansNum = 1
for height in H:
    aveTemp = T - height * 0.006
    if abs(A-minAveTemp) > abs(A-aveTemp):
        minAveTemp = aveTemp
        ansNum = num
    num+=1

print(ansNum)

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

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

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

ans=0
t_ans=0

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

print(ans)

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

h = [0] * n

h = input().split()

mini = abs((t - float(h[0]) * 0.006) - a)

ans = 1

for i in range(2, n + 1):
  diff = abs((t - float(h[i - 1]) * 0.006) - a)
  if diff < mini:
    ans = i
    mini = diff

print(ans)

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

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

ans = 1
palace = abs(T - H[0]*0.006 -A)
for i,h in enumerate(H):
    t = T - h*0.006
    if abs(A - t) <= palace:
        ans = i+1
        palace = abs(A-t)
        
print(ans)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
Y = []
for i in range(n):
    tmp = t - H[i]*0.006
    Y.append(abs(tmp-a))
miny = Y[0]
for item in Y:
    miny = min(miny, item)
res = Y.index(miny)
print(res+1)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
t=l[0]
a=l[1]
ll=list(map(int,input().split()))

q=0
d=abs(t-ll[0]*0.006-a)
for i in range(1,n):
    if abs(t-ll[i]*0.006-a)<d:
        q=i
        d=abs(t-ll[i]*0.006-a)
print(q+1)

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

HList = [int(i) for i in input().split()]

score = 99999
position = 1
result = 1
for h in HList :
    avg = T - (h * 0.006)
    if(abs(avg - A) < score) :
        score = abs(avg - A)
        result = position
    position+=1
        
print(result)

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

c = H[0]
for i in range(1,N):
    if abs(T - H[i] * 0.006 - A) < abs(T - c * 0.006 - A):
        c = H[i]
print(H.index(c)+1)

Solution (Python):
import collections
import scipy.misc
import sys
import numpy as np
from operator import itemgetter

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())
"""

N = int(input())
T, A = map(float, input().split())
H = [0.]*N
H[:] = map(float, input().split())


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

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

for i in range(len(hs)):
    b = t - hs[i] * 0.006
    sa = abs(a-b)
    hs[i] = sa

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

Solution (Python):
import numpy as np



n = int(input())
t, a = map(int, input().split())
h = np.array(list(map(int, input().split())))
h2 = abs((t-h*0.006) - a)
res = np.where(h2==min(h2))[0][0] + 1

print(res)

Solution (Python):


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

Solution (Python):
N = int(input())
t, h = map(int, input().split())


L = []

a = list(map(int, input().split()))
for i in a:
    L.append(abs(h - (t - i * 0.006)))

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

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

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

h_sub = sorted(h)
print(h.index(h_sub[0])+1)

Solution (Python):
a = input()
b = input().split()
c = input().split()
a = 100000
kekka = 0
for i in range(len(c)):
  ave = int(b[0]) - int(c[i]) * 0.006
  sa  = int(b[1]) - ave
  if sa < 0:
    sa *= -1
  if sa < a:
    a = sa
    kekka = i + 1
    
print(kekka)

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


H=(T-A)/0.006

l=list()
for i in range(N):
   lx=abs(h[i]-H)
   l.append(lx)
x=min(l)
print(l.index(x)+1)

Solution (Python):



def Palace():
    input()
    T, A = [int(n) for n in input().split()]
    candidate = [int(n) for n in input().split()]

    index = 1
    _min = float('inf')
    for i, elevation in enumerate(candidate, start=1):
        temp = T - elevation * 0.006
        diff = abs(A - temp)
        if diff < _min:
            _min = diff
            index = i

    print(index)


if __name__ == '__main__':
    Palace()

Solution (Python):
import numpy as np

n = input()
n= int(n)
ta = input()
t,a = ta.split()
t = int(t)
a = int(a)
H = input()
H = H.split()
dif = [i for i in range(n)]
for i in range(len(H)):
    dif[i] = int(H[i])
    dif[i] = abs(t-dif[i]*0.006-a)

d = np.array(dif)
print(np.argmin(d)+1)

Solution (Python):
import math

def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    i = 1
    for Hi in H:
        Hi_t = T - Hi * 0.006
        temp = math.fabs(A - Hi_t)
        if i == 1:
            result = temp
            answer = i
        else:
            if result > temp:
                result = temp
                answer = i
        i += 1

    print(answer)


if __name__ == "__main__":
    main()

Solution (Python):

n=int(input())
a,b=map(int,input().split())
c=list(map(int,input().split()))
mi=(10000000000,-1)
for i in range(len(c)):
	mi=min(mi,(abs(a-c[i]*0.006-b),i))
print(mi[1]+1)

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

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

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

HA = (T-A)/0.006

dH = 100000
point = 100000

for i in range(N):
  if dH > abs(float(H[i]) - HA):
    dH = abs(float(H[i]) - HA)
    point = i+1

print(point)

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

ans = 0
v = 10000000
for i in range(n):
    if v>=abs(A - (T-0.006*H[i])):
        ans = i + 1
        v = abs(A - (T-0.006*H[i]))
print(ans)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
i = 0
nums = [0, 10**6]

for h in list(map(int, input().split())):
    i += 1
    if abs(a - (t-h*0.006)) < abs(a - (t - nums[1]*0.006)):
        nums = [i, h]

print(nums[0])

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

min_tempdiff = 10000  
argmin_tempdiff = None
for i, h_val in enumerate(h_list):
    temp_diff = abs(a - (t - h_val * 0.006))
    if min_tempdiff > temp_diff:
        min_tempdiff = temp_diff
        argmin_tempdiff = i + 1  

print(argmin_tempdiff)

Solution (Python):
N = int(input())
temp = input().rstrip().split(" ")
T = int(temp[0])
A = int(temp[1])
temp = input().rstrip().split(" ")
ans = []
for i in range(N):
    
    H = int(temp[i])
    AVG = T - H * 0.006
    DIF = A - AVG
    ans.append(DIF * DIF)
print(ans.index(min(ans))+1)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = temp
        tmpa = i
print(tmpa + 1)

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

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


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


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

Solution (Python):
def main():
    N = input()
    T, A = map(int, raw_input().split())
    H = [abs((T - int(ele) * 0.006) - A) for ele in raw_input().split()]

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


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
mindT = float("inf")
for i in range(N):
  if abs(T-0.006*H[i]-A) < mindT:
    ans = i+1
    mindT = 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()))
Temp = [0]*N

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

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

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

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

l = [abs(A - t(h)) for h in H]

a = min(l)

cnt = 1
for x in l:
    if a == x:
        print(cnt)
    else:
        cnt += 1

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


def c(T,X,A):
    return abs(A-(T-X*0.006))

h2 = []
ii = 1
for val in h:
    h2.append((ii, c(t, val, a)))
    ii = ii + 1

result = 1
minn = 10000000
for num , val in h2:
    if minn > val :
        minn = val
        result = num

print(result)

Solution (Python):
import sys

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

ans_a = sys.maxsize

for i, h in enumerate(H):
    num = i + 1
    tmp = abs(t - h * 0.006 - a)
    if ans_a > tmp:
        ans_a = tmp
        ans = num
    

print(ans)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
h=[abs(t-(int(i)*6/1000)-a) for i in 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()))

x = 1000/6 * (t - a)

idx = np.argmin([abs(hi - x) for hi in h])

print(idx + 1)

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

Solution (Python):
N = int(input())
T,A = map(int,input().split())
best = float("inf")
bestidx = 1

H = [float(i) for i in input().split()]

index = 1
for i in H:
    cantidate = abs(A - (T - i * 0.006))
    if cantidate < best:
        bestidx = index
        best = cantidate
    index += 1
print(bestidx)

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

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

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

Solution (Python):
def calc_temp(T, x):
    return T - x * 0.006
    
def main():
    num_palace = int(input().rstrip())
    T, A = list(map(int, input().rstrip().split()))
    h_list = list(map(int, input().rstrip().split()))
    temp_list = []
    for h in h_list:
        temp_list.append(abs(calc_temp(T, h) - A))
    
    
    print(temp_list.index(min(temp_list)) + 1)
    
if __name__ == '__main__':
    main()

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

n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
for i in range(n):
    l[i]=abs(a-t+0.006*l[i])
    
b=10**3   
for i in range(0,n):
    b=min(b,l[i])
print(l.index(b)+1)

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

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

print(ans)

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

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

Solution (Python):


if __name__ == "__main__":
    n = int(input())
    dum = list(map(int, input().split()))
    t, a = dum[0], dum[1]
    h = list(map(int, input().split()))

    diff = [0. for _ in range(n)]
    for i in range(n):
        temp = t - (h[i]*0.006)
        diff[i] = abs(a - temp)

    target = min(diff)
    flag = 0
    for i in range(n):
        if diff[i] == target:
            flag = i+1

    print(flag)

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

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

print(ans)

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

print(mins+1)

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

p = 0
ans = 9999999999
for i in range(n):
    at = t - h[i]*0.006
    if(abs(at-a) < ans):
        ans = abs(at-a)
        p = i+1

print(p)

Solution (Python):
import numpy as np

def main():
	n = int(input())
	buf = input().split()
	t = int(buf[0])
	a = int(buf[1])
	buf = input().split()
	ond = np.zeros(n)
	for i in range(n):
		ond[i] = t - int(buf[i])*0.006
	ttn = np.argmin(np.abs(ond-a))
	
	print(ttn+1)
	
	
main()

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

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

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

print(ans)

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

Solution (Python):



n = int(input().strip())
i = input().split(' ')
t = int(i[0])
a = int(i[1])
hs = input().split(' ')
an = list(map(lambda x:t-int(x)*0.006, hs))
diffs = list(map(lambda a_:abs(a-a_), an))
diffs_sorted = sorted(diffs)
print(diffs.index(diffs_sorted[0])+1)

Solution (Python):
import sys

N = int(raw_input())
T, A = map(int, raw_input().split())
H_list = map(int, raw_input().split())

average_diff = sys.float_info.max
min_i = None

for i, H in enumerate(H_list):
    tempature_diff = abs(A - (T - H*0.006))
    if tempature_diff < average_diff:
        average_diff = tempature_diff
        min_i = i
print min_i + 1

Solution (Python):
from sys import stdin

N = int(stdin.readline().rstrip())
T, A = [int(a) for a in stdin.readline().rstrip().split()]
H = [int(a) for a in stdin.readline().rstrip().split()]

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

print(ans + 1)

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

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

ans = 0
for i, h in enumerate(H):
    tmp = calc(T, h)
    if abs(A-tmp) < abs(A - calc(T, H[ans])):
        ans = i
print(ans+1)

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

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

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

for i in range(N):
    T_tmp = T - H_list[i]*0.006
    T_list.append(T_tmp)

def f1(tmp):
    return abs(tmp-A)

T_list2 = list(map(f1, T_list))

min_index = T_list2.index(min(T_list2))
print(min_index + 1)

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

ans = -1
dif = 10 ** 20

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

print(ans + 1)

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

h_ = [t - x*0.006 for x in h]

ans = 0
d = float('inf')
for i,x in enumerate(h_):
    d_ = abs(a - x)
    if d > d_:
        d = d_
        ans = i+1

print(ans)

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

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

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

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



temp_t = T -0.006*array[0]
temp_n = 0
for i in range(len(array)):
    temp_i = T-0.006*array[i]
    if abs(temp_t - A) > abs(temp_i -A):
        temp_t = temp_i
        temp_n = i


print temp_n+1

Solution (Python):
def abs(x):
    if x >0:
        return x
    else:
        return -x

N = int(input())
t_a = input()
T_A = t_a.split()
T = int(T_A[0])
A = int(T_A[1])
h = input()
H = h.split()
for i in range (0,N):
    H[i] = int(H[i])

p = 0
    
for j in range (1,N):
    if abs(A - (T - 0.006*H[j])) < abs(A - (T - 0.006*H[p])):
        p = j
        
print(p+1)

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

sub = 1000000
for i in range(N):
    temp = T - H[i]*0.006
    nsub = abs(A-temp)
    if sub > nsub:
        sub = nsub
        ans = i

print(ans+1)

Solution (Python):

def solve():
    N = int(input())
    T, A = map(int, input().split())
    i = sorted(list((abs(T - A - x*0.006),i) for i, x in enumerate(map(int, input().split()), start=1)))[0][1]
    return str(i)
    
if __name__ == '__main__':
    print(solve())

Solution (Python):
num = input()
a = input().split()
a = [int(i) for i in a]
b = input().split()
b = [abs(a[0] - int(i) * 0.006 - a[1]) for i in b]
print(1 + b.index(min(b)))

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

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

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

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

print(ans+1)

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

h_min = 1000000000000
i_min = 0
for i, h in enumerate(hs):
    if abs(a - (t - 0.006 * h)) < h_min:
        h_min = abs(a - (t - 0.006 * h))
        i_min = i + 1
print(i_min)

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

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

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

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

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

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

temps = [abs(temp(i) - a) for i in points]
minp = min(temps)

j = 0
while (temps[j] != minp):
    j += 1
    
print(j+1)

Solution (Python):
N = int(input())
T ,A = map(int, input().split())
Hs = list(map(int, input().split()))
p = 0
dtmin = abs(A-(T -Hs[0]*0.006))
for i in range(N):
    h = Hs[i]
    dt= abs(A-(T -0.006*h))
    if dt < dtmin:
        dtmin = dt
        p = i
print(p+1)

Solution (Python):


import sys
import itertools
import math

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

d=[(abs((T*1000-h*6)-A*1000),i+1) for i,h in enumerate(H)]

print(min(d)[1])

Solution (Python):
n = int(input())
t,a = map(int, input().split())
h = map(int, input().split())
index = 0
minh = 100000
for e,i in enumerate(h):
    nowh = abs(a-(t-i*0.006))
    if minh > nowh:
        minh = nowh
        index = e
print(index+1)

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

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()))
b = []
for i in range(n):
    d = abs((t - 0.006 * h[i]) - a)
    b.append(d)
j = min(b)
print((b.index(j)) + 1)

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

ans = 0
temp = 500000
for i in range(n):
    c = t - (h[i] * 0.006)
    if abs(c - a) < temp:
        temp = abs(c - a)
        ans = i

print(ans + 1)

Solution (Python):
n = int(input())
data = input().split(' ')
data[0], data[1] = int(data[0]), int(data[1])

H = input().split(' ')

m = 1000
j = 0
for i in range(len(H)):
  t = data[0] - (int(H[i]) * 0.006)
  if m > abs(data[1] - t):
    m = abs(data[1] - t)
    j = i
    
print(j + 1)

Solution (Python):
iN = int(input())
iT,iA = [int(_) for _ in input().split()]
aH = list(map(lambda x: abs(iT-x*0.006 -iA) , [int(_) for _ in input().split()]))
iMin = min(aH)
for i in range(iN):
    if aH[i] == iMin :
        print(i+1)
        exit()

Solution (Python):
n = int(input())
t,a = input().split()
h = input().split()
t = int(t)
a = int(a)
dist = 100000000000000
for i in range(n):
    temp = t - 0.006 * int(h[i])
    if abs(temp - a) < dist:
        dist = abs(temp - a)
        mem = i + 1
print(mem)

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

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

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

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

T2=[]
for x in H:
	T2.append(T-x*0.006)


ans=""
diff=10**8
for idx,x in enumerate(T2):
	t=abs(A-x)
	if t<diff:
		diff=t
		ans=idx+1

print ans

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

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = [int(m) for m in input().split()]
ar = []
for j in range(n):
    ar.append(abs(t - h[j] * 0.006 - a))

co = ar.index(min(ar)) + 1
print(co)

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

cnt = 1
ans = 0
temp = 1000000
for h in H:
    if abs(A - (T-h*0.006)) < temp:
        temp = abs(A - (T-h*0.006))
        ans = cnt
    cnt += 1
print(ans)

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

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

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

T,A = [int(i) for i in input().split()]


H = [int(i) for i in input().split()]

ans = 0

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

Solution (Python):


def main():
    N = int(raw_input())
    T, A = map(int, raw_input().split(" "))
    H = map(int, raw_input().split(" "))
    retval = 0
    min_diff = 1000
    for i in xrange(N):
        temp = T - H[i] * 0.006
        diff = abs(A - temp)
        if diff < min_diff:
            min_diff = diff
            retval = i + 1
    print retval

if __name__ == '__main__':
    main()

Solution (Python):


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

mind = float('inf')
minn = 0
for i in range(len(h)):
    avg = t - h[i] * 0.006
    div = abs(a - avg)
    if div < mind:
        mind = div
        minn = i + 1

print(minn)

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

    min_abs = sys.maxsize
    min_abs_idx = -1
    for idx, item in enumerate(h):
        tmp_tmp = t - item * 0.006
        tmp_abs = abs(tmp_tmp - a)
        if tmp_abs < min_abs:
            min_abs = tmp_abs
            min_abs_idx = idx

    print(min_abs_idx + 1)
    return

main()

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

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

a *= 1000
t *= 1000

d = abs(t - h[0]*6 - a)
ans = 0
for i in range(n):
    td = abs(t - h[i]*6 - a)
    if td < d:
        d = td
        ans = i

print(ans + 1)

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

Solution (Python):
import numpy as np

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

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

Solution (Python):
N = int(input())
B = input().split(' ')
T = int(B[0])
A = int(B[1])
H = [int(x) for x in input().split(' ')]

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

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

Solution (Python):
n = int(input())
t,a = (int(i) for i in input().split(' '))
h = [abs((t - int(i) * 0.006) - a) 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()))
tmp = 10 ** 10
for i in range(N):
    if tmp > abs(A - T + H[i]*0.006):
        tmp = abs(A - T + H[i]*0.006)
        res = i
print(res+1)

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

min_A = 100000
min_num = 0
for i in range(len(H)):
    t = T - H[i] * 0.006
    if min_A > abs(t - A):
        min_A = abs(t - A)
        min_num = i + 1

print(min_num)

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

temp=[]
dif_min=9999999
for i in range(N):
    temp.append(T-0.006*H[i])
for i in range(N):
    if(abs(abs(temp[i])-abs(A))<dif_min):
        dif_min=abs(temp[i]-A)
        ans=i
print(ans+1)

Solution (Python):


import numpy as np

if __name__ == '__main__':
    N = int(input())
    T, A = map(int, input().split(' '))
    H = [int(h) for h in input().split(' ')]

    t_diff = np.array([abs((T - h * 0.006) - A) for h in H])
    print(t_diff.argmin() + 1)

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

res = - 1
res_val = 100000
for i in range(N):
    av_temp = T - H[i] * 0.006
    if res_val > abs(av_temp - A):
        res = i
        res_val = abs(av_temp - A)

print(res+1)

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

sa = 100000000000
index = 0

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

print(index)

Solution (Python):
N = int(input())
T, A = [int(a) for a in input().split()]
best_h = (T - A) / 0.006
H_list = [abs(int(a) - best_h) for a in input().split()]
h = min(H_list)
ret = H_list.index(h) + 1
print(str(ret))

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

Solution (Python):
n = int(raw_input())
T, a = map(int, raw_input().split())
h = map(int, raw_input().split())

def avgt(t, x):
	return t - x * 0.006

res = 10000000.00
idx = 0
for i in xrange(n):
	val = avgt(T, h[i])
	if abs(val - a*1.00) < res:
		res = abs(val-a)
		idx = i
print idx+1

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