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
T A
H_1 ... H_N

N:候補地点数
T:標準気温
A:所望の気温
H_i:地点iの高さ

高さxの地点の平均気温はT-x*0.06
"""

N = int(input())
line = input().rstrip().split(" ")
T = int(line[0])
A = int(line[1])
H = list(map(int, input().split(" ")))

min = 1000
min_i = 0
for i in range(N):
	if min > abs(A-(T-0.006*H[i])):
		min = abs(A-(T-0.006*H[i]))
		min_i = i+1


print(min_i)

Submission status: Accepted

Solution code:
import numpy as np
def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

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

anser = getNearestValue(H, (T-A)/0.006)
print(anser + 1)

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#

"""
abc113 B
"""

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

hli2 = map(lambda x: (x[0]+1, abs(t-x[1]*0.006-a)), enumerate(hli))
print(min(hli2, key=lambda x: x[1])[0])

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
heights = input().split()
heights = [int(x) for x in heights]
best_H = (T - A) / 0.006
diff_l, diff_h = 100000,100000
n_l,n_h = 0,N-1
for i in range(N):
    diff = abs(best_H - heights[i])
    if diff < diff_l:
        diff_l = diff
        n_l = i
print(n_l+1)

Submission status: Accepted

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

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

idx = 0
tmp = 1000000000
for i, x in enumerate(h):
    ave_t = t - 0.006 * x
    if abs(a - ave_t) < abs(a - tmp):
        idx = i
        tmp = ave_t
print(idx + 1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
temp = list(map(int,input().split()))
tmp = 10**9
index= 1

for i in temp:
  if abs(a- (tmp)) > abs(a- (t - i * 0.006)):
    tmp = t - i * 0.006
    index = temp.index(i)+1


print(index)

Submission status: Accepted

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

		_min = i
	
print(_min+1)

Submission status: Accepted

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

temp = [T - x * 0.006 for x in H]
diff = [abs(A - temp[0])]
diff_min = diff[0]
ans = 0
for n in range(1, N):
    new_diff = abs(A - temp[n])
    if new_diff < diff_min:
        ans = n
        diff_min = new_diff
    diff.append(new_diff)

print(ans + 1)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
High=[int(x) for x in input().split()]
D=[]
for i in range(N):
	D.append(T-int(High[i])*0.006-A)
	if D[i]<=0:
		D[i]=-D[i]
	
for i in range(N):
	if D[i]==min(D):
		print(i+1)

Submission status: Accepted

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

ret = int(1e9)
index = 0
for i, v in enumerate(h):
    tmp = abs(a - t + v * 0.006)
    if tmp < ret:
        ret = tmp
        index = i

print(index+1)

Submission status: Accepted

Solution code:
def get_temp(t, x):
    return t - x * 0.006


def get_abs(x, y):
    return abs(x - y)


def main():
    n = int(input())
    t, a = [int(e) for e in input().split()]
    h = [int(e) for e in input().split()]
    # print(n, t, a, h)

    ans_diff = None
    ans = 0

    for i, height in enumerate(h):
        temp = get_temp(t, height)
        diff = get_abs(a, temp)
        if (ans_diff is None) or diff < ans_diff:
            ans_diff = diff
            ans = i + 1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
h_list = list(map(int, input().split()))
d_list = [ abs(T-0.006*x-A) for x in h_list ]
ans_d = max(d_list)
for i,x in enumerate(d_list):
    if ans_d >= x:
        ans_d = x
        ans = i
print(ans+1)

Submission status: Accepted

Solution code:
n=int(input())
m=list(map(int,input().split()))
kouho=list(map(int,input().split()))
answer=1
ansc=abs(m[1]-(m[0]-kouho[0]*0.006))
for i in range(n):
    if abs(m[1]-(m[0]-kouho[i]*0.006))<ansc:
        ansc=abs(m[1]-(m[0]-kouho[i]*0.006))
        answer=i+1
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

p2=list(map(lambda x: abs(x*(-0.006)+T-A), p1))
B=min(p2)

for i in range(N):
    if p2[i]==B:
        print(i+1)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
l=list(map(int,input().split()))
lis=l.copy()
o=(T-A)/0.006
lis.append(o)
lis.sort()
ind=lis.index(o)
if ind==0:
    print(l.index(lis[1])+1)
else:
    if lis[ind]-lis[ind-1]>lis[ind+1]-lis[ind]:
        print(l.index(lis[ind+1])+1)
    else:print(l.index(lis[ind-1])+1)

Submission status: Accepted

Solution code:
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 = 100000000000
d = 0
for i in range(len(h)):
  b = abs(h[i] - a)
  if c > b:
    c = b
    d = i + 1
print(d)

Submission status: Accepted

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

for i in range(a):
  l = abs(b[0] - c[i]*0.006 - b[1])
  x.append(l)
  
print(x.index(min(x)) + 1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
k=[]
for i in range(0,n):
    k.append([h[i],i+1])
k.sort()
s=(t-a)/(6*(10**(-3)))
for i in range(1,n):
    if s-k[i][0]<0:
        if abs(s-k[i][0])>abs(s-k[i-1][0]):
            print(k[i-1][1])
            break
        else:
            print(k[i][1])
            break

Submission status: Accepted

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

diff = abs(A - (T - H[0] * 0.006))
index = 1
for idx, i in enumerate(H):
    temp = T - i * 0.006
    if abs(A - temp) < diff:
        diff = abs(A - temp)
        index = idx + 1
print(index)

Submission status: Accepted

Solution code:
import math
from functools import reduce
import collections
import itertools
s1 = list(map(int,input().split()))
n = s1[0]
s = list(map(int,input().split()))
t = s[0]
a = s[1]
li = list(map(int,input().split()))
li1 = []
diff = 1000000000000000
ans = 0
co = 0
li2 = []
for i in li:
    co += 1

    if co == 1:
        diff = abs((t-i*0.006)-a)
        ans = 1
    #li1.append((t-i*0.006))
    #li2.append(abs((t-i*0.006)-a))
    if abs((t-i*0.006)-a) < diff:
        diff = abs((t-i*0.006)-a)
        ans = co
        


print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
T,A = map(int,input().split())
ans = 0
a = ''
c = 0
for i in input().split():
    c += 1
    x = T - int(i) * 0.006
    b = abs(A-x)
    if a == '' or a > b:
        ans = c
        a = b
print(ans)

Submission status: Accepted

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

temp=[]
for x in h:
    temp.append(t-0.006*x)
mi=114514
p=0
for i in range(len(temp)):
    dif=abs(temp[i]-a)
    if dif<mi:
        mi=dif
        p=i
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()]
ans_i = 1; ans_diff = abs(A - (T - H[0] * 0.006))
# print(ans_diff)
for i in range(1,N):
    diff = abs(A - (T - H[i] * 0.006))
    if ans_diff > diff:
        ans_i = i+1
        ans_diff = diff

    # print(diff)
print(ans_i)

Submission status: Accepted

Solution code:
N = int(raw_input())
T, A = map(int, raw_input().split())
H = map(int ,raw_input().split())
nearT, nearI = 100000, 0
i = 0
while i < N:
  tempelature = T-0.006*H[i]
  if abs(tempelature-A) < nearT:
    nearT = abs(tempelature-A)
    nearI = i
  i+=1
print nearI+1

Submission status: Accepted

Solution code:
# _*_ codng:utf-8 _*_

num = input()
temp,target = map(int,input().split())

i = 0
ans = -500
j = 0
for height in map(int,input().split()):
  i += 1
  hoge = temp - 0.006 * height
  if(abs(target - hoge) < abs(target - ans)):
    ans = hoge
    j = i

print(j)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int,input().split())
result = 0
min_dif = 9999999

for i, x in enumerate(map(int, input().split())):
    if min_dif > abs(a - (t - x * 0.006)):
        result = i+1
        min_dif = abs(a - (t - x * 0.006))

print(result)

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
T, A = map(int, input().split())
li_H = list(map(int, input().split()))

tmp = 10000
cnt = 0
for i, h in enumerate(li_H):
    t = T - h * 0.006
    diff_ave = abs(t-A)
    if diff_ave < tmp:
        tmp = diff_ave
        cnt = i+1
print(cnt)

Submission status: Accepted

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

minScore = abs(A-(T-int(line[0]) * 0.006))
minIndex = 1
for i in range(N):
    h = int(line[i])
    temp = abs(A-(T - h * 0.006))
    if temp < minScore:
        minScore = temp
        minIndex = i + 1

print (minIndex)

Submission status: Accepted

Solution code:
"""
B - Palace
"""
#入力処理
def simple_input():
    temp_input = input().rstrip().split(' ')
    if len(temp_input) > 1:
        return temp_input
    return temp_input[0]

#メイン処理
if __name__ == '__main__':
    #入力
    n = simple_input()
    t,a = simple_input()
    h = simple_input()
    n = int(n)
    t = int(t)
    a = int(a)
    
    a_min = None
    index = 0

    for i in range(n):
        kion = t - int(h[i]) * 0.006
        t_min = abs(a - kion)
        if(a_min is None or a_min > t_min):
            a_min = t_min
            index = i

    #出力
    print("{0}".format(index+1))

Submission status: Accepted

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

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

Submission status: Accepted

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

best_d = float('inf')
best_i = -1

for i,x in enumerate(H):
    t = T - x * 0.006
    d = abs(A - t)
    if d < best_d:
        best_d = d
        best_i = i
print(best_i + 1)

Submission status: Accepted

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

abs_list = [abs(A - (T - i*0.006)) for i in H]
ans = abs_list.index(min(abs_list))

print("{} ".format(ans+1))

Submission status: Accepted

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

H_list1 = []
for i,h in enumerate(H_list):
    H_list1 = H_list1 + [abs(A-(T - h*0.006)),]
print(H_list1.index(min(H_list1))+1)

Submission status: Accepted

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

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

tN = [0] * N
ans = -1
tmp = float('inf')
for i in range(N):
    tN[i] = T - hN[i] * 0.006
    if abs(tN[i] - A) < tmp:
        tmp = abs(tN[i] - A)
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin

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

    temp = [T - x * 0.006 for x in H]
    diff = float('inf')
    ans = 0
    for i, a in enumerate(temp, start=1):
        b = abs(A - a)
        if not b:
            print(i)
            return
        elif diff > b:
            ans, diff = i, b
    print(ans)

input = lambda: stdin.readline()
main()

Submission status: Accepted

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

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

print(keep+1)

Submission status: Accepted

Solution code:
def f(x):
    if x>=0:
        return x
    else:
        return -x
a=int(input())
b,c=(map(int,input().split(" ")))
d=list(map(int,input().split(" ")))
e=float("inf")
g=0
for x in range(1,len(d)+1):
    if e>=f(c-(b-d[x-1]*0.006)):
        e=f(c-(b-d[x-1]*0.006))
        g=x
print(g)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
cand = 10**9
ans = 0
for i in range(N):
  temp = T - H[i] * 0.006
  if abs(A - temp) < cand:
    cand = abs(A - 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()))

d=[]
l={}
for i in range(n):
  x=h[i]
  avg_t= t - x * 0.006
  d.append(abs(avg_t - a))
  l[d[i]]=i+1

min=min(d)
print (l[min])

Submission status: Accepted

Solution code:
n = int(input())
t, a = list(map(int,input().split()))
H = list(map(int,input().split()))
best = 1000000000
bestid = -10
for i in range(n):
  if abs(a-(t-H[i]*0.006)) < best:
    best = abs(a-(t-H[i]*0.006))
    bestid = i+1
print(bestid)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
diff = 100000000
ans = 0
for i in range(N):
    tmp = abs(A - T + Hs[i] * 0.006)
    if diff > tmp: 
        diff = tmp
        ans = i+1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

res_list=[]

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

x, x_ind = a_diff[0], 0
for i, e in enumerate(a_diff[1:]):
    if e < x:
        x, x_ind = e, i + 1

x_ind += 1
        
print(x_ind)

Submission status: Accepted

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

t_diff = [abs(a-(t-int(h_)*0.006)) for h_ in h]
ans = 0
ans_diff = 9999
for idx,t_diff_ in enumerate(t_diff):
    if ans_diff > t_diff_:
        ans_diff = t_diff_
        ans = idx
print(ans+1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
d = 120000
j = -1
for i in range(N):
	temp = T-H[i]*0.006
	if abs(A-temp) < d :
		j = i
		d = abs(A-temp)

print(j+1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
res = 10**4
now = 10**10

for i in range(len(h)):
    if abs((t-(h[i]*0.006))-a) < now:
        res =  i+1
        now = abs((t-(h[i]*0.006))-a) 
else:
    print(res)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int,input().split())
H = [int(x) for x in input().split()]
h = [T - (x * 0.006) for x in H]
ans = [abs(A - x) for x in h]

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

Submission status: Accepted

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

ans = 0
minDiff = float('inf')
for i, H in enumerate(Hs, 1):
    temp = T - 0.006 * H
    if abs(temp - A) < minDiff:
        ans = i
        minDiff = abs(temp - A)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int,input().split())
h_a = (t - a) / 0.006
h = list(map(int,input().split()))
m = 10**5
j = -1

for i in range(len(h)):
    h[i] = h[i] - h_a
    if h[i] < 0:
        h[i] = -h[i]
    if m > h[i]:
        m = h[i]
        j = i

print(j+1)

Submission status: Accepted

Solution code:
n = int(input())
[t,a] = list(map(int,input().split()))
h = list(map(int,input().split()))
ans = 0
point=1000

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8


def main():
    n = int(input())
    t, a = list(map(int, input().split()))
    hs = list(map(int, input().split()))
    best_t, best_i = None, None
    for i, h in enumerate(hs):
        temp = t - h * 0.006
        if best_t is None or abs(temp - a) < best_t:
            best_t = abs(temp - a)
            best_i = i+1
    print(best_i)


if __name__ == '__main__':
    main()

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=[]
for i in h:
    temp=t-a-0.006*i
    if temp <0:
        ans.append(temp*-1)
    else:
        ans.append(temp)

mi=ans[0]
num=0
for j, i in enumerate(ans):
    if mi > i:
        mi=i
        num=j

print(num+1)

Submission status: Accepted

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


ans = 1
c = h[0]
d = abs(h[0]-a)
h = [t-0.006*i for i in h]

for i in range(n):
    if abs(h[i]-a)<d:
        d=abs(h[i]-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()))

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
dif = abs(T - H[0] * 0.006 - A)
result = 1

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = list(map(int, input().split()))
tmp = list(map(int, input().split()))
H = {}
for i in range(len(tmp)):
    H[i] = tmp[i]

#print(sorted(H.items(), key=lambda x: x[1]))
minT = 1e10
ans = 0
for i,h in sorted(H.items(), key=lambda x: x[1]):
    t = T - h*0.006
    #print(i+1, t)
    if abs(t - A)<minT:
        minT = abs(t - A)
        ans = i+1
print(ans)

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

a = 0
c = 999
d = 0
for i in range(N):
    a = T - H[i]*0.006
    if c > abs(A-a):
        c = abs(A-a)
        d = i

print(d+1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Nov  4 18:53:53 2018
ABC113B
@author: maezawa
"""

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

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

