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) = list(map(int, input().split()))
h = list(map(int, input().split()))

neari = None
near = 10000
for i in range(n):
    if near > abs(a - (t - h[i] * 0.006)):
        neari = i
        near = abs(a - (t - h[i] * 0.006))
print(neari + 1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
l = list(map(int,input().split()))
min_ = 100*100000
ret=0
for i in range(n):
    x = l[i]
    if min_ > abs(a-t+x*0.006):
        ret = i+1
        min_ = min(min_,abs(a-t+x*0.006))

print(ret)

Solution (Python):
import sys

n = int(sys.stdin.readline().strip())
t, a = map(int, sys.stdin.readline().strip().split(" ", 2))
H = map(int, sys.stdin.readline().strip().split(" "))

temp = map(lambda h: abs(a-(t-h*0.006)), H)

min_temp = 99999
min_i = -1
for i, t in enumerate(temp):
    if min_temp > t:
        min_temp = t
        min_i = i+1

print min_i

Solution (Python):
"""
B - Palace
"""
import numpy as np

n = int(input())
t, a = map(int, input().split())
h_list = []
for part in input().split():
    h_list.append(int(part))

temp_list = []
for h in h_list:
    
    temp_list.append((t - h * 0.006 - a) ** 2)

temp_list = np.array(temp_list, dtype=np.float32)

sort_arg = np.argsort(temp_list)

print(sort_arg[0] + 1)

Solution (Python):
def main():
    N = int(input())
    T,A = list(map(int, input().split()))
    H = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        anstemperature = T - 0.006 * H[ans]
        nowtemperature = T - 0.006 * H[i]
        if abs(anstemperature - A) > abs(nowtemperature - A):
            ans = i
    print(ans+1)
if __name__ == '__main__':
    main()

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

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

kion_list = [T-H_list[i]*0.006 for i in range(N)]

tmp = 10**6
num = -1
for i in range(N):
  if tmp > abs(A-kion_list[i]):
    tmp = abs(A-kion_list[i])
    num = i+1


print(num)

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

Solution (Python):
N = int(input())
T,A = map(int,input().split())
X = list(map(int,input().split()))
res = 100000000
j = 1
for i in X:
    a = abs(A - (T-i*0.006))
    if(res > a):
        res = a
        res1=j        
    j+=1
print(res1)

Solution (Python):
import numpy as np

N = int(raw_input().replace("\n", ""))

inputs = raw_input().replace("\n", "").split(" ")
T, A = map(int, inputs)

inputs = raw_input().replace("\n", "").split(" ")
H_list = map(int, inputs)

T_list = np.asarray(map(lambda x: T - 0.006 * x, H_list))


i = np.argmin(np.abs(T_list - A)) + 1
print(i)

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

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

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


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

p = [1, abs(A - h_temp(H[0]))]

for i, temp in enumerate(H, 1):
    if p[1] > abs(A - h_temp(temp)):
        p[1] = abs(A - h_temp(temp))
        p[0] = i

print(p[0])

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

for i in range(N):
    H_li[i]=T-H_li[i]*0.006

ans=0
a=100000
for i in range(N):
    if abs(A-H_li[i])<a:
        a=abs(A-H_li[i])
        ans=i+1

print(ans)

Solution (Python):
import heapq
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
Tlist = [T-x * 0.006 for x in H]
ablist = [abs(A - x) for x in Tlist]
abheap = []
for i in range(N):
    heapq.heappush(abheap,(ablist[i], i))
ab, basho = heapq.heappop(abheap)
print(basho+1)

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

min_diff = 9999999999999
ans = -1

for i in range(0, n):
    tmp = abs(a - (t - hs[i] * 0.006))
    if tmp < min_diff:
        min_diff = tmp
        ans = i + 1
print(ans)

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

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

h = 9999999
index = -1
for i, Hi in enumerate(H):
    if abs(a - (t - 0.006*Hi)) <= abs(a - (t - 0.006*h)):
        h = Hi
        index = i + 1
print(index)

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

Solution (Python):
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
diff = float('inf')
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):
import math
n = int(input())
t, a = map(int, input().split())
h = [int(_) for _ in input().split()]

t_list = []
for i in range(n):
    t_list.append(math.fabs(t-h[i]*0.006 - a))

sol = min(t_list)
for i in range(n):
    if t_list[i] == sol:
        print(i+1)
        exit()

Solution (Python):

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

do = 0.006

diff_dict = {}

for i,Hi in enumerate(H):
    diff_dict[i+1] = abs(A - (T - Hi * do) )



k,v = sorted(diff_dict.items(), key=lambda x: x[1])[0]  

print(k)

Solution (Python):

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

temps_gap = [abs(t-0.006*h-a) for h in hh]

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

