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())
l = list(map(int, input().split()))
ans = 0
minNum = float('inf')

for i in range(len(l)):
    num = t - l[i] * 0.006
    if abs(num - a) < minNum:
        minNum = abs(num -a)
        ans = i + 1
print(ans)

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

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  

N = I()
T,A = MI()
H = [abs(T-i*0.006-A) for i in LI()]
m = min(H)
print(H.index(m)+1)

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

Solution (Python):
N = int(input())
T,A = [int(i) for i in 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()))
l = [T - h*0.006 for h in H]
print(l.index(min(l, key=lambda v: abs(A - v))) + 1)

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

result = -1
min_value = 10 ** 9
for i, h in enumerate(heights):
  temp = abs(a - (t - h * 0.006))
  if temp < min_value:
    result = i + 1
    min_value = temp
    
print(result)

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

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

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

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

Solution (Python):

 

 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy


 











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

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

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


print(ans+1)

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

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

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

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

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

x = 10000000
s = 0

for i in range(n):
    if abs((t * 1000 - h[i] * 6) - (a * 1000)) < x:
        s = i+1
        x = abs((t * 1000 - h[i] * 6) - (a * 1000))

print(s)

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

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

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

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

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

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

H_gap = list(map(lambda x: abs(T - x * 0.006 - A), H))
place_num = H_gap.index(min(H_gap)) + 1
print(place_num)

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

Solution (Python):
import sys



def input():
    return sys.stdin.readline().rstrip()


def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    lc= 10**6

    for i in range(N):
        c = T - H[i] * 0.006
        if abs(A-c)<lc:
            lc=abs(A-c)
            n= i

    print(n+1)




if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
t,a=list(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):



import math

def resolve():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip())
    t, a = [int(x) for x in input().rstrip().split(" ")]

    min_diff = float('inf')

    for i, h in enumerate(input().rstrip().split(" ")):
        h = int(h)

        temp = t - h * 0.006
        diff = abs(temp - a)
        if min_diff > diff:
            min_diff = diff
            ans = i+1

    print(ans)


if __name__ == "__main__":
    resolve()

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

Solution (Python):
n = int(input())
t, a = map(int,input().split())
beta = 0.006
H = list(map(int,input().split()))
import numpy as np 
H = np.array(H) 
use = t - beta * H - a 
use = use**2 
pre_answer = min(use)
use = list(use) 
ans = 1 + use.index(pre_answer) 
print(ans)

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

min_abs = float("inf")

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    diff = INF
    for i, h in enumerate(H, 1):
        if diff > abs(T - h * 0.006 - A):
            diff = abs(T - h * 0.006 - A)
            ans = i

    print(ans)
    return


if __name__ == '__main__':
    main()

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(1+x.index(min(x)))

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

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

x = []

for i in h:
    b = abs(t - 0.006 * i - a)
    x.append(b)

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

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

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

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

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


def read():
    N = int(input().strip())
    T, A = map(int, input().strip().split())
    H = list(map(int, input().strip().split()))
    return N, T, A, H


def solve(N, T, A, H):
    ans = -1
    vmin = 10**7
    for i in range(N):
        h = H[i]
        v = abs(T - h * 0.006 - A)
        if vmin > v:
            ans = i
            vmin = v
    return ans+1


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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

min_t = 10**5
min_i = 0

for i in range(N):
    t = abs(A - (T - H[i]*0.006))
    if t <= min_t:
        min_t = t
        min_i = i


print(min_i+1)

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

ans = []

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

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

	lst = [1000] * N

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

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


  
if __name__ == "__main__":
  	main()

Solution (Python):

n=int(input())
t,a=map(int,input().strip().split(" "))
ar=[abs(t-(0.006*(int(i)))-a) for i in input().strip().split(" ")]
k=min(ar)
print(ar.index(k)+1)

Solution (Python):









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

ans = []


for i in range(n):
    tmp = t-h[i]*0.006
    ans.append([i+1,abs(a-tmp)])

ans.sort(key=lambda x:x[1])
print(ans[0][0])

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

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

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

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

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

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

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

    mindiff = pow(10, 6)
    for i in range(N):
        temprature = T - 0.006*H[i]
        diff = abs(temprature - A)
        if diff < mindiff:
            ans = i+1
            mindiff = diff
    
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import sys

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    t, a = nm()
    H = nl()
    D = list(map(lambda x: abs(a - (t - x * 0.006)), H))
    print(D.index(min(D)) + 1)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    t, a = nm()
    H = nl()
    D = list(map(lambda x: abs(a - (t - x * 0.006)), H))
    print(D.index(min(D)) + 1)


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import numpy as np


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    n = ni()
    t, a = nm()
    H = nl()
    T = np.array(list(map(lambda x: t - x * 0.006, H)))
    D = np.abs(a - T)
    S_i = sorted(range(0, n), key=lambda x: D[x])
    print(S_i[0] + 1)


if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

