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:
N = int(input())
T,A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
min = 10**5
ans = 0
for index,i in enumerate(H):
    tmp = T - i*0.006
    if(abs(tmp-A)<min):
        ans = index
        min = abs(tmp-A)
print(ans+1)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T0, A = map(int, input().split())
H = list(map(int, input().split()))

err_T = np.array([abs(T0-0.006*H[i]-A) for i in range(N)])
idx = np.argmin(err_T)
print(idx+1)

Submission status: Accepted

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

for i in range(N):
  sa=T-0.006*hoge[i]-A
  if(sa<0):
    sa=-sa
  hoge[i]=sa

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = (int(i) for i in input().split())
h = list(int(i) for i in input().split())
for i in range(n):
  h[i]  = abs(a-(t-h[i]*0.006))
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()))
H=[abs(A-(T-h*0.006)) for h in H]
print(H.index(min(H))+1)

Submission status: Accepted

Solution code:
N = int(input())
ta_lst = list(map(int, input().split()))
h_lst = list(map(int, input().split()))

min_diff = 10**10
for n, i in enumerate(h_lst):
    diff = abs((ta_lst[0] - i * 0.006) - ta_lst[1])
    if diff < min_diff:
        min_diff = diff
        min_diff_index = n
print(min_diff_index+1)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
t, a = list(map(int, input().split()))
li = np.asarray(list(map(int, input().split())))

li2 = np.abs(t - li * 0.006 - a)
print(np.argmin(li2) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H_list=list(map(int,input().split()))
a=list(map(lambda x:abs((T-x*0.006)-A), H_list))
#print(a)
#print(min(a))
print(a.index(min(a))+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

    min_d = abs(T - H[0] * 0.006 - A)
    min_i = 0
    for i in range(N):
        d = abs(T - H[i] * 0.006 - A)
        if d < min_d:
            min_i, min_d = i, d

    print(min_i + 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()))
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 = (int(x) for x in input().split())
h_lis = [int(x) for x in input().split()]

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

Submission status: Accepted

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

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):
    d = abs(a-t+h[i]*0.006)
    s.append(d)

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

Submission status: Accepted

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

min_diff = 10000
index = 1
min_index = 0
for h in h_list:
    t = T-h*0.006
    diff = abs(t-A)
    if min_diff > diff:
        min_diff = diff
        min_index = index

    index += 1

print(min_index)

Submission status: Accepted

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

min = 10000000
index = -1

for i in range(N):
  temp = int(T) - int(H[i]) * 0.006
  if min > abs(int(A) - temp):
    min = abs(int(A) - temp)
    index = i

print(index+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n=int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
tt = [abs(a - (t-h[i]*0.006)) for i in range(n)]
ans = 1000000000
for i in range(n):
  ans = min(ans, tt[i])
for i in range(n):
  if tt[i] == ans:
    print(i+1)
    sys.exit()

Submission status: Accepted

Solution code:
N = int(input())
x = list(map(int,input().split()))
T = x[0]
A = x[1]

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

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

Submission status: Accepted

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

h = list(map(int, input().split()))
res_val = abs(A - (T - h[0] * 0.006))
res_idx = 0

for i in range(1, N):
  val = abs(A - (T - h[i] * 0.0060))
  if val < res_val:
    res_val = val
    res_idx = i

print(res_idx + 1)

Submission status: Accepted

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

temperature_diff_list = [abs(A - (T - height * 0.006)) for height in heights]
    
print(temperature_diff_list.index(min(temperature_diff_list)) + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
H = [abs(T - x*0.006 - A) for x in H]
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()))

kion = [abs(T - x * 0.006 - A) for x in H]

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

Submission status: Accepted

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

kion = [abs(T - x * 0.006 - A) for x in H]
kion_dic = {}
for k, i in zip(kion, range(len(H))):
    kion_dic[k] = i
