Problem:


Score: 200 points

Problem Statement

A country decides to build a palace.

In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.

There are N places proposed for the place. The elevation of Place i is H_i meters.

Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.

Print the index of the place where the palace should be built.

It is guaranteed that the solution is unique.

Constraints

1 \leq N \leq 1000

0 \leq T \leq 50

-60 \leq A \leq T

0 \leq H_i \leq 10^5

All values in input are integers.

The solution is unique.

Input

Input is given from Standard Input in the following format:

N
T A
H_1 H_2 ... H_N

Output

Print the index of the place where the palace should be built.

Sample Input 1

2
12 5
1000 2000

Sample Output 1

1

The average temperature of Place 1 is 12-1000 \times 0.006=6 degrees Celsius.

The average temperature of Place 2 is 12-2000 \times 0.006=0 degrees Celsius.

Thus, the palace should be built at Place 1.

Sample Input 2

3
21 -11
81234 94124 52141

Sample Output 2

3



Sample input:
2
12 5
1000 2000


Sample output:
1

Submission status: Accepted

Solution code:
def inpl(): return [int(i) for i in input().split()]
N = int(input())
T, A = inpl()
H = inpl()
for i in range(N):
    H[i] = (abs(T-0.006*H[i]-A),i)
H = sorted(H,key = lambda x: x[0])
print(H[0][1]+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(float,input().split())
h=input().split()
i=0
min_dis=1000000
p=0
while i<len(h):
    p_w=t-float(h[i])*0.006
    w=a-p_w
    if a-p_w<0:
        w=p_w-a
    if w<min_dis:
        min_dis=w
        p=i+1
    i+=1
print(p)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
import math
num=[]
temp=[]
ans=float("inf")
for i in range(n):
    num.append(t-0.006*h[i])
for i in range(n):
    temp.append(abs(num[i]-a))
ans=min(temp)
for i in range(n):
    if ans==temp[i]:
        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()]
I=[T-item*0.006 for item in H]
D=[abs(A-item) for item in I]
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()))

min_diff = float('inf')
ans = -1

for i, h in enumerate(H):
    ave = T - h * 0.006
    if abs(ave - A) < abs(min_diff - A):
        min_diff = ave
        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,items in enumerate(H):
  H[i]=T-items*0.006-A
  if(H[i]<0):
    H[i]=-H[i]
print(H.index(min(H))+1)

Submission status: Accepted

Solution code:
from sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    temperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
print(ans)

Submission status: Accepted

Solution code:
import sys

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

for i in range(len(hs)):
    hs[i] = float(hs[i])

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

min = 0
min_t = sys.maxsize
for i in range(len(hs)):
    dt = abs(ts[i] - a)
    if dt < min_t:
        min = i
        min_t = dt