near = min(dif)
ans = dif.index(near)+1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

H = map(int, raw_input().split())

Htemp = []
for i in H:
	subs = abs(A - (T-i*0.006))
	Htemp.append(subs) 

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

Submission status: Accepted

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

minAveTemp = 999999999
num = 1
ansNum = 1
for height in H:
    aveTemp = T - height * 0.006
    if abs(A-minAveTemp) > abs(A-aveTemp):
        minAveTemp = aveTemp
        ansNum = num
    num+=1

print(ansNum)

Submission status: Accepted

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

tmp = 1000
ans = 0
for i in range(len(H)):
    tmp_ = abs(A-(T-H[i]*0.006))
    if tmp_<tmp:
        ans = i
        tmp = tmp_
print(ans+1)

Submission status: Accepted

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

ans=0
t_ans=0

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

print(ans)

Submission status: Accepted

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

h = [0] * n

h = input().split()

mini = abs((t - float(h[0]) * 0.006) - a)

ans = 1

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

print(ans)

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()]
print(min(enumerate(H), key=lambda x: abs(T - x[1] * 0.006 - A))[0] + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
t=l[0]
a=l[1]
ll=list(map(int,input().split()))

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

Submission status: Accepted

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

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

score = 99999
position = 1
result = 1
for h in HList :
    avg = T - (h * 0.006)
    if(abs(avg - A) < score) :
        score = abs(avg - A)
        result = position
    position+=1
        
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import collections
import scipy.misc
import sys
import numpy as np
from operator import itemgetter

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   

"""
N, X = map(int, input().split())

x = [0]*N
x[:] = map(int, input().split())
"""

N = int(input())
T, A = map(float, input().split())
H = [0.]*N
H[:] = map(float, input().split())


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

Submission status: Accepted

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

for i in range(len(hs)):
    b = t - hs[i] * 0.006
    sa = abs(a-b)
    hs[i] = sa

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

Submission status: Accepted

Solution code:
import numpy as np

# x: T-x * 0.006
# 平均気温がA度に最も近い点を選ぶ
n = int(input())
t, a = map(int, input().split())
h = np.array(list(map(int, input().split())))
h2 = abs((t-h*0.006) - a)
res = np.where(h2==min(h2))[0][0] + 1

print(res)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
n=int(input())
t,a=map(int,input().split())
h=[int(i) for i in input().split()]
ans=[0,abs(a-(t-h[0]*0.006))]
for i in range(1,n):
    tmp=abs(a-(t-h[i]*0.006))
    if tmp<ans[1]: ans=[i,tmp]
print(ans[0]+1)

Submission status: Accepted

Solution code:
N = int(input())
t, h = map(int, input().split())


L = []

a = list(map(int, input().split()))
for i in a:
    L.append(abs(h - (t - i * 0.006)))

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = np.array(list(map(int,input().split())))
p = np.absolute(((T-H*0.006)-A))
print(np.argmin(p)+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(t-0.006*h[i]-a)

h_sub = sorted(h)
print(h.index(h_sub[0])+1)

Submission status: Accepted

Solution code:
a = input()
b = input().split()
c = input().split()
a = 100000
kekka = 0
for i in range(len(c)):
  ave = int(b[0]) - int(c[i]) * 0.006
  sa  = int(b[1]) - ave
  if sa < 0:
    sa *= -1
  if sa < a:
    a = sa
    kekka = i + 1
    
print(kekka)

Submission status: Accepted

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


H=(T-A)/0.006

l=list()
for i in range(N):
   lx=abs(h[i]-H)
   l.append(lx)
x=min(l)
print(l.index(x)+1)

Submission status: Accepted

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


def Palace():
    input()
    T, A = [int(n) for n in input().split()]
    candidate = [int(n) for n in input().split()]

    index = 1
    _min = float('inf')
    for i, elevation in enumerate(candidate, start=1):
        temp = T - elevation * 0.006
        diff = abs(A - temp)
        if diff < _min:
            _min = diff
            index = i

    print(index)


if __name__ == '__main__':
    Palace()

Submission status: Accepted

Solution code:
import numpy as np

n = input()
n= int(n)
ta = input()
t,a = ta.split()
t = int(t)
a = int(a)
H = input()
H = H.split()
dif = [i for i in range(n)]
for i in range(len(H)):
    dif[i] = int(H[i])
    dif[i] = abs(t-dif[i]*0.006-a)

d = np.array(dif)
print(np.argmin(d)+1)

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    i = 1
    for Hi in H:
        Hi_t = T - Hi * 0.006
        temp = math.fabs(A - Hi_t)
        if i == 1:
            result = temp
            answer = i
        else:
            if result > temp:
                result = temp
                answer = i
        i += 1

    print(answer)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# your code goes here
n=int(input())
a,b=map(int,input().split())
c=list(map(int,input().split()))
mi=(10000000000,-1)
for i in range(len(c)):
	mi=min(mi,(abs(a-c[i]*0.006-b),i))
print(mi[1]+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

HA = (T-A)/0.006

dH = 100000
point = 100000

for i in range(N):
  if dH > abs(float(H[i]) - HA):
    dH = abs(float(H[i]) - HA)
    point = i+1

print(point)

Submission status: Accepted

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

ans = 0
v = 10000000
for i in range(n):
    if v>=abs(A - (T-0.006*H[i])):
        ans = i + 1
        v = abs(A - (T-0.006*H[i]))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
i = 0
nums = [0, 10**6]

for h in list(map(int, input().split())):
    i += 1
    if abs(a - (t-h*0.006)) < abs(a - (t - nums[1]*0.006)):
        nums = [i, h]

print(nums[0])

Submission status: Accepted

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

min_tempdiff = 10000  # 十分大きい値で！
argmin_tempdiff = None
for i, h_val in enumerate(h_list):
    temp_diff = abs(a - (t - h_val * 0.006))
    if min_tempdiff > temp_diff:
        min_tempdiff = temp_diff
        argmin_tempdiff = i + 1  # 地点は配列インデックス+1

print(argmin_tempdiff)

Submission status: Accepted

Solution code:
N = int(input())#地点の数
temp = input().rstrip().split(" ")
T = int(temp[0])#平均気温は T − H * 0.006度
A = int(temp[1])#最も平均気温がAに近い地点を探す
temp = input().rstrip().split(" ")
ans = []
for i in range(N):
    #平均気温を求める式
    H = int(temp[i])
    AVG = T - H * 0.006
    DIF = A - AVG
    ans.append(DIF * DIF)
print(ans.index(min(ans))+1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = temp
        tmpa = i
print(tmpa + 1)

Submission status: Accepted

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

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

tmp_dif = [abs(a- (t - h[i]*0.006)) for i in range(len(h))]
#print(tmp_dif)

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