Solution (Python):
import numpy as np
N = int(input())
T, A = map(int, input().split())

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

calc_array = []
for x in array:
    calc_array.append(T - 0.006 * x)

idx = np.abs(np.array(calc_array) - A).argmin()
print(idx+1)

Solution (Python):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
X=1000
for n in range(N):
    if abs((T-H[n]*0.006)-A)<X:
        X=abs((T-H[n]*0.006)-A)
        num=n
print(num+1)

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

D = 99999999
R = 0

for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    if D > d:
        D = d
        R = i + 1

print(R)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
h = map(int, input().split())
h = [abs(t - _h * 0.006 - a) for _h in h]
m = min(h)
for i, v in enumerate(h):
    if v == m:
        print(i + 1)
        break

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

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

mini = None
minv = float('inf')

for i, h in enumerate(H):
  delta = abs(A - (T - 0.006 * h))
  if delta < minv:
    mini = i + 1
    minv = delta
print(mini)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
h=list(map(int, input().strip().split()))
tlis=[0]*N

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

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

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

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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ansIndex = 0
smallestDiff = 999999
for index, height in enumerate(H):
    temp = T - height * 0.006
    diff = abs(A - temp)
    if smallestDiff > diff:
        smallestDiff = diff
        ansIndex = index

print(ansIndex+1)

Solution (Python):
import numpy as np

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

dift = abs((t - h * 0.006) - a)

ans = np.argmin(dift) + 1

print(ans)

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

res = float("inf")
ret = float("inf")
for i, y in enumerate(h_array, 1):
    if res > abs(a-(t-y*0.006)):
        res = abs(a-(t-y*0.006))
        ret = i
print(ret)

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

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


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

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

for i in range(N):
  if i == 0:
    ans = 1
    temp = abs((T - 0.006 * places[i]) - A)
  else:
    tt = abs((T - 0.006 * places[i]) - A)
    if tt < temp:
      ans = i+1
      temp = tt

print(ans)

Solution (Python):
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
t,a = Is()
lis = Is()
tmin = 10**10
for i in range(n):
    if abs(a-(t-lis[i]*0.006)) < tmin:
        tmin = abs(a-(t-lis[i]*0.006))
        tmin_i = i
print(tmin_i+1)

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

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

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

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

min_d = min(delta)
print(delta.index(min_d)+1)

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

ans=100000000000000
p=0
for i in range(n):
    j=t-h[i]*0.006
    if ans>abs(j-a):
        ans=min(ans,abs(j-a))
        p=i+1

print(p)

Solution (Python):

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

ans = -1
dmin = 1000
for i, Hi in enumerate(H):
    tmp = T - Hi * 0.006
    dtmp = tmp - A if tmp > A else A - tmp
    if dtmp < dmin:
        ans = i
        dmin = dtmp

print(ans + 1)

Solution (Python):


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


print(pos)

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

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


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

min_pos = 0
min = 1e5

for i, d in enumerate(diff):
    if min > d:
        min = d
        min_pos = i+1

print(min_pos)

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



minimum = 1000
point = 0
for i in range(N):
    Ti = T - (H[i]*0.006)
    if abs(Ti-A) < minimum:
        minimum = abs(Ti-A)
        point = i
print(point+1)

Solution (Python):

def main():
    buf = input()
    buflist = buf.split()
    N = int(buflist[0])
    buf = input()
    buflist = buf.split()
    T = int(buflist[0])
    A = int(buflist[1])
    buf = input()
    buflist = buf.split()
    H = list(map(int, buflist))

    mindiff = float("inf")
    point = None
    for i in range(N):
        temp = T - (H[i] * 0.006)
        diff = abs(A - temp)
        if diff < mindiff:
            mindiff = diff
            point = i
    print(point+1)

if __name__ == '__main__':
    main()

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

ans = 0
score = float("inf")
for index, i in enumerate(H):
    x = T - i * 0.006
    if abs(A - x) < score:
        score = abs(A - x)
        ans = index + 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):
  ans.append((abs(T - H[i] * 0.006 - A), i + 1))
ans.sort()
print(ans[0][1])

Solution (Python):
import sys
import collections
import itertools
import math
import re
from collections import Counter
from collections import deque

MOD = 10 ** 9 + 7

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

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

min_diff = 99999999999999999
min_idx = 0
for i in range(N):
    diff = abs(B[i] - A)
    if min_diff > diff:
        min_diff = diff
        min_idx = i

print(min_idx+1)


sys.exit(0)

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 = map(int, input().split())
H = list(map(int, input().split()))
result = float("inf")
answer = None

for i, h in enumerate(H):
    if abs(A - (T - h*0.006)) < result:
        result = abs(A - (T - h*0.006))
        answer = i + 1