Solution (Python):
"""
半ば強引に二分探査で書いた。
"""

n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
h_not_sorted = h
h = sorted(h)
x = abs((t - a) / 0.006)


l = 0
r = n - 1
x_index = 0
while l + 1 != r :
    middle = (l + r) // 2
    if h[middle] == x:
        x_index = middle
        break
    elif h[middle] < x:
        x_index = middle + 1
        l = middle
    else:
        x_index = middle - 1
        r = middle



res = abs(a - (t - 0.006 * h[x_index]))
ans = x_index
flag_r = True 
flag_l = True
if x_index == n - 1:
    flag_r = False
elif x_index == 0:
    flag_l = False
else:
    pass


if flag_r:
    if abs(a - (t - 0.006 * h[x_index + 1])) < res:
        res = abs(a - (t - 0.006 * h[x_index + 1]))
        ans += 1
if flag_l:
    if abs(a - (t - 0.006 * h[x_index - 1])) < res:
        res = abs(a - (t - 0.006 * h[x_index - 1]))
        ans -= 1

print(h_not_sorted.index(h[ans]) + 1)

Solution (Python):
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
t, a = inintm()
H = inintl()

diff = 10**6
ans = 0

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

print(ans)

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

min_tmp = 10 ** 5
index = 0
for i in range(n):
    tmp = abs(a - (t - 0.006 * h[i]))
    if tmp <= min_tmp:
        min_tmp = tmp
        index = i
    
print(index + 1)

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]=T-H[i]*0.006
  temp[i]=abs(A-temp[i])
print(temp.index(min(temp))+1)

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

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

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

ans = 0

for p,q in enumerate(temperature):
  if q == min(temperature):
    ans = p+1
    break
print(ans)

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

Solution (Python):
N = int(input())
T, A = list(map(lambda a: int(a), input().split(" ")))
dif = [abs(T - x * 0.006 - A) for x in list(map(lambda y: int(y), input().split(" ")))]
print(dif.index(min(dif)) + 1)

Solution (Python):
N=int(input())
T,A=map(int,input().split())
W=list(map(int,input().split()))
U=100000000
c=0
for i in range(N):
  W[i]=T-W[i]*0.006
for k in range(N):
  Y=abs(W[k]-A)
  if Y<U:
    U=Y
    c=k
print(c+1)

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

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

Solution (Python):
import numpy as np

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

hoge = np.ndarray(int(N))
for piyo in range(int(N)):
  hoge[piyo] = int(H[piyo])

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

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

	A = [t - x * 0.006 for x in H]

	tmp = abs(a - A[0])
	ind = 0
	for i,y in enumerate(A,1):
		if tmp >= abs(a - y):
			tmp = abs(a - y)
			ind = i
		
	print(ind)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

dis = INF
ans = None
for i, h in enumerate(H):
    avg = T - h * 0.006
    if abs(avg - A) < dis:
        dis = abs(avg - A)
        ans = i + 1
print(ans)

Solution (Python):
N = int(input())
T,A=map(int,input().split())
H = list(map(int,input().split()))
minn = 10**5
min_num=0

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

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

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

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

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

t = 10 ** 9
r = 0

for i in range(N):
    x = T - H[i] * 6 / 1000
    tt = abs(A - x)
    if t > tt:
        t = tt
        r = i + 1
        
print(r)

Solution (Python):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
nin=10**6
ans=0

for i in range(N):
    ave=T-H[i]*0.006
    dif=abs(A-ave)
    if dif<nin:
        ans=i
        nin=dif

print(ans+1)

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

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

Solution (Python):
n=int(input());t,a=map(int,input().split());h=[abs(a-(t-i*0.006)) for i in list(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()))
z = [abs(t - x * 0.006 - a) 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()))

C = 999
for i in H:
  tmp = T - 0.006 * i
  a = abs(tmp - A)
  if a < C:
    C = a
    x = int(H.index(i))+1
print(x)

Solution (Python):
from decimal import Decimal
n = int(input())
t,a = map(int,input().split())
hl = list(map(int,input().split()))

num = 10**9
diff = 10**9
for i in range(n):
    tmp = t - Decimal(hl[i] * 0.006)
    tmp_diff = abs(tmp-a)
    
    if tmp_diff < diff:
        num = i + 1
        diff = tmp_diff
print(num)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
h_=list(map(int,input().split()))
h=[]
for i in h_:
  hh_=t-6*i/1000
  h.append(hh_)

  
ans=float('inf')

for i in range(n):
  ans=min(ans,abs(a-h[i]))
  if ans==abs(a-h[i]):
    cnt=i
    continue
    
print(cnt+1)

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

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

Solution (Python):
import numpy as np
n = int(input())
t,a = map(int,input().split())
h = np.array([int(i) for i in input().split()])

h_temp = t - h * 0.006
ans = np.abs(h_temp - a).argmin()
print(ans+1)

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