print(min + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = list(map(int, input().strip().split(' ')))
array = list(map(int, input().strip().split(' ')))
c=(T-array[0]*0.006)-A
C = abs(c)
ans=[]
for i in array:
  x = (T-i*0.006)-A
  num = abs(x)
  if num<=C:
    C=num
    ans.append(i)
n = ans[-1]
Ans=array.index(n)+1
print(Ans)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
tt=0
tt_1=0
tt_2=0
b=0
c=0

t_list=[]
t_list_2=[]
for val in h:
	tt=t-(val*0.006)
	t_list.append(tt)

for val in t_list:
	tt=abs(a-val)
	t_list_2.append(tt)

t_list_2=sorted(t_list_2)
tt=t_list_2[0]
tt_1=a+tt
tt_2=a-tt

def my_index(t_list,x,default=False):
	if x in t_list:
		return t_list.index(x)
	else:
		return -1
b=my_index(t_list,tt_1)
c=my_index(t_list,tt_2)
if my_index(t_list,tt_1) == -1:
	print(c+1)
else :
	print(b+1)

Submission status: Accepted

Solution code:
N = input()
T, A = map(int, input().split())
Hs = list(map(int, input().split()))
result1 = []
for x in Hs:
    tmp = T - (x * 0.006)
    result1.append(tmp)
result2 = {}
for i, tmp in enumerate(result1):
    result2[i+1] = abs(A - tmp)
print(sorted(result2.items(), key=lambda x: x[1])[0][0])

Submission status: Accepted

Solution code:
n=input()
t,a=input().split()
n=int(n)
t=int(t)
a=int(a)
b=input().split()
min=1000
for i in range(n):
    diff=abs(a-t+0.006*int(b[i]))
    if min>diff:
        id=i+1
        min=diff

print (id)

Submission status: Accepted

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

indx = -1
error = 10000

for i, h in enumerate(hs):
    temp = T - h * 0.006
    if abs(temp - A) < error:
        indx = i
        error = abs(temp - A)
print(indx+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


def get_temp(height):
    return T - (0.006 * height)


ans = -1
cht = abs(get_temp(100000) - (-60))


for i in range(N):
    t = abs(get_temp(Hs[i]) - A)
    if t < cht:
        ans = i + 1
        cht = t

print(ans)

Submission status: Accepted

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

HL1 = [(x[0], abs(A - (T - x[1] * 0.006)), ) for x in enumerate(HL)]

HL1.sort(key=lambda x: x[1])

print(HL1[0][0] + 1)

Submission status: Accepted

Solution code:
grid = []
for i in range(3):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
x = 0
result = []
while x < grid[0][0]:
    calc = grid[1][0] - grid[2][x] * 0.006
    result.append(calc)
    x += 1

y = 0
result_comp = []
while y < len(result):
    comp = result[y] - grid[1][1]
    comp = abs(comp)
    result_comp.append(comp)
    y += 1

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = input().split()
differ = [0]*N
for i in range(N):
 if A < 0:
  differ[i] = abs((T - int(H[i])*0.006) - A)
 else:
  differ[i] = abs(A - (T - int(H[i])*0.006))
differ = np.array(differ)
print(differ.argmin()+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tem = 1000
z = 0
for i in h:
  c = t-0.006*i
  d = c - a
  e = tem - a
  if d**2 < e**2:
    tem = c
    z = i 
aa = h.index(z) + 1
print(aa)

Submission status: Accepted

Solution code:
from sys import stdin

n = int(stdin.readline().strip())
t, A = list(map(int, stdin.readline().split()))
h = list(map(int, stdin.readline().split()))

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

dist = float('inf')
index = 0
for i, num in enumerate(temp):
    boo = abs(A - num)
    if boo < dist:
        dist = boo
        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()))

min_diff = 10 ** 10
near_index = -1
for i, h in enumerate(H):
    t = T - h * 0.006
    if abs(t - A) < min_diff:
        min_diff = abs(t - A)
        near_index = i + 1

print(near_index)

Submission status: Accepted

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

i = 0
minGap = 100000
while i < N:
    AT = T - H[i] * 0.006
    gap = abs(A - AT)
    if minGap > gap:
        minGap = gap
        ans = i + 1
    i += 1

print(ans)

Submission status: Accepted

Solution code:
N = input().split()
T = input().split()
H = input().split()
maxtemp=9999999
ans = 0
for c,i in enumerate(H):
	P = int(T[0]) - int(i) * 0.006 - int(T[1])
	#print(P,c)
	#print("maxtemp",maxtemp)
	if min(maxtemp,abs(P)) == abs(P):
		maxtemp = abs(P)
		#print("chane")
		ans = c
		#print(ans)
print(str(ans+1))

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split(" "))
hs = list(map(int, input().split(" ")))
dif = list()
for h in hs:
    ave = t - h*0.006
    dif.append(abs(a-ave))

mindif = min(dif)

for i in range(n):
    if dif[i] == mindif:
        print(i+1)
        break

Submission status: Accepted

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

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

min=1000
for i in range(n):
  temp=abs(a-t+0.006*h[i])
  if min>temp:
    min=temp
    id=i