print(answer)

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

tikasa=100000
motto=100000
answer=100
H=list(map(int,input().split()))

for i in range(len(H)):
  tempature=T-H[i]*0.006
  tikasa=abs(tempature-A)
  if tikasa<motto:
    motto=tikasa
    answer=i+1
print(answer)

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

Solution (Python):

n = int(input())
T,A = list(map(int,input().split()))
ls_H = list(map(int,input().split()))
diff_min = 1e+8
for i,H in enumerate(ls_H):
    diff = abs((T - H  * 0.006) - A)
    if diff < diff_min:
        diff_min = diff
        ans = i
print (int(ans+1))

Solution (Python):

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

ans = 0
for i in range(N):
    del_T = abs(A - (T - H[i]*6/1000))
    if i == 0:
        ans = del_T
        ind = 0
    elif ans > del_T:
        ans = del_T
        ind = i
print(ind+1)

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

Solution (Python):
import numpy as np
N = int(input().strip('\n'))
T,A = [int(x) for x in input().strip('\n').split(' ')]
H = np.array([int(x) for x in input().strip('\n').split(' ')])
H = T-0.006*H
H_res = np.abs(H-A)
print(int(np.argmin(H_res))+1)

Solution (Python):
import numpy as np
N = int(input())
T, A = [int(_) for _ in input().split()]
H_A = [abs(T - 0.006 * int(i) - A) for i in input().split()]
print(np.argmin(H_A) + 1)

Solution (Python):
n = int(input())
t,a = map(int, input().split())
plcs = map(int, input().split())
min_val = float('inf')
min_ind=0
for i, plc in enumerate(plcs,1):
  tmp = t - 0.006 * plc
  if abs(tmp - a) < min_val:
    min_val = abs(tmp - a)
    min_ind = i

print(min_ind)

Solution (Python):
import numpy as np

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]
ans = np.argsort(diff_temp)[0]

print(ans + 1)

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

m="a"

for i in range(N):
	if m=="a" or m>abs(A-(T-(H[i]*0.006))):
		m=abs(A-(T-(H[i]*0.006)))
		m_i=i

print(m_i+1)

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

ans = [0]*n
place = 0
for i in range(n):
    ans[i] = abs(t - (h[i] * 0.006) - a)

for i in range(n):
    if ans[i] == min(ans):
        place = i
        break

print(place + 1)

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

Best = 0
Bestabs = abs(A - (T-H[0]*0.006))
for i in range(N):
    Ti = T - H[i]*0.006
    if Bestabs > abs(A-Ti):
        Best = i
        Bestabs = abs(A-Ti)

print(str(Best+1))

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

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

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

