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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

#print(dp)
print(dp.index(min(dp))+1)

Submission status: Accepted

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

n = int(input())

t, a = map(int,input().split())

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

'''
T - li[] * 0.006 = A が一番近いもの
'''

p = abs(t - li[0] * 0.006 - a) #基準の絶対値
q = 0
s = 0

for i in li:

    b = abs(t - int(i) * 0.006 - a)

    if b < p :
        p = b
        s = q

    q = q + 1

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

ave = []
for hi in list(map(int, input().split())):
  ave.append(abs(a - (t - hi * 0.006)))
print(ave.index(min(ave)) + 1)

Submission status: Accepted

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

ave = []
for hi in list(map(int, input().split())):
  tmp = t - hi * 0.006
  ave.append(abs(a - tmp))
print(ave.index(min(ave)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input();T,A=map(int,input().split());H=list(map(lambda x:abs(A-T+int(x)*0.006),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(lambda x: abs(A-T+x*0.006), list(map(int,input().split()))))
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()))

t_list = [t - h * 0.006 for h in h_list]
diff = 10000
point = 0

for i, temp in enumerate(t_list):
    d = abs(a-temp)
    if d < diff:
        diff = d
        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()))
l=[]
for h in H:
    l.append(abs(a-t+h*0.006))
print(l.index(min(l))+1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
tem = []
for i in range(n):
    tem1 = t-h[i]*0.006
    tem1 = abs(tem1-a)
    tem.append([tem1, i+1])
tem.sort()
print(tem[0][1])

Submission status: Accepted

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

temp_diff = 10**10
ans = 0

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

tempurature = []

for i in height:
    n = T - (i * 0.006)
    tempurature.append(abs(A - n))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from operator import itemgetter

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

for i, x in enumerate(h, 1):
    avg = t - x * 0.006
    delta = abs(a - avg)
    deltas.append((i,delta))
answer = min(deltas, key=itemgetter(1))[0]
print(answer)

Submission status: Accepted

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

l = []

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = [int(_) for _ in input().split()]
h = list(map(int, input().split()))
tmp = 10e9
output = 0

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

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

answer = [0]
min = abs(t - 0.006 * max(h) - a) 
for i in range(len(h)):
  if abs(t - 0.006*h[i] -a) <= min:
    min = abs(t - 0.006 * h[i] -a)
    answer.remove(answer[0])
    answer.append(i)
print(answer[0]+1)

Submission status: Accepted

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

min_v = 10 ** 10
index = 0
for i in range(N):
    diff = abs((T - H[i] * 0.006) - A)
    if diff < min_v:
        min_v = diff
        index = i + 1


print(index)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    diff_min = 10**6
    best = 0
    for i in range(N):
        if diff_min > abs(T - 0.006*H[i] - A):
            diff_min = abs(T - 0.006*H[i] - A)
            best = i + 1
    print(best)

Submission status: Accepted

Solution code:
n = int(input())
t,a = [int(i) for i in input().split()]
h =[int(x) for x in input().split()]
for i in range(len(h)):
  h[i] =abs(a-(t-0.006*h[i]))
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()))
cmin = 10**6
for i in range(N):
    t = T-H[i]*0.006
    if abs(A-t)<cmin:
        cmin = abs(A-t)
        ind = i+1
print(ind)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
t, a = map(int,input().split())
src = list(map(int,input().split()))
new = []
for s in src:
    new.append(math.fabs(t-s*0.006-a))
print(new.index(min(new))+1)

Submission status: Accepted

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

diff = [0] * n

for i in range(0, n):
    diff[i] = abs(a - (t - nums[i] * 0.006))

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

Submission status: Accepted

Solution code:
#coding:utf-8

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

#各地点と平均気温aとの差の絶対値を格納するリスト
diff = [0] * n
for i in range(0,n):
    diff[i] = abs(a - (t - h[i] * 0.006))