print(id+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = [int(x) for x in input().split(" ")]
H_list = [int(x) for x in input().split(" ")]

ave_list = [T - (H * 0.006) for H in H_list]

res_point = 0
res_ave = 99999

for enu, ave in enumerate(ave_list):
    if abs(res_ave - A) > abs(ave - A):
        res_ave = ave
        res_point = enu + 1
print(res_point)

Submission status: Accepted

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

test = False

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

def main():
    d = {}
    for i in range(N):
        ave_T = T - (H[i] * 0.006)
        d['{}'.format(i+1)] = abs(A - ave_T)
    if test:
        print(d)

    min_k = min(d, key=d.get)
    print(min_k)


if __name__ == '__main__':
    main()


"""
https://note.nkmk.me/python-dict-value-max-min/
"""

Submission status: Accepted

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

Submission status: Accepted

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

    min_diff = 100000000000000000000000000
    min_index = -1
    hs = list(map(float, input().split(' ')))
    for i in range(n):
        h = hs[i]
        cu_diff = abs(a - (t - h * 0.006))
        if cu_diff < min_diff:
            min_diff = cu_diff
            min_index = i

    print(min_index+1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

#print(H)
#H2 = list(map(lambda h: t - h*0.006, H))
#print(H2)
min_ = 100000000
min_i = -1
for i, h in enumerate(H):
    diff = abs(a-(t-h*0.006))
    if diff < min_:
        min_ = diff
        min_i = i + 1
print(min_i)

Submission status: Accepted

Solution code:
n = int(input())
ta = list(map(int,input().split()))
h = list(map(int,input().split()))
temp = []
for i in h:
  temp = temp + [ta[0] - i * 0.006]
sa = ta[1]-temp[0]
if (sa < 0):
  sa *= -1
loop = 1
ans = 1
for i in temp:
  j = ta[1]-i
  if (j<0):
    j *= -1
  if (j < sa):
    ans = loop
    sa = j
  loop += 1
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

s = 0
mn = 1 << 25
for i in range(N):
    t = abs(A - (T - H[i] * 0.006))
    if (mn >= t):
        s = i + 1
        mn = t
print(s)

Submission status: Accepted

Solution code:
def m():
    n = int(input())
    t, a = map(int, input().split())
    h = list(map(int, input().split()))
    b = []
    diff = 10 ** 6
    ans = 0
    for i in range(n):
        tmp = t - h[i] * 0.006
        d = abs(tmp - a)
        b.append((d, i+1))
    b.sort(key=lambda x: x[0])
    return b[0][1]
print(m())

Submission status: Accepted

Solution code:
def solve(N, T, A, H):
  best = (T - A) / 0.006
  index = -1
  diff = -1
  for i in range(N):
    d = abs(best - H[i])
    if diff == -1 or d < diff:
      diff = d
      index = i
  return index + 1

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

# print outputs
print(solve(N, T, A, H))

Submission status: Accepted

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

best_point=0
best=float('inf')
i=0
for hi in h:
    tmp = t - (hi * 0.006)
    dif = abs(a - tmp)
    if abs(dif) < abs(best):
        best = dif
        best_point = i + 1
    i += 1
print(best_point)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[i for i in map(int,input().split())]
t1,t2=0,100000
for i in range(N):
	t1=T-H[i]*0.006
	if(abs(A-t1) < abs(A-t2)):
		t3=i+1
		t2=t1
		t1=0
	else:
		t1=0
print(t3)

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

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

Submission status: Accepted

Solution code:
n = int(input())
T, A = map(float, input().split())
h = list(map(float, input().split()))
ans = 1

temp = abs(T-h[0]*0.006-A)
tempmin = temp
for i in range(1,n):
    temp = abs(T-h[i]*0.006-A)
    if(temp<tempmin):
        ans = i+1
        tempmin = temp
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ls = input().strip().split(' ')
T = int(ls[0])
A = int(ls[1])
ls = []
n = 1
for i in input().strip().split(' '):
    ls.append((abs(T - 0.006 * int(i) - A), n))
    n += 1
ls.sort()
print(ls[0][1])

Submission status: Accepted

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

L = [0]*n

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

num = 0
a = 1000

for i in range(0,n):
    a = min(a, L[i])
    if a == L[i]:
        num = i+1

print (num)

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):
    k = float(abs(a - (t - h[i] * 0.006)))
    if i == 0:
        g = k
        p = 0
    else:
        if g > k:
            g = k
            p = i

print(p+1)

Submission status: Accepted

Solution code:
#! /usr/bin/env python
#coding utf-8
import numpy as np

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

heights = list(map(int, input().split()))
temps = [T - height * 0.006 for height in heights]
rank = np.array([abs(A - temp) for temp in temps])

print(rank.argmin() + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding : UTF-8

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

flag = 1
num = 0
for i,h in enumerate(H):
    t = float(T)-(float(h)*0.006)
    a = abs(A-t) 
    if flag == 1 :
        ans = a
        num = i
        flag = 0
    elif ans > a:
        ans = a
        num = i
print (num+1)

Submission status: Accepted

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

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

aveH = map(tempAve, H)
aveMin = float('inf')
result = 0
for i, val in enumerate(aveH):
    diff = abs(val-A)
    if diff < aveMin:
        aveMin = diff
        result = i
print(result + 1)

Submission status: Accepted

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

N = int(input())

read_line = input().split()
T = int(read_line[0])
A = int(read_line[1])

height_list = [int(s) for s in input().split()]

diff = 99999
diff_index = 0

for i in range(len(height_list)) :
	temp = get_temp(T,height_list[i])
	
	if (abs(temp - A) < diff) :
		diff = abs(temp -A)
		diff_index = i
	


print (diff_index+1)

Submission status: Accepted

Solution code:
def run():
    N=int(input())
    T,A=input().split()
    T=int(T)
    A=int(A)
    H=input().split()
    for i in range(N):
        H[i]=float(H[i])
    ans=0
    for i in range(N):
        for j in range(N):
            if(abs(T-0.006*H[ans] - A)>abs(T-0.006*H[i] - A)):
                ans=i
    print(ans+1)

run()

Submission status: Accepted

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

    ans, mn = 0, abs(t-h[0]*0.006-a)
    for i in range(n):
        ai = t - h[i] * 0.006
        if abs(ai-a) < mn:
            ans = i
            mn = abs(ai-a)

    print(ans+1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Tave = [0 for _ in range(N)]
gap = [0 for _ in range(N)]
gapmin = 10000
Tmin = 0
for i in range(N):
    Tave[i] = T-0.006*(H[i])
    gap[i] = abs(Tave[i]-A)
    if gapmin>gap[i]:
        Tmin = i
        gapmin = gap[i]

print(Tmin+1)

Submission status: Accepted

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

for i in range(1,n+1):
    h[i] = t - 0.006 * h[i]
    if(h[i]>a):
        h[i] = h[i] - a
    else:
        h[i] = a - h[i]
        
nmin = 10000000000
num = 0
for i in range(1, n+1):
    if(nmin > h[i]):
        nmin = h[i]
        num = i
        
print(num)

Submission status: Accepted

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

list_h = list(map(int, input().split()))
dic_t = {i:T-h*0.006 for i, h in enumerate(list_h, 1)}

min_d = 100000
min_key = 0

for key, v in dic_t.items():
    d = abs(A-v)
    if d < min_d:
        min_d = d
        min_key = key
    else:
        pass

print(min_key)

Submission status: Accepted

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

temp_list = [abs((t-h*0.006)-a) for h in h_list]
ans = temp_list.index(min(temp_list))+1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

diff = []

for h in list_h:
  diff.append(abs(a - (t - h * 0.006)))
  
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()))

num = 0
for i in range(N):
  deff = abs(T-H[i]*0.006-A)
  if deff < abs(T-H[num]*0.006-A):
    num = i

print(num+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int, input().split())
h=list(map(int,input().split()))
min_gap=999
for i in range(n):
    tmp=t-0.006*h[i]
    if(abs(tmp-a)<min_gap):
        min_gap=abs(tmp-a)
        min_i=i

print(min_i+1)

Submission status: Accepted

Solution code:
def place(N,T,A,H):
    a=18000
    n=0
    for i in range(N):
        ave=T-H[i]*0.006
        if(abs(a-A)>abs(ave-A)):
            a=ave
            n=i+1
        
    return n

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

print(place(N,int(T),int(A),H))

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_T = [0 for i in range(len(H))]
for i in range(len(H)):
    H_T[i] = float(T) - float(H[i])*0.006

min = 1000
index = 0
for i in range(len(H_T)):
    if(abs(H_T[i] - A) < min):
        index = i
        min = abs(H_T[i] - A)
print(index+1)

Submission status: Accepted

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

H = map(int, raw_input().split(" "))
index = 0
closet = abs(T - 0.006*H[0] - A)
for i in range(1, N):
    diff = abs(T - 0.006*(H[i]) - A)
    if diff == 0:
        index = i
        break
    elif diff < closet:
        closet, index = diff, i
print index + 1

Submission status: Accepted

Solution code:
# coding:utf-8

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

h = raw_input().split()

# print n
# print t
# print h[0]

hdiff = [0] * n[0]
for i in range(n[0]):
    hdiff[i] = abs(t - a - int(h[i]) * 0.006)

# print hdiff

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

#if (b%2 == 1 and c%2 == 1):
#    print "Yes"
#else:
#    print "No"

Submission status: Accepted

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

last = 99999999999999
lastidx = -1
for idx, h in enumerate(Hs):
  dif = abs(A - (T - 0.006 * h))
  if last > dif:
    last = dif
    lastidx = idx + 1


print(lastidx)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())		# 5 7
H = list( map(int, input().split()) )	# 1 2 3 4 5 ...