a = sorted(kion_dic)
print(kion_dic[a[0]]+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
height = input().split()
min=1000
minnum=0
for i in range(len(height)):
    z=int(T)-int(height[i])*0.006
    if abs(z-A)<float(min):
        min=abs(z-A)
        minnum=i+1
print(minnum)

Submission status: Accepted

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

temp = 10 ** 5
for i in range(n):
    diff = abs(a - (t - H[i] * 0.006))
    if diff < temp:
        temp = diff
        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()))

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = input().split()
mean_A = []
for i in range(N):
    H[i] = int(H[i])
    mean_A.append(T - H[i]*0.006 - A)
    if (mean_A[i]<0):
        mean_A[i] = -mean_A[i]
min_value = 1e+5
min_index = 0
for i in range(N):
    if (mean_A[i]<min_value):
        min_value = mean_A[i]
        min_index = i
print(min_index+1)

Submission status: Accepted

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

Submission status: Accepted

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

min = 100000000

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

print(ans)

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 getdiff(A,T,H):
    return (A-(T-H*0.006))**2

min = 0
for i in range(len(H)):
    if getdiff(A,T,H[min])>getdiff(A,T,H[i]):
        min = i
print(min+1)

Submission status: Accepted

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

s = 100000
ansi = 0
for i in range(0, n):
    tm = t - h[i] * 0.006
    if s > abs(a-tm):
        s = abs(a-tm)
        ansi = i

print(ansi+1)

Submission status: Accepted

Solution code:
def difftemp_with_a(height_i):
    return abs((t - height_i * 0.006) - a)

n = int(input())
t, a = [int(x) for x in input().split()]
height = [int(x) for x in input().split()]
print(height.index(min(height, key = difftemp_with_a)) + 1)

Submission status: Accepted

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

for i in h:
    s.append(abs(a-t+i*0.006))

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

Submission status: Accepted

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

for i in h:
    s.append(abs(t-i*0.006-a))

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
# from collections import Counter, defaultdict

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
t, a = LI()
H = LI()

ans = 1
ans_t = INF
for i in range(n):
    temp = abs(a - (t - H[i] * 0.006))
    if temp < ans_t:
        ans_t = temp
        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()))

H2 = []

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

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

Submission status: Accepted

Solution code:
N = int(input())
t,a = map(int,input().split())
high = list(map(int,input().split()))
def temp(h):
    return t - h*0.006

ans = 0
min = 10**10
for i in range(N):
    if min > abs(a-temp(high[i])):
        ans = i
        min = abs(a-temp(high[i]))
print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = list(map(int,input().split()))
H = list(map(int,input().split()))
ans = 0
tempans = 0
for i in range(len(H)):
    tem = T - 0.006*(H[i])
    a = abs(A-tem)

    if i == 0:
        ans = i+1
        tempans = a
    elif a < tempans:
        ans = i+1
        tempans = a

print(ans)

Submission status: Accepted

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

diff = float("INF")
min_index = 0
index = 1
for h in hs:
    temp_diff = abs(a - (t - h*0.006))
    if temp_diff < diff:
        diff = temp_diff
        min_index = index
    index += 1
print(min_index)

Submission status: Accepted

Solution code:
import re
from itertools import count
from sys import stdin


def main():
    _, t, a, *hs = get_params()
    print(solve(t, a, hs))


def get_params():
    return map(int, words(get_contents()))


def words(s):
    return re.split(r'\s', s)


def get_contents():
    return stdin.read().strip()


def solve(t, a, hs):
    def temperature(h):
        return t - 0.006 * h

    def distance(t):
        return abs(t - a)

    ts = map(temperature, hs)
    ds = map(distance, ts)
    dis = zip(ds, count(1))
    return min(dis)[1]


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    T, A = list(map(int, input().split()))
    H = list(map(int, input().split()))
    m = []
    for h in H:
        m.append(abs(A - (T - h * 0.006)))
    print(m.index(min(m)) + 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()))

d = 10 ** 9
ans = -1
for i in range(N):
    t = abs((1000 * T - 6 * h[i]) - 1000 * A)
    if t < d:
        ans = i + 1
        d = t
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=0
min_dif = float("inf")
for i, h in enumerate(H):
  dif = abs(A-(T-h*0.006))
  if dif<min_dif:
    min_dif = dif
    ans=i

