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 = [int(i) for i in input().split()]

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

Solution (Python):
N =int(input())
T,A= map(int,input().split())
H = [int(i) for i in input().split()]
m = 10 **10
ans = 0
for idx,h in enumerate(H):
    tmp = T - (0.006 * h)
    diff = abs(A -tmp)
    if diff < m:
        m=diff
        ans = idx+1
print(ans)

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())
l = list(map(int, input().split()))
al = [0]*n

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

print(al.index(min(al))+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()))
sort_H = sorted(H, reverse=False)
print(H.index(sort_H[0]) + 1)

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

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

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

ans = 999999999999999999999

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

Solution (Python):

N = int(input())
[T,A] = list(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

sa = [0]*N
for i in range(N):
    sa[i] = abs(A-temp[i])

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

Solution (Python):

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
lst = []
for i in H:
    ans = abs(A - (T - i * 0.006))
    lst.append(ans)
print(lst.index(min(lst))+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=list(map(int,input().split()))
L=list()
for i in H:
  l=abs(A-T+i*0.006)
  L.append(l)
print(L.index(min(L))+1)

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

_h = []


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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    cand = -1
    diff = 1000000
    for i, h in enumerate(H):
        if abs(A - (T - h * 0.006)) < diff:
            cand = i + 1
            diff = abs(A - (T - h * 0.006))
    print(cand)



if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
H = np.array(H)
C = list(abs(A - (T - H * 0.006)))
answer = C.index(min(C))+1

print(answer)

Solution (Python):
temp = []

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

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

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

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

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

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

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


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


for i in range(n):
    c = temperature(h[i])
    if i == 0:
        d = abs(a - c)
        ans = 1
    else:
        if abs(a - c) < d:
            d = abs(a - c)
            ans = i + 1

print(ans)

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

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

ans_i = -1
min_h = 10 ** 6

for i in range(len(H)):
  h = T - H[i] * 0.006
  if abs(A - h) < min_h:
    min_h = abs(A - h)
    ans_i = i

print(ans_i + 1)

Solution (Python):

import math


def inp():
    return(int(input()))



def inlist():
    return(list(map(int, input().split())))



def instr():
    s = input()
    return(list(s[:len(s)]))



def invr():
    return(map(int, input().split()))


n = inp()

t, a = invr()

H = inlist()
avg = []

for h in H:
    temp = t - h * 0.006
    d = abs(a-temp)
    avg.append(d)
indx = 0
for i in range(n):
    if avg[i] < avg[indx]:
        indx = i
print(indx+1)

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

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

temp_diff = [abs(get_mean_of_temp(h_i, t)-a) for h_i in h]

min_v = min(temp_diff)
min_i = temp_diff.index(min_v)
print(min_i+1)

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

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

min_val = 10000

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


print(ans+1)

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

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

print(min(list(map(lambda x: [abs(t - x * 0.006 - a), h.index(x)], h)), key = lambda x:x[0]).pop() + 1)

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

print(min([[abs(t - x * 0.006 - a), i] for i, x in enumerate(h)], key = lambda x:x[0]).pop() + 1)

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

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

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

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

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

min_diff_temp = 710
out_i = 0
for i, x in enumerate(h):
    diff_temp = abs(a - (t - x * 0.006))
    if diff_temp < min_diff_temp:
        min_diff_temp = diff_temp
        out_i = i + 1

print(out_i)

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

min_diff_temp = 999
out_i = 0
for i, x in enumerate(h):
    diff_temp = abs(a - (t - x * 0.006))
    if diff_temp < min_diff_temp:
        min_diff_temp = diff_temp
        out_i = i + 1

print(out_i)

Solution (Python):

N=int(input())
T,A= map(int, input().split())
Building_Heights=list(map(int,input().split()))
Buildings_Temps =list(map(lambda x:abs(A-(T-(x*0.006))),Building_Heights))
print(Buildings_Temps.index(min(Buildings_Temps))+1)

Solution (Python):

import sys

import fractions
import copy
import bisect
import math
import numpy as np
import itertools
from itertools import combinations_with_replacement


from operator import itemgetter
from sys import stdin

from operator import mul
from functools import reduce
from collections import Counter





j=0
k=0
n=3
r=1
a=[0]






"1行1つの整数を入力を取得し、整数と取得する"




"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

for i in number_list:
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''



"正方行列にstr型の値を入力"
'''




'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"


'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''











'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''




"aという変数に入っているものを大文字にして出力"

















'''
コンビネーションの組み合わせの中身を出力する形式
for i in itertools.combinations(brray, 2)
combinationsをpermutationsにすれば順列になる
今回なら(abc133B)
入力
1 2
5 5
-2 8
出力
[[1, 2], [5, 5], [-2, 8]]
もちろん一次元リストでも使えるし
何よりiもリストのように使えるので便利
'''


'''
def cmb(n,r):
    
    r= min(n-r,r)
    
    if r == 0: return 1
    over = reduce(mul, range(n, n-r, -1))
    
    
    

    under = reduce(mul, range(1, r+1))
    
    
    
    

    return over // under
    
    
    
    
a = cmb(n, r)

'''

'''
import itertools
from itertools import combinations_with_replacement

combinationについて
以下の違いを意識しよう
combinations() p, r 長さrのタプル列、ソートされた順で重複なし

combinations_with_replacement() p, r 長さrのタプル列、ソートされた順で重複あり


使用例 　　　　　　　　　　　                  出力　　
combinations('ABCD', 2)　　　　　　　　　　　　AB AC AD BC BD CD

combinations_with_replacement('ABCD', 2)　　 AA AB AC AD BB BC BD CC CD DD
'''



'''




for i in a.most_common(n):print(i)





 


'''









'''
bisect.bisect_left(a, x, lo=0, h=len(a))
引数
a: ソート済みリスト
x: 挿入したい値
lo: 探索範囲の下限
hi: 探索範囲の上限
(lo, hiはスライスと同様の指定方法)
bisect_leftはソートされたリストaに対して順序を保ったままxを挿入できる箇所を探索します。leftが示す通り、aにすでにxが存在している場合は、挿入箇所は既存のxよりも左側になります。また、lo, hiを指定することで探索範囲を絞り込むことも可能です。デフォルトはaの全体が探索対象です。
'''

'''
素数の判定
'''


def is_prime(n):
    if n == 1: return False

    for k in range(2, int(np.sqrt(n)) + 1):
        
        if n % k == 0:
            return False
            
    return True


'''
npのmaxとmaximumの違い
xs = np.array([1, -2, 3])
np.max(xs, 0)
この出力は3となります．[1, -2, 3]と0の4つの数字のうち，最も大きい値を出力します．

一方で，[max(1, 0), max(-2, 0), max(3, 0)]を出力したい時があります．
その時は，numpyのmaximum関数を用います．

xs = np.array([1, -2, 3])
np.maximum(xs, 0)  

'''

def factorial(x, mod=10**9+7):
    
    
    
    tmp = 1
    for i in range(1, x+1):
        tmp = (tmp * i) % mod
    return tmp
    '''
    Basically, when you do a**d % n, you actually have to calculate a**d, which could be quite large.
    But there are ways of computing a**d % n without having to compute a**d itself, and that is what pow does.
    '''











'''
ascii_letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
digits = '0123456789'
hexdigits = '0123456789abcdefABCDEF'
letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...\xaf\xb0...
lowercase = 'abcdefghijklmnopqrstuvwxyz'
octdigits = '01234567'
printable = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU...
punctuation = '!"
uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
whitespace = '\t\n\x0b\x0c\r '
'''
def main():
    n=3
    steps=0
    state=0
    w=1
    j=0
    k=0
    
    n=int(input())
    
    t,a=map(int, input().split(" "))
    
    hl=list(map(int, input().split(" ")))
    
    
    
    
    
    diftl=[0]*n
    for i in range(n):
        diftl[i]=abs(a-(t-(0.006)*hl[i]))
    print(diftl.index(min(diftl))+1)


    for i in range(1,n+1,2):
     pass
     

    l = ['aaa', 'bbb', 'ccc']
    x=l.index('aaa')
    
    
    
    

    
        
    
    

    
    
    
    
    DP = np.zeros(w+1, dtype=int)
    exdp=np.zeros((3,4)) 
    
    
    
        
        
    
    
        
        
    


    
    



    '''
    入力
    1234
    出力
    [1, 2, 3, 4]
    '''
    pin_l=["x" for i in range(10)]
    

    ls = ["a", "b", "c", "d", "e"]


    
    

    
    

    
    
    
    
    
    '''
    lsというリストの場合に、1つ飛びの値を取得したい場合には
    ls[::2]
    のようにします。こうすると、
    ["a", "c", "d"]と出力される
    '''

if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
newH=[1000*t-x*6 for x in H]
dif=float('inf')
ans=-1
for i in range(n):
    if abs(1000*a-newH[i])<dif:
        dif=abs(1000*a-newH[i])
        ans=i
print(ans+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
newH=[(t-x*0.006,i) for i,x in enumerate(H)]
newH=sorted(newH)
from bisect import bisect_left, bisect_right
Ht=[newH[i][0] for i in range(n)]
Hi=[newH[i][1] for i in range(n)]
i=bisect_left(Ht, a)
if i==0:
    ans=Hi[0]+1
elif i==n:
    ans=Hi[n-1]+1
else:
    if abs(a-Ht[i-1])>abs(a-Ht[i]):
        ans=Hi[i]+1
    else:
        ans=Hi[i-1]+1
print(ans)

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

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

print(ans)

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    l = []
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    for  i in range(N):
      l.append(abs(A-(T-h[i]*0.006)))
    print(l.index(min(l))+1)

if __name__ == '__main__':
    main()

Solution (Python):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    temp = float('inf')
    for  i in range(N):
        d = T - h[i]*0.006
        if abs(A - temp) > abs(A - d):
            temp = d
            ans = i+1
    print(ans)

if __name__ == '__main__':
    main()

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

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


candidate = [(abs(1000 * A - 1000 * T + 6 * h), k) for k, h in enumerate(H, 1)]
print(sorted(candidate)[0][1])

Solution (Python):
import sys
n = int(sys.stdin.readline().rstrip("\n"))
t, a = map(int, sys.stdin.readline().rstrip("\n").split())
h = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
d = abs(t - h[0] * 0.006 - a)
mini = 1
for i in range(1,len(h)) :
    d_ = abs(t - h[i] * 0.006 - a)
    if d_ < d:
        d = d_
        mini = i + 1
print(mini)

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


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


ans = 0
min_diff = 1e6
for i, h in enumerate(h_list, 1):
    diff = abs(calc_deg(h) - a)
    if diff < min_diff:
        min_diff = diff
        ans = i

print(ans)

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

errors=[abs((t-hi*0.006)-a) for hi in h]

min_error=min(errors)
print(errors.index(min_error)+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
temp=[abs(t-0.006*int(x)-a) for x in input().split()]

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

Solution (Python):
import sys

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

mini = 10 ** 9
index = -1
for i, h in enumerate(H):
    temp = T - h * 0.006
    if mini > abs(temp - A):
        mini = abs(temp - A)
        index = i + 1
print(index)

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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
m_diff = float('inf')
idx = 1
for i, diff in enumerate(map(lambda x, T=T, A=A: abs(A - (T - int(x) * 0.006)), input().split())):
    if diff < m_diff:
        m_diff = diff
        idx = i + 1
print(idx)

Solution (Python):


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

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

print(ans)

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

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

main()

Solution (Python):

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

ans = 0
minimum = float('inf')

for i,v in enumerate(h):
    temp = abs(a - (t - v*0.006))
    if temp < minimum:
        minimum = temp
        ans = i

print(ans+1)

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

Solution (Python):






import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Yes(): print("Yes"); return
def No(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count





N = inputI()
T,A = inputIL()
H = inputIL()

H_T = [T-h*0.006 for h in H]

MIN = INF
POS = None

for i in range(N):
  if abs(H_T[i] - A) < MIN:
    MIN = abs(H_T[i] - A)
    POS = i+1
    
print(POS)

Solution (Python):
import itertools
import math
import fractions
import functools
import copy
n = int(input())
t, a = map(int, input().split())
h  = list(map(int, input().split()))
minimum = 10**10
index = 0
for i in range(n):
    minimum = min(minimum,abs(a-(t-h[i]*0.006)))
    if minimum == abs(a-(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()))
d=[0]*N
for i in range(N):
  d[i]=abs(T-H[i]*0.006 - A)
print(d.index(min(d))+1)

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

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

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

Solution (Python):
n = input()
t, goal_temp = input().split()
high_list = [float(i) for i in input().split()]
best_score, best_index = float('inf'), float('inf')

for i,high in enumerate(high_list):
  temp = int(t) - high*0.006
  best_score = min(abs(temp - int(goal_temp)), best_score)
  if abs(temp - int(goal_temp))==best_score:
    best_index = i
print(best_index+1)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n = I()
t, a = Is()
H = LI()
B = [abs(t - x*0.006 - a) for x in H]
m = -INF
print(B.index(min(B))+1)

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

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

tem = [t - i*0.006 for i in h]
diff = [abs(a - i) for i in tem]

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

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

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

Solution (Python):
import numpy as np

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

H = np.abs(T - H * 0.006 - A)

print(H.argmin()+1)

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

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

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

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

j = 0
Ta = 1e5 + 1
for i in range(N):
    Tm = T - H[i] * 0.006
    Tb = abs(Tm - A)
    if Ta > Tb:
        Ta = Tb
        j = i
print(j + 1)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
n = 0
place = 0
diff = 10**6
for h in H:
  n += 1
  t = T - h * 0.006
  if abs(A - t) < diff:
    diff = abs(A - t)
    place = n
print(place)

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

ans = 1
res = 10**10
for i in range(n):
    if abs(a - (t - h[i] * 0.006)) < res:
        res = 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 = list(map(int, input().split()))
diff = 10**8
for i in range(n):
    h_list[i] = t - h_list[i]*0.006
    if abs(h_list[i]-a) < diff:
        diff = abs(h_list[i]-a)
        ind = i

print(ind+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())
height = [int(_) for _ in input().split()]
array = []
for i in range(n):
    array.append(abs((t - height[i] * 0.006) - a))

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

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

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

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

print(place)

Solution (Python):


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

    differences = []

    for height in H:
        temp = t - height * 0.006
        differences.append(abs(temp - a))
    
    print(differences.index(min(differences)) + 1)

if __name__ == '__main__':
    main()

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

kion=[]
for i in range(len(h)):
    kion.append(t-h[i]*0.006)

j=0
x=10000000000000000000000
for i in range(len(kion)):
    if abs(a-kion[i])<x:
        j=i+1
        x=abs(a-kion[i])
print(j)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
High = list(map(int, input().split()))
Sa = []
for a, i in enumerate(High):
    Sa.append(abs(A-(T-High[a] * 0.006)))

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

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

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

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

min_diff = 10**8
ans = -1

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

print(ans)

Solution (Python):
def main():
    n = int(input())
    t, a = map(int, input().split())
    h = [int(i) for i in input().split()]
    ans = solve(n, t, a, h)
    print(ans)


def solve(n, t, a, h):
    ans = 0
    abstemp = abs(a - (t - h[0] * 0.006))
    for i in range(1, n):
        temptmp = abs(a - (t - h[i] * 0.006))
        if temptmp < abstemp:
            ans = i
            abstemp = temptmp
    return ans + 1


if __name__ == '__main__':
    main()

Solution (Python):
N = input()
T, A = map(int, input().split())
temperatures = list(map(int, input().split()))
 
r = 50000000000000
results = ''
 
list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):
    ondo_sa = avg_temp - A
 
    if ondo_sa < 0:
        ondo_sa = - ondo_sa
 
    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

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

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


n = int(input())
t, a = list(map(int, input().split()))
h = [int(x) for x in input().split()]

dist_min = h[0]

for i in range(1, n):
    if abs(a - temparture(t, h[i])) < abs(a - temparture(t, dist_min)):
        dist_min = h[i]
print(h.index(dist_min) + 1)

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

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

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

Solution (Python):
N=int(input())
A,B=list(map(int,input().split()))
ans=0
min_n=float("INF")
l_A = list(map(int,input().split()))
for i in range(N):
    C=A-l_A[i]*0.006
    if min_n > abs(B-C):
        ans=i
        min_n=abs(B-C)
print(ans+1)

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

ans_ind = None
ans_diff = float('inf')

for i, h in enumerate(h_list):
  avg_tmp = t - h * 0.006    
  if abs(a - avg_tmp) < ans_diff:    
    ans_ind = i    
    ans_diff = abs(a - avg_tmp)    

print(ans_ind + 1)