Hd = [abs(T - 0.006 * h - A) for h in H]
m = min(Hd)
print(Hd.index(m) + 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
m = 10000

for i, h in enumerate(H):
    if m > abs(a - (t - h*0.006)):
        ans = i
        m = abs(a - (t - h*0.006))

print(ans+1)

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

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

print(ans)

Solution (Python):

import sys
from collections import deque
import copy

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_raw = read_func().strip().split()
    [T, A] = [long(input_raw[0]), long(input_raw[1])]
    input_raw = read_func().strip().split()
    min_sub = sys.maxint
    min_idx = 0
    for i in range(N):
        H = long(input_raw[i])
        sub = abs(float(A) - (T - H * 0.006))
        if sub < min_sub:
            min_sub = sub
            min_idx = i
    print min_idx + 1

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    n = int(input())
    t, a = map(int, input().split())
    h = [int(s) for s in input().split()]
    y = [abs(t - 0.006 * x - a) for x in h]
    i = min(range(n), key=lambda j: y[j])
    print(i + 1)

main()

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

def calc_score(h):
    return abs(A - (T - h*0.006))

ans_id = 0
ans_score = calc_score(H[0])

for i in range(1, N):
    score = calc_score(H[i])
    if ans_score > score:
        ans_id = i
        ans_score = score

print(ans_id + 1)

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

index = None
mindiff = 1000000000
for i in range(1, n + 1):
  diff = abs(t - a - 0.006 * h[i - 1])
  if mindiff > diff:
    mindiff = diff
    index = i

print(index)

Solution (Python):
from math import fabs

n = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
index, ave = 0, fabs(T - 0.006 * H[0] - A)
for i in range(1, n):
    tmp = fabs(T - 0.006 * H[i] - A)
    if tmp < ave:
        index, ave = i, tmp
print(index + 1)

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

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

s = min(range(1, 1 + n), key=lambda x: abs(t - 0.006 * h[x-1] - a))
print(s)

Solution (Python):
import sys


def main() -> None:
    n = next_int()
    t = next_int()
    a = next_int()

    key = 0
    val = sys.maxsize

    for i in range(n):
        h = next_int()
        p = t - h * 0.006
        if val > abs(a - p):
            key = i + 1
            val = abs(a - p)

    print(key)


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = sys.stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

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

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

Solution (Python):
def run(N, T, A, H):
    ret = 0
    diff = 999
    for i in range(len(H)):
        tmp = T - H[i]*0.006
        if diff > abs(tmp - A):
            ret = i+1
            diff = abs(tmp - A)
    return ret


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


if __name__ == '__main__':
    main()

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

best_i = -1
diff = float("inf")

for i in range(N):
    h = H[i]
    tmp = T - h * 0.006
    new_diff = abs(tmp - A)
    if new_diff < diff:
        best_i = i
        diff = new_diff

print(best_i + 1)

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

df=float("inf")
ans=0

for i,j in enumerate(x):
  if df>abs(a-j):
    df=abs(a-j)
    ans=i+1

print(ans)

Solution (Python):

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

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

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

tikai = 1e9
idx = 1e9
for i in range(len(H)):
    tmp = t - H[i] * 0.006
    if tikai > abs(a - tmp):
        idx = i + 1
        tikai = abs(a - tmp)
print(idx)

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

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

    ts = []
    x = float("inf")
    ans = -1
    for i, h in enumerate(H, 1):
        t = T - h * 0.006
        diff = abs(A - t)
        if diff < x:
            x = diff
            ans = i

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

t = [T - h * 0.006 for h in H]
ans = 10**9
for i in range(len(t)):
    if abs(t[i] - A) < ans:
        ans_i = i
        ans = abs(t[i] - A)
print(ans_i + 1)

Solution (Python):
n=input()
t,a=map(int, input().split(" "))
H=list(map(int, input().split(" ")))
diff=99999999999999999999999999999999999999999999999
for num,i in enumerate(H):
    tmp=abs(t-a-i*0.006)
    if tmp<diff:
        out=num+1
        diff=tmp
print(out)

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

ans = int(1e20)
pans = 0
for i in xrange(n):
    x = arr[i]
    add = t - x * 0.006
    diff = abs(add - a)
    if diff < ans:
        ans = diff
        pans = i

print pans + 1

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

ans = -1
abs_val = 1e9

for i, v in enumerate(H):
  if abs_val > abs((T - v * 0.006) - A):
    abs_val = abs((T - v * 0.006) - A)
    ans = i
print(ans + 1)

Solution (Python):
import sys
fin = sys.stdin.readline
N = int(fin())
T, A = [int(elem) for elem in fin().split()]
H_list = [int(elem) for elem in fin().split()]
assert len(H_list) == N

temperatures = [T - H * 0.006 for H in H_list]

idx_closest = 1
temp_closest = float('inf')
for i, temperature in enumerate(temperatures, start=1):
    if abs(A - temperature) < abs(A - temp_closest):
        temp_closest = temperature
        idx_closest = i

print(idx_closest)

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

ans = 0

diff =  10 ** 5
for index,cell in enumerate(H):
    if abs(T - (0.006*cell) - A) <= abs(diff-A):
        ans = index + 1
        diff = T - (0.006*cell)
print(ans)

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


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

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

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

min_dif = 1e10
ans = 0

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

print(ans)

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

ans = 1
ans2 = abs((t-h[0]*0.006)-a)

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

print(ans)

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

Solution (Python):
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
ls=[]
for i in range(N):
    ls.append((i+1,abs(A-(T-H[i]*0.006))))
ls0=list(sorted(ls, key=lambda x :x[1]))
print(ls0[0][0])

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

near = 9999999999
ans = -1
for i in range(N):
    if near > abs(A - (T - H[i]*0.006)):
        near = 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()))

ansindex = 0
mindelta = 100000
for i, h in enumerate(H):
	average = t - h * 0.006
	delta = abs(a - average)
	if delta < mindelta:
		ansindex = i + 1
		mindelta = delta

print(ansindex)

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

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

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

T_list = []
margin = []
for i in range(N):
    h = h_list[i]
    t = T - h*0.006
    margin.append(abs(A-t))

min_margin = float("inf")
min_i = -1

for i in range(N):
    if min_margin >= margin[i]:
        min_margin = margin[i]
        min_i = i+1
print(min_i)

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

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

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

print(index)

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

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

diff_tmp = sorted([(abs((T - h*0.006) - A), i+1) for i, h in enumerate(H)])
print(diff_tmp[0][1])

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

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

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

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

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

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

diff = 10 ** 9
res = -1
for i, t in enumerate(temp):
    if abs(A - t) < diff:
        res = i
        diff = abs(A - t)

print(res + 1)