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:
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
ans=1
tmp=float('inf')
for i in range(n):
    if abs(tmp-a)>abs(t-h[i]*0.006-a):
        ans=i+1
        tmp=t-h[i]*0.006
    # print(tmp)
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()]
ans=1
Temp = abs(T -A - 0.006*H[0])

for i in range(N):
    _Temp = abs(T -A - 0.006*H[i])
    if Temp > _Temp:
        Temp = _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()))

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 = [int(i) for i in input().split()]
H =[int(i) for i in input().split()]

 
HH=[abs(A-(T-h*0.006))for h in H]  
print(int(HH.index(min(HH))+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=list(map(int,input().split()))

tar=1000*(t-a)/6
best=10**5
best_i=-1
for i in range(len(H)):
  dif=abs(tar-H[i])
  if dif<best:
    best=dif
    best_i=i
print(best_i+1)

Submission status: Accepted

Solution code:
n=int(input())

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

T=[abs(a-(t-i*0.006)) for i in h]

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

Submission status: Accepted

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

aa = float('inf')
ans = 0

for i in a:
    avg = x - i * 0.006
    dif = abs(y-avg)
    aa = min(aa,dif)
    if dif <= aa:
        ans = a.index(i)
        
print(ans+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()))

# at = [t - x * 0.006 for x in h]
h = np.array(h)
at = t - h * 0.006
diff = abs(a - at)

print(np.argmin(diff) + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

mindist = 1e5
ans = -1

for i in range(N):
	curdist = abs(T - H[i] * 0.006 - A)
	if mindist > curdist:
		mindist = curdist
		ans = i

print(ans + 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main(n, t, a, h):
    def formula(t, x): return t - x * 0.006
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

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


if __name__ == "__main__":
    n = int(input())
    t, a = map(int, input().split(' '))
    h = list(map(int, input().split(' ')))

    main(n, t, a, h)

Submission status: Accepted

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

best = t - h[0] * 0.006
ans = 0

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

Submission status: Accepted

Solution code:
import numpy as np

def find_nearest(array, value):
    min_value = np.abs(max(array))
    min_idx = 0
    j = 0
    idx = np.abs(value - np.asarray(array)).argmin()

    #for i in array: 
     #   j += 1
      #  if(min_value > np.abs(value - i)):
       #     min_value = np.abs(value - i)
        #    min_idx = j
    return idx + 1

input_N = input()
input_two = input().split()
input_three = input().split()

N = int(input_N)
T = int(input_two[0])
A = float(input_two[1])

H_f = [float(s) for s in input_three]
j = 0
degree_list = list(range(j))
for i in H_f:
    degree_list.append(T-i*0.006)

print(find_nearest(degree_list, A))

Submission status: Accepted

Solution code:
N =int(input())

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

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

diff_list = []

cur = 0

for i in range(N):
  diff = abs(A - (T - H[i] * 0.006))
  diff_list.append(diff)
  if diff == min(diff_list):
    cur = i + 1

print(cur)

Submission status: Accepted

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

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

print(index)

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()]
ans = [abs(a - (t - 0.006*i)) for i in h]
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()))
diff = 1000
for i, hi in enumerate(h):
    hi_temp = abs(a - (t - hi*0.006))
    if hi_temp < diff:
        diff = hi_temp
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
import bisect


def palace():
    def average_temperature(height):
        return t - (height * 0.006)
    
    def get_key_from_value(dict, value):
        for k, v in dict.items():
            if v == value:
                return k
    
    n = int(input())
    t, a = map(float, input().split())
    
    h = list(map(int, input().split()))
    h_dict = {}
    for i in range(n):
        h_dict[i + 1] = average_temperature(h[i])
    
    h_sorted = sorted(h, reverse=True)
    temperatures = [average_temperature(height) for height in h_sorted]
    
    index = bisect.bisect_left(temperatures, a)
    if index - 1 >= 0 and index <= n - 1:
        choices = [temperatures[index - 1], temperatures[index]]
        abses = [abs(a - choices[0]), abs(a - choices[1])]
        if abses[0] >= abses[1]:
            print(get_key_from_value(h_dict, choices[1]))
        else:
            print(get_key_from_value(h_dict, choices[0]))
    else:
        if index - 1 >= 0:
            choice = temperatures[index - 1]
            print(get_key_from_value(h_dict, choice))
        if index <= n - 1:
            choice = temperatures[index + 1]
            print(get_key_from_value(h_dict, choice))


if __name__ == '__main__':
    palace()

Submission status: Accepted

Solution code:
#2019/10/24
N,T,A,*H = map(int, open(0).read().split())
# print(N,T,A,H)
Th = []
for i in H:
    Th.append(abs(T-i*0.006-A))
print(Th.index(min(Th))+1)

Submission status: Accepted

Solution code:
#
# abcxxx b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


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

    ans = 1
    tmpt = float('inf')
    for i in range(N):
        tmp = abs(T-H[i]*0.006-A)
        if tmp == min(tmp, tmpt):
            tmpt = tmp
            ans = i+1
    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