#差が最小の要素のインデックスを抽出
print(diff.index(min(diff)) + 1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
H = [int(x) for x in input().split()]
ans, ans_abs = -1, float('inf')
H=[(i+1,t-h*0.006) for i,h in enumerate(H)]

for i,h in H:
  if ans_abs > abs(a-h):
    ans =i
    ans_abs = abs(a-h)
print(ans)

Submission status: Accepted

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

ans, ans_abs = -1, float("inf")
H = [(i+1, T - h*0.006) for i, h in enumerate(H)]
for i, h in H:
    if ans_abs > abs(A - h):
        ans = i
        ans_abs = abs(A - h)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
H = [t-h*0.006 for h in list(map(int,input().split()))]
min_abs = float('inf')
index = 0
for h in H:
  if abs(h-a) < min_abs:
    min_abs = abs(h-a)
    index = H.index(h)
print(index +1)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
List=list(map(int,input().split()))
a=[]
for i in range(N):
    a.append(abs(T-List[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 = list(map(int, input().split()))


dif_list = []
for i in range(N):
    iTemp = T - (H_list[i] * 0.006)
    dif = abs(A - iTemp)
    dif_list.append(dif)

M = min(dif_list)
l = dif_list.index(M)

print(l + 1)

Submission status: Accepted

Solution code:
# ABC113b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

ans = 0
for i in range(n):
    if(abs(a-(t-h[i]*0.006)) <= abs(a-(t-h[ans]*0.006))):
        #print(abs(a-(t-h[i]*0.006)), score)
        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()))

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 = [int(h) for h in input().split()]
dt = [(i, abs(T - h * 0.006 - A)) for i, h in enumerate(H, 1)]
print(min(dt, key=lambda x: x[1])[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

sa = 10000
for i in range(n):
    if sa > abs(a - (t - array[i] * 0.006)):
        sa = abs((a - (t - array[i] * 0.006)))
        ans = i + 1

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()]
mi = 1000
ans = 0
for i in range(N):
  t=T-H[i]*0.006
  if mi>abs(A-t):
    mi = abs(A-t)
    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_diff = float("inf")
min_idx = 0
for i in range(N):
    diff = abs(A - (T - H[i] * 0.006))
    if min_diff > diff:
        min_diff = diff
        min_idx = i
print(min_idx + 1)

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:
#ABC113B
n = int(input())
T,a = list(map(int,input().split()))
h = list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
import sys

#+++++
		
def main():
	n = int(input())
	t , a = map(int, input().split())
	hl = list(map(int, input().split()))
	get_t=lambda x : t - x * 0.006
	get_e=lambda x : abs(a-get_t(x))
	
	mv=None
	mi=None
	
	for i,h in enumerate(hl):
		mm= get_e(h)
		if mv is None or mm < mv:
			mv = mm
			mi = i
	
	print(mi+1)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

sub = 10**5
for i, h in enumerate(H):
    temp = t - h * 0.006
    if sub > abs(a - temp):
        sub = abs(a - temp)
        ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
T, A = map(int, input().split())
array = list(map(int, input().split()))
ans = abs(A - (T - (array[0] * 0.006)))
ans_num = 1
for i in range(1,N):
    if abs(A - (T - (array[i] * 0.006))) <= ans:
        ans = abs(A - (T - (array[i] * 0.006)))
        ans_num = i + 1
print(ans_num)

Submission status: Accepted

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

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

Submission status: Accepted

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

m = 0.006
candidate_num = 0

for i in range(N):
  if abs(T - m*H[candidate_num] - A) > abs(T - m * H[i] - A):
    candidate_num = i
print(candidate_num+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()]

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

Submission status: Accepted

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

avet=[]
for c in h:
  avet.append(abs((t-6/1000*c)-a))

#print(avet)

for i in range(n):
  if avet[i] == min(avet):
    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_ = [abs(A-(T-0.006*h)) for h in H]

temp = 10**7
ans = 1

for i in range(N):
    if H_[i] < temp:
        temp = H_[i]
        ans = i+1
print(ans)

Submission status: Accepted

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

temps = [abs(a - (t - h * 0.006)) for h in hs]

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

Submission status: Accepted

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

Submission status: Accepted

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

An = [abs(A - (T - 0.006*i)) for i in Hn]
print(An.index(min(An))+1)

Submission status: Accepted

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

An = [T - 0.006*i for i in Hn]

tp = [10000000]*(N+1)
tpa = N
for i in range(N):
  tp[i] = abs(A - An[i])
  tpa = i if tp[i] < tp[tpa] else tpa

print(tpa+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
S=list(map(int,input().split()))
ans = -1
minsa = 10**10
for point,s in enumerate(S):
  sa = (t-s*0.006 - a)**2
  if minsa > sa:
    minsa = sa
    ans = point

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=[0]+list(map(int,input().split()))
List = sorted([[i,abs((t-h[i]*0.006)-a)] for i in range(1,n+1)],key = lambda x:x[1])
print(List[0][0])

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())

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

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

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

Submission status: Accepted

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

p=0
m=10**10

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

Submission status: Accepted

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

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

lis = []
for i in range(n):
  lis.append(abs(a-T(h[i])))
print(1+lis.index(min(lis)))

Submission status: Accepted

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

Submission status: Accepted

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

    temp = t - xs[i] * 0.006
    cand.append(abs(a - temp))
copy = cand[:]
cand.sort()
print(copy.index(cand[0]) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

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

# solve
ans = 0
min_ave_temp = T - H[0] * 0.006
for i in range(1, N):
    ave_temp = T - H[i] * 0.006
    if abs(A - ave_temp) < abs(A - min_ave_temp):
        ans = i
        min_ave_temp = ave_temp

# output
print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
tmp=input().split()
T=int(tmp[0])
A=int(tmp[1])
H=input().split()
H=[abs(A-(T-0.006*int(H[i]))) for i in range(0,N)]
min=H[0]
index=0
for i in range(1,N):
    if min>H[i]:
        min=H[i]
        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()))

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

Submission status: Accepted

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

ans = 0
difmin = 10**7

for i in range(N):
    ht = T - H[i] * 0.006
    dif = abs(ht - A)
    
    if dif < difmin:
        difmin = dif
        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
difmin = float("inf")

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

Submission status: Accepted

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
before=math.fabs(t-h[0]*0.006-a)
num=1
for i in range(n-1):
  diff=before-math.fabs(t-h[i+1]*0.006-a)
  if diff>0:
    before=math.fabs(t-h[i+1]*0.006-a)
    num=i+2
print(num)

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_t = t - h[i] * 0.006
  ans.append(abs(a - h_t))
print(ans.index(min(ans)) + 1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))
ts = [t - 0.006 * h for h in hs]

temp = int(10**9)
res = 0
for i, t in enumerate(ts):
    d = abs(a - t)
    if d < temp:
        res = i
        temp = d
print(res + 1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
points = map(int, input().split())
result = 0
_min = None
for i, p in enumerate(points):
    temp = t - p * 0.006
    diff = abs(a - temp)
    if _min is None or _min > diff:
        _min = diff
        result = i + 1
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
N = int(sys.stdin.readline())  # N個の候補
T, A = map(int, sys.stdin.readline().strip().split())  # T-x*0.006度, A度に近い地点
H = list(map(int, sys.stdin.readline().strip().split()))

ans = 0

# A度に近い地点を探す
gosa = 1e+9

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

T_1 = T - 0.006 * int(H[0])
diff = abs(T_1 - A)
index = 1
for i in range(1, N):
    T_new = T - 0.006 * int(H[i])
    diff_new = abs(T_new - A)
    if diff_new < diff:
        diff = diff_new
        index = i + 1
        
print(index)

Submission status: Accepted

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

ave = 0
tmp = 0
ans_t = 10**5
ans = 0
for i in range(N):
    ave = T - H[i]*0.006
    tmp = abs(A - ave)
    if ans_t > tmp:
        ans_t = tmp
        ans = i + 1
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
min_dif=float('inf')
for i in range(n):
    tem=t-h[i]*0.006
    dif=abs(tem-a)
    if dif<min_dif:
        min_dif=dif
        min_ind=i
print(min_ind+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
I = min(range(N), key=lambda i: abs(T-Hs[i]*0.006-A))
r = I+1
print(r)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int, input().split())
H=[abs(A-(T-(int(i)*0.006))) 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()))
c=10000000
n=0
for i in range(N):
  d=abs(A-(T-(H[i]*0.006)))
  if c>d:
    c=d
    n=i+1
print(n)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T,A = map(int, input().split())
Hs = input().split()
for i in range(N):
  Hs[i] = int(Hs[i])
Hs = np.array(Hs)

Ts = T - Hs*0.006

Ts_A = np.abs(Ts - A)

print(np.argmin(Ts_A)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
lst = list(map(int, input().split()))
x = 10**9
loc = 0
for i in range(N):
    a = abs(A-T+0.006*lst[i])
    if a < x:
        loc = i
        x = a
print(loc+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split(" "))
arr = list(map(int, input().split(" ")))
near = 100000
index = 1

for i in range(N):
  avg = T - arr[i] * 0.006
  avg_sub = A - avg
  # print(avg_sub)
  if avg_sub < 0:
    avg_sub *= -1
  if near > avg_sub:
    near = avg_sub
    index = i + 1
# print(near)
print(index)

Submission status: Accepted

Solution code:
import math

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

distance = float('inf')
answer = 0
for i, h in enumerate(H, 1):
    d = abs(A - (T - h * 0.006))
    distance = min(d, distance)
    if distance == d:
        answer = i

print(answer)

Submission status: Accepted

Solution code:
N = int(input())
T,A=map(int,input().split())
h_list =list(map(int,input().split()))
dif_list = [abs(A-(T-x*0.006)) for x in h_list]
mn =min(dif_list)
for i in range(N):
	if mn == dif_list[i]:
		break
print(i+1)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
height_list =list(map(int,input().split()))
val =10000
site=0
for i in range(N):
	dif=T-0.006*height_list[i]
	if abs(A-dif)<=val:
		val = abs(A-dif)
		site = i
print(site+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

best_near = 100000000
ans = 0
for i in range(N):
    temp = T - H[i]*0.006
    if best_near > abs(A - temp):
        best_near = 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()))
temp = 10**10
ans = 0
for i in h:
    avet = t - i*0.006
    if temp > abs(avet-a):
        temp = abs(avet-a)
        ans = h.index(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
tmp = 1000
for i, h in enumerate(H):
    k = abs(A - (T - h * 0.006))
    if k < tmp:
        tmp = k
        ans = i

print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

z =  [abs(T-0.006*i-A) for i in H_list]
print(z.index(min(z))+1)