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



Sample input:
2
12 5
1000 2000


Sample output:
1

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
#B
N = int(input())
T , A = map(int, input().split())
H = list(map(int, input().split()))
Temp = [0]*N

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

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

Submission status: Accepted

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

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

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

a = min(l)

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

Submission status: Accepted

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


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

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

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

print(result)

Submission status: Accepted

Solution code:
import sys

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

ans_a = sys.maxsize

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np


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

x = 1000/6 * (t - a)

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

print(idx + 1)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

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

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

    print(flag)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(p)

Submission status: Accepted

Solution code:
import numpy as np
# your code goes here
def main():
	n = int(input())
	buf = input().split()
	t = int(buf[0])
	a = int(buf[1])
	buf = input().split()
	ond = np.zeros(n)
	for i in range(n):
		ond[i] = t - int(buf[i])*0.006
	ttn = np.argmin(np.abs(ond-a))
	#print(ond)
	print(ttn+1)
	
	
main()

Submission status: Accepted

Solution code:
N = int(input())

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# 

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

Submission status: Accepted

Solution code:
import sys

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

average_diff = sys.float_info.max
min_i = None

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

Submission status: Accepted

Solution code:
from sys import stdin

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

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

print(ans + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

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

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

T_list2 = list(map(f1, T_list))

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

Submission status: Accepted

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

ans = -1
dif = 10 ** 20

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

print(ans + 1)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

#print T, A, array

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

print temp_n+1

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import itertools
import math

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

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

print(min(d)[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
dmin = 10 ** 9
res = -1
for i in range(n):
    x = h[i]
    avg = t - x * 0.006
    d = abs(a - avg)
    if d < dmin:
        dmin = d
        res = i + 1  # indexは0から始まるので+1
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans + 1)

Submission status: Accepted

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

H = input().split(' ')

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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


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

print ans

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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


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

ans = 0

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

Submission status: Accepted

Solution code:
#!/bin/env python

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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

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

print(minn)

Submission status: Accepted

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

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

    print(min_abs_idx + 1)
    return

main()

Submission status: Accepted

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

Submission status: Accepted

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

a *= 1000
t *= 1000

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

print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(min_num)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import numpy as np

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

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

Submission status: Accepted

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

Submission status: Accepted

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

sa = 100000000000
index = 0

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

print(index)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

Solution code:
"""
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:
    # a度との二乗誤差
    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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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(H_list)
print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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) )

# print(diff_dict)

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

print(k)

Submission status: Accepted

Solution code:
# B
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)
print(temps_gap.index(min(temps_gap))+1)

Submission status: Accepted

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

Submission status: Accepted

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