12 5
1000 2000"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
21 -11
81234 94124 52141"""
        output = """3"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

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

Hnp = np.array(H)
temp = np.abs(T - Hnp * 0.006 - A)
print(temp.tolist().index(min(temp)) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

ideal_hight = int((T - A) / 6 * 1000)

close_hight = 500000
close_hight_id = 0

for i in range(0, N):
    if abs(ideal_hight - H[i]) <= close_hight:
        close_hight = abs(ideal_hight - H[i])
        close_hight_id = i

print(close_hight_id + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = [int(s) for s in input().split(' ')]
Ht = [T - int(s) * 0.006 - A for s in input().split(' ')]
#for i, ta in zip(range(1, len(Ht)+1), Ht):
ret = min(zip(range(1, len(Ht)+1), Ht), key=(lambda x: abs(x[1])))
print(ret[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = [int(i) for i in input().split()]
h = [int(j) for j in input().split()]
value = 100000
ret = 0
for i, k in enumerate(h):
    tmp = abs((t - k * 0.006) - a)
    if tmp < value:
        ret = i
        value = tmp
print (ret + 1)

Submission status: Accepted

Solution code:
import os, sys, re, math

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

best_diff = 1000
best_index = 0

for i in range(N):
    t = T - H[i] * 0.006
    diff = abs(t - A)
    if diff < best_diff:
        best_index = i
        best_diff = diff

print (best_index + 1)

Submission status: Accepted

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

Submission status: Accepted

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

min_temp = 1000
for i in range(N):
    c = T - (H[i] * 0.006)
    if abs(A - c) < min_temp:
        ans = i
        min_temp = abs(A - c)

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

tmp_diff_list = [abs(t-i*0.006-a) for i in list(map(int, input().split()))]

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h, i = min(zip(map(int, input().split()), range(n)), key=lambda hi: abs(t - hi[0] * 0.006 - a))
print(i + 1)

Submission status: Accepted

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

i = 1
i_H_list = []
for H in H_list:
    ave_T = T - H * 0.006
    i_H_list.append([i, abs(A - ave_T)])
    i += 1

min_diff = -1
min_diff_i = -1
for i in range(len(H_list)):
    if min_diff > i_H_list[i][1] or min_diff == -1:
        min_diff = i_H_list[i][1]
        min_diff_i = i_H_list[i][0]
print(min_diff_i)

Submission status: Accepted

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

temperatures =[]
for hight in hights:
    temperature = T - hight*0.006
    temperatures.append(temperature)

ans = 10**9
for temp in temperatures:
    sub = abs(temp-A)
    if sub < ans:
        ans = sub
        ans_number = temperatures.index(temp)

print(ans_number+1)

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

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()))
ta=[]
for i in range(len(h)):
    ta.append(abs( a-(t-h[i]*0.006)))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

mind=10**9

for i in range(N):
    if abs(H[i]-H0)<mind:
        ans=i+1
        mind=abs(H[i]-H0)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

m = 1000
for i in range(n):
  d=t-h[i]*0.006
  if abs(a-d) < m:
    m = abs(a-d)
    c = i
print(c+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
TA = list(map(float,input().split()))
H = list(map(float,input().split()))
temp = 99999999999999.999
ind = 0
for x in H:
	if temp > abs(TA[1] -(TA[0]-x*0.006)):
		temp = abs(TA[1] -(TA[0]-x*0.006))
		ind = H.index(x)
print(ind+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
ans = 0
t_dif = 999
t_dif1 = 0
for i in range(n):
    t_dif1 = abs(a - (t - h[i]*0.006))
    if t_dif1 < t_dif:
        ans = i+1
        t_dif = t_dif1
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 = 10**9
for i in range(N):
  avg = T - H[i] * 0.006
  dff = abs(A - avg)
  if dff < tmp:
    tmp = dff
    ans = i + 1
print(ans)

Submission status: Accepted

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

best_t = 10**3
ans = 0

for i in range(n):
    if abs(a - (t-H[i]*0.006)) < best_t:
        best_t = abs(a - (t-H[i]*0.006))
        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()))
ind = [abs(a-(t-0.006*i)) for i in h]
print(ind.index(min(ind))+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input().split()[0])
T, A = list(map(int, input().split()))
h_list = list(map(int, input().split()))
min_diff = float("inf")
target = -1

for i, h in enumerate(h_list):
    m = T - h * 0.006
    if abs(m - A) < min_diff:
        target = i + 1
        min_diff = abs(m - A)

ans = target
print(ans)

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

point = -1
temp_diff = float('inf')
for i, h in enumerate(H):
  temp = T - h * 0.006
  if abs(A - temp) < temp_diff:
    point = i+1
    temp_diff = abs(A - temp)
print(point)

Submission status: Accepted

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

    palace_place = -1
    minimam_difference = 0
    for i, h in enumerate(H):
        temperature = T - (h*0.006)
        temperature_difference = abs(A-temperature)
        if i == 0 or minimam_difference > temperature_difference:
            minimam_difference = temperature_difference
            palace_place = i
    
    print(palace_place+1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

for i in range(0,len(H)):
  H[i]=abs(1000*a-t*1000+H[i]*6)
  
print(H.index(min(H))+1)

Submission status: Accepted

Solution code:
# coding: utf-8

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

min=1000000000
for i in range(N):
    diff = abs((T-H[i]*0.006)-A)
    if (min>diff):
        min = diff
        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()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

n = int(input())
t, a = list(map(int, input().split()))
h = list(map(int, input().split()))
tmps = []
for i in range(n):
    ave_t = t - h[i]*0.006
    tmps.append(ave_t)

target = getNearestValue(tmps,a)
print(tmps.index(target) + 1)

Submission status: Accepted

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

ans=0
cnt=10000
TEMP=0.006

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    t, a = list(map(int, input().rstrip('\n').split()))
    h = list(map(int, input().rstrip('\n').split()))
    tn = 0
    ma = 10 ** 10
    for i in range(n):
        tt = abs(t - (h[i] * 0.006) - a)
        if ma > tt:
            ma = tt
            tn = i + 1
    print(tn)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

ts = []
for sh in h:
    ts.append(t - 0.006 * sh)

sabun  = 1000000000000
res = 0
for i in range(n):
    if abs(ts[i]-a) < sabun:
        sabun = abs(ts[i]-a)
        res = i+1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

l=[]

for i in range(n):
  l.append((t-h[i]*0.006-a)**2)
m=min(l)
for i in range(n):
  if l[i]==m:
    print(i+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(h)):
    temp = t-h[i]*0.006
    if i == 0:
        min_dist = abs(temp-a)
        ans = i
    elif min_dist > abs(temp-a):
        min_dist = abs(temp-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()))
ans = -1
dif = 100000000.0
for i in range(N):
    if abs(T-H[i]*0.006- A) < dif:
        dif = 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()))