print(ans+1)

Submission status: Accepted

Solution code:
#B
N = int(input())
T, A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
#print(N, T, A)#
#print(H)#

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

neari = 0
nearDif = dif(H[0])
for i in range(N):
    #print(i, H[i])#
    idif = dif(H[i])
    if idif<nearDif:
        neari = i
        nearDif = idif
        #print(i, nearDif)
print(neari+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ans_k = float("inf")
for i in range(n):
    kion = t - (h[i] * 0.006)
    if abs(ans_k - a) > abs(kion - a):
        ans_k = kion
        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()))

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

Submission status: Accepted

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

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

ans = 1
min_tmp = 1000

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

print(ans)

Submission status: Accepted

Solution code:
# Palace
import sys

n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
res = [0 for _ in range(n)]

# t - x(h) * 0.006
for i in range(n) :
    res[i] = t - H[i] * 0.006

result = 0
wk_abs = 0
bf_abs = 999
for i in range(n) :
    if res[i] == a :
        result = i + 1
    else :
        wk_abs = abs(a - res[i])
        if wk_abs < bf_abs :
            bf_abs = wk_abs
            result = i + 1

print (result)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
l = list(map(int,input().split()))
def opt():
  tmp = abs(t-l[0]*0.006-a)
  ans = 1
  for i in range(1,n):
    if abs(t-l[i]*0.006-a) < tmp:
      tmp = abs(t-l[i]*0.006-a)
      ans = i+1
  return ans
print(opt())

Submission status: Accepted

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

x = [0 for _ in range(N)]

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

Submission status: Accepted

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


w = 999999
answer = 0
for i,x in enumerate(h):
    x = int(x)
    tmp = abs(A - (T - (x * 0.006)))
    if tmp < w:
        w = tmp
        answer = i+1

print(answer)

Submission status: Accepted

Solution code:
N = int(input())
l = input().split(' ')
H = input().split( )

T=int(l[0])
A = int(l[1])
H = [int(x) for x in H]

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

min = min(tem_gap)
print(tem_gap.index(min) + 1)

Submission status: Accepted

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

ab=10000
titen=0

for i in range(N):
    H[i]=T-(H[i]*6/1000)
    temp=abs(H[i]-A)
    if(ab>temp):
        titen=i+1
        ab=temp
print(titen)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Fri Jan  4 19:46:02 2019