#print(N,T,A)
#print(*H)

H = list(map(lambda x: abs(T-(0.006*x)-A), H) )	#=> [2, 4, 6, 8]
#print(*H)

ans = min(H)
#print(ans)

i=0
for i in range(N):
	if(ans==H[i]):break

print(int(i+1))

Submission status: Accepted

Solution code:
n = int(input()) # 宮殿の候補数
t,a = map(int,input().split())
x_li = list(map(int,input().split())) #標高のリスト

x_temp_li = []
x_a_li = []
for i in x_li:
    temp = t - i * 0.006
    x_temp_li.append(temp)
for i in x_temp_li:
    temp_a = i - a
    x_a_li.append(abs(temp_a))
print(x_a_li.index(min(x_a_li)) + 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 = np.argsort([abs(A - (T-h*0.006)) for h in H])[0]
print(temp+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
res_diff=666
res_idx=0
for i,x in enumerate(map(int,input().split())):
  if(abs(a-t+0.006*x)<res_diff):
    res_diff=abs(a-t+0.006*x)
    res_idx=i+1
print(res_idx)

Submission status: Accepted

Solution code:
import sys

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

N = array[0]


if N < 1:
    sys.exit()
if N > 1000:
    sys.exit()

#print("Aok")



array1 = list(map(int, input().strip().split(' ')))

T = array1[0]
A = array1[1]


if T < 0:
    sys.exit()
if T > 50:
    sys.exit()

if A < -60:
    sys.exit()
if A > T:
    sys.exit()

array2 = list(map(int, input().strip().split(' ')))

kazu = len(array2)

if kazu != N:
    sys.exit()

saiteki = 0

saiteki = 10**5

for i in range(N):

    #print("i",i)

    kensa = T - array2[i] * 0.006

    kensa1 = abs(A - kensa)

    if saiteki > kensa1:
        saiteki = kensa1
        saiteki_no = i


saiteki_no = saiteki_no + 1

print(saiteki_no)

Submission status: Accepted

Solution code:
# coding:utf-8

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

h = raw_input().split()

# print n
# print t
# print h[0]

hdiff = [0] * n[0]
for i in range(n[0]):
    hdiff[i] = abs(t - a - int(h[i]) * 0.006)

# print hdiff

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int,input().split())
li = list(map(int,input().split()))
n_temp = li[0]
answer = 0
for idx, temp in enumerate(li):
    i_temp = t - temp * 0.006
    if (abs(a - n_temp) >= abs(a -i_temp)):
        n_temp = i_temp
        answer = idx

print(answer+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())
to = 100000000000
c = 1
for i in H:
    temp = T-i*0.006
    b = A-temp
    if b < 0:
        b = -b
    if to > b:
        to = b
        k = c
    c += 1
print(k)

Submission status: Accepted

Solution code:
import numpy as np

N = input()
T, A = map(int, input().split())
H_list = []
H_list = list(map(int, input().split()))
T_list = list(map(lambda x : T - (x * 0.006), H_list))
T_list_2 = np.array(list(map(lambda x : abs(x - A), T_list)))
index = np.argmin(T_list_2)
print(index + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
t = int(input())
a,b = map(int, input().split())
ss = list(map(int, input().split()))
p = 0
mi= 99999999999999

for i in range(len(ss)):
    if mi > abs(b - (a - 0.006*ss[i])):
        p = i
        mi = abs(b - (a - 0.006*ss[i]))
print(p+1)

Submission status: Accepted

Solution code:
n = int(input())

t, a = input().strip().split(' ')
t, a = [int(t), int(a)]

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

min = 1000000
tmp = 1

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

def diff(ave_tmp):
    if (a - ave_tmp) > 0:
        return (a - ave_tmp)
    else:
        return (ave_tmp - a)

for i in range(len(h)):
    if diff(ave_tmp(h[i])) < min:
        min = diff(ave_tmp(h[i]))
        tmp = i + 1

print(tmp)

Submission status: Accepted

Solution code:
import math

def gcd(a,b):
    """Compute the greatest common divisor of a and b"""
    while b > 0:
        a, b = b, a % b
    return a

def lcm(a, b):
    """Compute the lowest common multiple of a and b"""
    return a * b / gcd(a, b)


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

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

best_i = 0
best_temp = T-H[0]*0.006

for i in range(1,N):
	if(abs(A-best_temp) > abs(A-(T-H[i]*0.006))):
		best_i = i
		best_temp = T-H[i]*0.006

print(best_i+1)

Submission status: Accepted

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

# Init
min = 99999
ans = -1

# Loop n Times
for idx in range(n):
    if abs(a - (t - h[idx] * 0.006)) < min:
        min = abs(a - (t - h[idx] * 0.006))
        ans = idx + 1

# Output
print(int(ans))

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int, input().split())
h = map(float, input().split())
H = list(map(lambda x: abs(A - (T - (x * 0.006))), h))

ans = -1
tar = 999999999999
for i,v in enumerate(H):
    if tar > v:
        tar = v
        ans = i
print(ans + 1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Describe
"""
import numpy as np

def temp(height, t): 
    return t - 0.006 * height
   
def temp_to_height(a, t):
    return (t - a) / 0.006

def main():
    n = int(input())
    t, a = map(int, input().split())
    goal_height = temp_to_height(a, t)

    heights = list(map(int, input().split()))
    # print('heights: ', heights)
    # print('goal height: ', goal_height)


    best_index = -1
    best_diff = np.inf

    for i, h in enumerate(heights):
        diff = abs(h - goal_height)
        if diff < best_diff:
            best_diff = diff
            best_index = i
    best_number = best_index + 1

    print(best_number)
    
    

main()

Submission status: Accepted

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

def mean_temp(t, x):
    temp = t - x * 0.006
    return temp

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

if __name__ == '__main__':
    n = int(raw_input())
    t, a = map(int, raw_input().split())
    hs = map(int, raw_input().split())

    result = []
    for h in hs:
        result.append(mean_temp(t, h))
    output = getNearestIdx(result, a) + 1
    print output

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(float,input().split())
Areal=0.0
Areal=(T-A)//0.006
x=list(map(float,input().split()))
point=0
for i in range(N):
        if abs(x[point]-Areal) > abs(x[i]-Areal):
                point=i
print(point+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def htemp(t, x):
    return float(t - 0.006 * x)
    
input()
lt, la = [int(x) for x in input().split()]
h_ary = [int(x) for x in input().split()]
    
maxdiff = float('inf')
goodpoint = 0
for i, h in enumerate(h_ary):
    diff = abs(la - htemp(lt, h))
    if diff < maxdiff:
        maxdiff = diff
        goodpoint = i
print(goodpoint+1)

Submission status: Accepted

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

lists = list(map(int, input().split()))
ans = []

for i in lists:
    temp = t - i*0.006
    b = a - temp
    ans.append(abs(b))

answer = min(ans)
    
for i in range(len(lists)):
    temp = t-lists[i]*0.006
    b = abs(a-temp)
    if b == answer:
        print(i+1)
        break