k = abs(a- (t - h[0] * 0.006))
candidate = 0
for i in range(n):
    avg_tmp = t - h[i] * 0.006
  #  print(avg_tmp)
    if k >= abs(a - avg_tmp):
        candidate = i + 1
        k = abs(a - avg_tmp)

print(candidate)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
import sys
input = sys.stdin.readline


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

    d_min = float('inf')
    ans = 0
    for i in range(n):
        d = abs(a - (t - H[i]*0.006))
        if d<d_min:
            d_min = d
            ans = i+1
    
    print(ans)
    

 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

conf =1000000000
cnt = 0
for i in H:
    if conf > abs(A -(T-i*0.006)):
        conf = abs(A -(T-i*0.006))
        cnt = i
        
print(H.index(cnt)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from bisect import *
from collections import *
from copy import deepcopy
from datetime import *
from heapq import *
from itertools import *
# from math import *
from operator import *
from pprint import *

sys.setrecursionlimit(10**8)

input = sys.stdin.readline

def main():
    """ main """
    N = int(input())
    T,A = map(int, input().split())
    HS = list(map(int, input().split()))
    temps = [T-h*0.006 for h in HS]

    ans = 0
    tmp = float('inf')
    for idx, temp in enumerate(temps):
        if abs(A-temp) < tmp:
            ans = idx+1
            tmp = abs(A-temp)
    print(ans)

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=[abs(T-i*0.006-A) for i 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()))
TA=10**5+1
for i in range(n):
    if TA>abs(a-t+h[i]*0.006):
        ans=i+1
        TA=abs(a-t+h[i]*0.006)
 
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for x in h:
    heat = abs(a - (t - x*0.006))
    locate.append(heat)

near_t = min(locate)
print(locate.index(near_t)+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
p = 0
mn = 1000
for i in range(N):
    H[i] = abs(A - (T - H[i] * 0.006))
    if H[i] < mn:
        mn = H[i]
        p = i

print(p + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    t, a = map(int, input().split())
    print(
        min(
            [
                [i, t - h * 0.006]
                for i, h in enumerate(map(int, input().split()), start=1)
            ],
            key=lambda x: abs(x[1] - a),
        )[0]
    )


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=[]
for i, name in enumerate(h):
    ans.append([i+1, abs((t-name*0.006)-a)])
ans.sort(key=lambda x: x[1])
print(ans[0][0])

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

res = abs(a - (t - h[0] * 0.006))
ans = 1
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        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()))
dt=1000000
ans=-1
th=0
for i in range(n):
  th=abs(a-t+h[i]*0.006)
  if th<dt:
    ans=i+1
    dt=th
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

DOWN_RATE = 0.006
INF_TEMP = 50 + 100000 * DOWN_RATE

betterTemp = INF_TEMP
betterPlace = 0
for i in range(n):
    tempTemp = t - (h[i] * DOWN_RATE)
    tempDiff = abs(a-tempTemp)
    if tempDiff <= betterTemp:
        betterTemp = tempDiff
        betterPlace = i

print betterPlace + 1