@author: Yamazaki Kenichi
"""

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

temp= [0,9999]
for i in range(N):
    if temp[1] > abs(A-(T-0.006*H[i])):
        temp = [i+1,abs( A-(T-0.006*H[i]))] 
        
#temp = [i+1,abs( A-(T-0.006*H[i]))] if temp[1] <abs(A-(T-0.006*H[i])) for i in range(N)

print(temp[0])

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
li = list(map(int, input().split()))
answer = 0
temp = 999999999999999
for i in range(len(li)):
    if abs(a - (t - (li[i] *  0.006))) < temp:
        temp = abs(a - (t - (li[i] *  0.006)))
        answer = i + 1
print(answer)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = map(int, input().split())
best = min([(abs(A - (T - 0.006 * h)), i+1) for i, h in enumerate(H)])
print(best[1])

Submission status: Accepted

Solution code:
N=int(input())
T,A=(int(i) for i in input().split())
Hlist=[int(i) for i in input().split()]
Temp=[T-0.006*Hlist[i] for i in range(N)]
dif=[abs(A-Temp[j]) for j in range (N)]
print(dif.index(min(dif))+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import fabs

def main():
  n = int(input())
  T, A = list(map(int, input().split()))
  H = list(map(int, input().split()))
  
  place = 0
  m = 1000000000
  for i, h in enumerate(H):
    t_h = T - h * 0.006
    dif = fabs(A - t_h)
    if dif < m:
      m = min(m, dif)
      place = i+1
  print(place)
main()

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,t,h = [list(map(int, input().split())) for _ in range(3)]
r = []
for i in range(n[0]):
    r.append(abs(t[1] - (t[0] - h[i] * 0.006)))
print(r.index(min(r)) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ansVal = min(TL)
ans = TL.index(ansVal) + 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

import numpy as np

input = sys.stdin.readline
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = [0] * N
for i, h in enumerate(H):
    ans[i] = abs(A - T + h * 0.006)
print(np.argmin(ans) + 1)

Submission status: Accepted

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

mini = 0
min = float('inf')

for i in range(len(H)):
    if min > abs(A - (T - 0.006 * H[i])):
        min = abs(A - (T - 0.006 * H[i]))
        mini = i + 1

print(mini)

Submission status: Accepted

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

P_N = [abs(T - h * 0.006 - A) for h in H_N]

palace_point = P_N.index(min(P_N)) + 1
print(palace_point)

Submission status: Accepted

Solution code:
n = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans_num = 0
ans_val = T - H[ans_num] * 0.006 - A
if ans_val < 0:
    ans_val *= -1
for i in range(1, len(H)):
    tmp = T - H[i] * 0.006 - A
    if tmp < 0:
        tmp *= -1
    if tmp < ans_val:
        ans_val = tmp
        ans_num = i
print(ans_num + 1)

Submission status: Accepted

Solution code:
_ = int(input())
T, A = map(int, input().split())
lst = [abs(A - (T - int(x) * 0.006)) for x in input().split()]
ret = 0
for idx, x in enumerate(lst):
    if lst[idx] < lst[ret]:
        ret = idx
print(ret+1)

Submission status: Accepted

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

li_kion = [{'index': idx + 1, 'abs': abs(a - (t - (h * 0.006)))} for idx, h in enumerate(li_h)]

print(sorted(li_kion, key=lambda x: x['abs'])[0]['index'])

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()]


m = abs(50-0.006*10**5)
ans = -1
for j in range(n):
    if abs(a - (t-h[j]*0.006)) < m:
        m = abs(a - (t-h[j]*0.006))
        ans = j
    else:
        pass

print(ans+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()]

mini = 10000
for i, hi in enumerate(h):
    temp = t - hi * 0.006
    if abs(temp - a) < mini:
        mini = abs(temp - a)
        result = i+1

print(result)

Submission status: Accepted

Solution code:

def temperature(meter,t):
      temp = t - meter*0.006
      return temp


N = int(input())
s = input().split()
T = int(s[0])
A = float(s[1])
H = input().split()
tempera = [0]*N
for n in range(N):
    tempera[n] = temperature(int(H[n]),T)
for m in range(N):
    tempera[m] = abs(tempera[m]-A)
Min = min(tempera)
print(tempera.index(Min)+1)

Submission status: Accepted

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

min_dist = 1e10
min_idx = -1
for i, h in enumerate(Hs):
    avg = T - h * 0.006
    if abs(avg - A) < min_dist:
        min_dist = abs(avg - A)
        min_idx = i
print(min_idx + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = map(int, input().split())
H = [abs(T - 0.006*i - A) for i in H]
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())

temp=[[abs(T-H[i]*0.006-A),i+1] for i in range(N)]
temp.sort()
print temp[0][1]

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    t, a = map(int, input().split())
    hs = list(map(int, input().split()))
    p = min((abs(t - h * 0.006 - a), i) for i, h in enumerate(hs))
    print(p[1] + 1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans=0
mindif=float("inf")
i=0
for h in H:
    i+=1
    dif = abs(T-h*0.006-A)
    if dif < mindif:
        mindif = dif
        ans=i
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int,input().split())
H = input().split()
mindif = min(abs(1000 * T - int(H[i]) * 6 - 1000 * A) for i in range(N))

for i in range(N):
    if abs(1000 * T - int(H[i]) * 6 - 1000 * A) == mindif:
        print(i+1)
    else:
        continue

Submission status: Accepted

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

Ave = [0]*N
gosa = [0]*N

H = input().split()

for i in range(N):
    H[i] = int(H[i])
    gosa[i] = abs(float(A) - float(T) + 0.006*H[i])

print(str(int(np.argmin(np.array(gosa)))+1))

Submission status: Accepted

Solution code:
a = int(input())
b,c = map(int,input().split(" "))
ar = list(map(int,input().split(" ")))
br = []
for r in ar:
    br.append(abs(r - (((b - c) / 6) * 1000)))
print(br.index(min(br))+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = input().split()
#print(H)
for i in range(N):
    H[i] =  abs(A - (T-int(H[i])*0.006))
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()))
ans = 10000000000
for i in range(n):
    if abs(a-(t-H[i]*0.006)) < ans:
        ans = abs(a-(t-H[i]*0.006))
        final = i

print(final+1)

Submission status: Accepted

Solution code:
#encoding:utf-8

N = int(input())
t,a = map(int,input().split())
h = list(map(int, input().split()))
# print(h)

diff = 10000
for i in range(N):
    tem_diff = abs(t-h[i]*0.006-a)
    if tem_diff < diff:
        diff = tem_diff
        place = i+1


print(place)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
min_H = abs((T*1000 - (10**5+1)*6) - A*1000)
min_i = 0
for i in range(N):    
    if min_H > abs((T*1000 - H[i]*6) - A*1000):
        min_H = abs((T*1000 - H[i]*6) - A*1000)
        min_i = i
print(min_i+1)

Submission status: Accepted

Solution code:
place_count = int(input())
t_a = list(map(int, input().split()))

t = t_a[0]
target = t_a[1]

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

temp = []
# ans = (idx, temperature diff)
ans = (0, 10000000)
for (idx, h) in enumerate(heights):
  temperature = t - (0.006 * h)
  if ans[1] > abs(temperature - target):
    ans = (idx + 1, abs(temperature - target))

print(ans[0])

Submission status: Accepted

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

diff = 10 ** 15
index = 1
ans = 10 ** 15

def cal(H):
    return T - H * 0.006


for i in input().split():
    if abs(cal(int(i))-A) <= diff:
        diff = abs(cal(int(i))-A)
        ans = index
    index += 1

print(ans)

Submission status: Accepted

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

print(sorted(enumerate([ abs(T - x * 0.006 - A) for x in H ]), key=lambda x: x[1])[0][0] + 1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
H = input().split()
A = []
for i in H:
    if(((t - int(i) * 0.006)-a)<0):
        A.append(-1*((t - int(i) * 0.006)-a))
    else:
        A.append((t - int(i) * 0.006)-a)
print(A.index(min(A))+1)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
Ave=10000000000
T*=1000
A*=1000
n=0
for i in range(N):
    Ave1=abs((T-H[i]*6)-A)
    if Ave1<Ave:
        Ave=Ave1
        n=i
print(n+1)

Submission status: Accepted

Solution code:
import numpy as np

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = list(map(int,input().split()))
H = list(map(int,input().split()))
T = S[0]
A = S[1]
sub = abs(A - (T - H[0]*0.006))
for x in range(0,N):
    H_sub = abs(A -(T - H[x]*0.006))
    if H_sub <= sub:
        sub = H_sub
        X = x
print(X+1)

Submission status: Accepted

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

min_val = 1000
for i, x in enumerate(H):
    val = abs(A - (T - x*0.006))
    if min_val > val:
        res = i+1
        min_val = val

print(res)

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(float, input().split()))
c = list(map(float, input().split()))

min = abs(b[1]-b[0] - 0.006*c[0])
minn = 1

for i in range(a):
    if min > abs(b[1]-(b[0] - 0.006*c[i])):
        min = abs(b[1]-(b[0] - 0.006*c[i]))
        minn = i + 1
print(minn)

Submission status: Accepted

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

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

out = 10000000

for i in range(len(H)):
    now = abs( A - (T-(H[i]*0.006)))
    if out > now:
        out = now
        O = i+1

print(O)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, T, A, *H = map(int, open(0).read().split())
l = [abs(T - 0.006 * h - A) for h in H]
print(l.index(min(l)) + 1)