ans = -1
diff = float('inf')
for i in range(N):
    d = abs(1000*T-6*H[i]-1000*A)

    if d < diff:
        diff = d
        ans = i + 1
print(ans)

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

t = (T-A)/0.006

MIN=10**9
argmin=-1
for i in range(N):
  diff = abs(h[i]-t)
  if diff<MIN:
    MIN=diff
    argmin=i

print(argmin+1)

Solution (Python):
N = int(input())
T,A = list(map(int,input().split()))
H = list(map(int,input().split()))
idealH = (T - A) * 1000 / 6
minDeltaHeight = 10000000
minIndex = 0
for i in range(N):
    deltaHight = abs(idealH - H[i])

    if minDeltaHeight > deltaHight:
        minDeltaHeight = deltaHight
        minIndex = i
print(minIndex+1)

Solution (Python):
def main():
    N = int(input())
    T, A = map(int, input().split())
    H = [int(x) for x in input().split()]
    rec = 100000000
    ans = 0
    
    for i in range(N):
        C = T - (H[i] * 0.006)
        if C < A:
            C = A - C
        else:
            C = C - A
        if C < 0:
            C = C * (-1)
        if rec > C:
            rec = C
            ans = i + 1
    print(ans)
main()

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

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

ans = 0
min_d = 10 ** 7
for i in range(n):
  tp = t - h[i] * 0.006
  ab = abs(a - tp)
  min_d = min(min_d, ab)
  
  if min_d == ab:
    ans = i+1
print(ans)

Solution (Python):
N = int(input())
MM = input().split()
T = int(MM[0])
A = int(MM[1])
LL = input().split()
jisyo ={}
for i in range(N):
  H = float(T) - float(LL[i])*0.006
  PPP =  A - H
  jisyo[abs(PPP)] = i+1
dic2 = sorted(jisyo.items())
print(dic2[0][1])

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

if '__main__' == __name__:
    resolve()

Solution (Python):
n=int(input())
t,a=map(int,input().split())
h=list(map(int, input().split()))
li=[]
for i in range(n):
    temp1=t-h[i]*6/1000
    temp2=abs(a-temp1)
    li+=[(i+1,temp2)]
li.sort(key=lambda x:(x[1]))
print(li[0][0])

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

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

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

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))
x=1

for i in range(n):
  z=t-h[i]*0.006
  if s > abs(a-z):
    s=abs(a-z)
    x=i+1
   
print(x)

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

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

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

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

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

min = 10**6

result = 0

for i in range(len(H)):

    h = H[i]
    
    temp = T - (h*0.006)
    
    if min > abs(A-temp):
        min = abs(A-temp) 
        result = i+1
    
    
print(result)

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

Solution (Python):
N = int(input())
T,A = (int(X) for X in input().split())
H = [int(X) for X in input().split()]
MIN = pow(10,9)
MII = 0
for X in range(0,N):
    Diff = abs(A-(T-0.006*H[X]))
    if Diff<MIN:
        MIN = Diff
        MII = X+1
print(MII)

Solution (Python):






















































def calculation(lines):
    N = int(lines[0])
    T, A = list(map(int, lines[1].split()))
    values = list(map(int, lines[2].split()))
    

    result = None
    id = None

    for i, value in enumerate(values):
        t = T - value * 0.006
        
        dif = abs(A-t)
        if result is None:
            result = dif
            id = i
        elif result > dif:
            result = dif
            id = i

    return [id+1]




def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2', '12 5', '1000 2000']
        lines_export = [1]
    if pattern == 2:
        lines_input = ['3', '21 -11', '81234 94124 52141']
        lines_export = [3]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(3)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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(T-0.006*H[i]-A)

Temp_abs=[]
for i in range(N) :
  Temp_abs.append(abs(Temp[i]))

cnt =1
for i in range(N):
  if min(Temp_abs) != Temp_abs[i]:
    cnt+=1
  else:
    print(cnt)

Solution (Python):
import numpy as np

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

Temp = []

for i in range(N) :
  Temp.append(T-0.006*H[i]-A)
  
Temp = np.abs(Temp)
cnt =1
for i in range(N):
  if min(Temp) != Temp[i]:
    cnt+=1
  else:
    print(cnt)

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

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

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

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

Solution (Python):
N = int(input())
T, A = input().split(' ')
T = int(T)
A = int(A)
H = input().split(' ')
H = [int(H[i]) for i in range(N)]
check = 10**9
for i in range(N):
  C = A - (T - H[i] * 0.006)
  if abs(C)<check:
    check = abs(C)
    point = i + 1
print(point)

Solution (Python):
N = int(input())
T,A=map(int,input().split())
List = list(map(int, input().split()))
t = 0
mid = 0
MID = 100000000000
res = 100000000000
for i in range(N):
  t = T - 0.006*List[i]
  mid = abs(A-t)
  if mid < MID:
    MID = mid
    res = i+1
print(res)

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

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

print(min(temp)[1])