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

res = float("inf")
ans = 0

for i in range(n):
    t = T - h[i]*0.006
    #print(t)
    if abs(t-A) < abs(res-A):
        res = t
        ans = i+1

print(ans)

Submission status: Accepted

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

answers = []

for j in a:
  a_2 = T - j * 0.006
  answer = abs(A - a_2)
  answers.append(answer)

min_answer = min(answers)
index_number = answers.index(min_answer)
print(index_number +1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
m = float("INF")
num = 0
for i in range(n):
    if abs(t - h[i] * 0.006 - a) < m:
        num = i
        m = abs(t - h[i] * 0.006 - a)

print(num + 1)

Submission status: Accepted

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

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

print(X)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
ls = list(map(int, input().split()))
res = float('inf')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
N=int(input())
T,A=map(int,input().split())
H=np.array(list(map(int,input().split())))
Tnp=abs(T-H*0.006-A)
print(np.argmin(Tnp)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

min_index,min_diff = -1,10**10
for i,h in enumerate(hlist):
  diff=abs(A-(T-h*0.006))
  if diff<min_diff:
    min_index,min_diff = i+1,diff
    
print(min_index)

Submission status: Accepted

Solution code:
'''
allinputs = iter(input().splitlines())
input = lambda : next(allinputs)
#'''
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
deviation_temperature = float('inf')
candidate_cite = -1

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
lis = [int(i) for i in input().split()]
height = np.array([int(i) for i in input().split()])

temperature = [abs(lis[1] - (lis[0] - 0.006*i)) for i in height]

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

Submission status: Accepted

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

ans=[]


for i in range(len(H)):
    relay=(abs(A-(T-H[i]*0.006)))
    ans.append([i+1,relay])
    ans=sorted(ans,key=lambda x:x[1])
    
print(ans[0][0])

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split()) # 横に2個
H = list(map(int, input().split()))

D = -1
for i, h in enumerate(H):
    tem = abs(T - h * 0.006 - A)

    if tem < D or i == 0:
        D = tem
        ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

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

m = abs(A - (T - 0.006 * H[0]))
num = 1

for n in range(1, N):
    d = abs(A - (T - 0.006 * H[n]))
    if d < m:
        m = d
        num = n+1

print(num)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

m = [abs(t-x*0.006-a) for x in l]

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h_list = list(map(int, input().split()))
min = 10 ** 10
nearest = 0

for i in range(1, n+1):
    temp = t - h_list[i - 1]*0.006
    if abs(a - temp) < min:
        min = abs(a - temp)
        nearest = i

print(nearest)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
a = int(input())
b = list(map(int,input().split()))
c = np.array(input().split(),dtype=np.int)
d = np.abs(b[0]-0.006*c-b[1])
print(np.argmin(d)+1)

Submission status: Accepted

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

min = 1000000
min_index = -1
for i, h in enumerate(H):
    v = abs(A-(T-h*0.006))
    if v < min:
        min = v
        min_index = i
print(min_index+1)

Submission status: Accepted

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

n = int(input())
T, a = map(int, input().split())
h = [int(x) for x in input().split()]

i = 0
x = 65536

for t in [T - height * 6 / 1000 for height in h]:
  i += 1
  if abs(t-a) < x:
    x = abs(t-a)
    ans = i

print(ans)

Submission status: Accepted

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

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

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

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

mn = 10**10
for i in range(n):
    if mn > abs(a - (t - h[i] * 0.006)):
        mn = min(mn, 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()))
absss = 100000
ans = 0
for i,h in enumerate(H):
    if abs((T - h * 0.006) - A) < absss:
        ans = i + 1
        absss = abs((T - h * 0.006) - A)
print(ans)

Submission status: Accepted

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

temp = [(i + 1, abs(a - (t - h * 0.006))) for i, h in enumerate(H)]
i = min(temp, key=lambda v: v[1])[0]
print(i)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
cnt=0
ans_min=999
for i in h:
    cnt = cnt+1
    mean=t-i*0.006
    ans = abs(a-mean)
    #print(ans)
    if ans<=ans_min:
        ans_min=ans
        cnt_ans=cnt
print(cnt_ans)

Submission status: Accepted

Solution code:
from operator import itemgetter
n = int(input())
t, a = list(map(int, input().split()))
hl = list(map(int, input().split()))
dil = [[abs(t-hl[i]*0.006-a),i] for i in range(n)]
dil.sort(key=itemgetter(0))
print(dil[0][1]+1)

Submission status: Accepted

Solution code:
a = int(input())
b, c = map(int, input().split())
d = list(map(int, input().split()))
e = []
for i in range(a):
    f = b - d[i] * 0.006
    e.append([i+1, abs(f-c)])
e = sorted(e, key=lambda x: x[1])
print(e[0][0])

Submission status: Accepted

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

Submission status: Accepted

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

p = []
for i in ls:
  p.append(abs(a - (t - i * 0.006)))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ある国で、宮殿を作ることになりました。
#この国では、標高が x メートルの地点での平均気温は T−x×0.006 度です。
#宮殿を建設する地点の候補は N 個あり、地点 i の標高は Hi メートルです。
#joisinoお姫様は、これらの中から平均気温が A 度に最も近い地点を選んで宮殿を建設するようにあなたに命じました。
#宮殿を建設すべき地点の番号を出力してください。
#ただし、解は一意に定まることが保証されます。

N = int(input())
T, A = map(int, input().split())
H = input().split()
h = list(map(int, H))
tans = T - 0.006*h[0]
for i in range(N):
    tmp = T - 0.006*h[i]
    if abs(A - tmp) <= abs(A - tans):
        tans = tmp
        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()]

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

Submission status: Accepted

Solution code:
n = int(input())

t, a  = map(int, input().split()) # 変数、比較対象

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

def temp(t, h):
    return t - h * 0.006

# 差分を計算する

dif = [abs(a - temp(t, i)) for i in h]

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(x) for x in input().split()]
temperature = 0
ans = 0
diff = 10**6
for place in range(N):
    temperature = T-H[place]*0.006
    kari_diff = abs(A - temperature)
    if diff > kari_diff:
        diff = kari_diff
        ans = place + 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(float,input().split(" "))
l=[]
l=input().split(" ")
indx=0
min=1000000.0
for i in range(0,n):
	val = t-int(l[i])*(0.006)
	if(val>a):
		val=val-a
	else:
		val=a-val
	if(val<min):
		min=val
		indx=i+1
print(indx)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: UTF-8

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

tempertures = [t - 0.006 * height for height in heights]
temp_diff = [abs(temperture - a) for temperture in tempertures]

minimum_diff_point = 0

for i, diff in enumerate(temp_diff):
    if diff < temp_diff[minimum_diff_point]:
        minimum_diff_point = i

print(minimum_diff_point + 1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
absolute = 9999
ans = 0
for i in range(n):
    tmp = abs(a - (t - h[i] * 0.006))
    if tmp < absolute:
        absolute = tmp
        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
for i in range(N):
    if i == 0:
        palce = T - H[i] * 0.006
        ans = i+1
    else:
        palce_2 = T - H[i] * 0.006
        if (palce-A)**2 > (palce_2-A)**2:
            palce = T - H[i] * 0.006
            ans = i+1

print(ans)

Submission status: Accepted

Solution code:
candidates = input()
T, A = map(int, input().split())
heights = input().split()
ans = []
for i in range(len(heights)):
    if T - int(heights[i])*0.006 >= A:
        ans.append((T - int(heights[i])*0.006) - A)
    else:
        ans.append(A - (T - int(heights[i])*0.006))
answer = ans.index(min(ans))
print(answer + 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-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()))

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

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import numpy; input(); t,a=map(int,input().split())
h=list(map(lambda x: abs(a-(t-int(x)*0.006)),input().split()))
print(numpy.argmin(h)+1)

Submission status: Accepted

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

ans = 0
for i in range(n):
    tmp = t - lst[i]*0.006
    dst = abs(a-tmp)
    if i == 0:
        val = dst
    elif dst < val:
        ans = i
        val = dst
print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T, A=map(int, input().split())
N=list(map(int,input().split()))
temp1=list(map(lambda x: (T-0.006*x),N))
temp=list(map(lambda x: abs(A-(T-0.006*x)),N))
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()))
tem=[]
for i in range(n):
    tem.append(abs((t-h[i]*0.006)-a))

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

Submission status: Accepted

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

x = [abs((t-i*0.006)-a) 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()))


min = 10000
mini = 0

for i, x in enumerate(h):
  val = T - x*0.006
  gap = abs(A-val)
  if gap < min:
    min = gap
    mini = i

print(mini+1)

Submission status: Accepted

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

avg = [T-H[i]*0.006 for i in range(N)]

diff = 10**9
for i in range(N):
    temp = abs(avg[i]-A)
    if temp<diff:
        diff = temp
        idx = i+1
        
print(idx)

Submission status: Accepted

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

Submission status: Accepted

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

temp = [0 for i in range(N)]

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

dist = 10000000
num = 0
for i in range(N):
    if dist > abs(temp[i] - A):
        dist = abs(temp[i] - A)
        num = i

print(num+1)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

d = [A - (T - 0.006 * h) for h in H]
dd = np.abs(d)

print(np.argmin(dd) + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
h = np.array(h)
h = t - (h * 0.006)
h_best_idx = np.argmin(abs(h - a))

print(h_best_idx + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INF = float("inf")
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
T, A = nl()
Hs = nl()

min_i = -1
min_diff = INF
for i in range(N):
    diff = abs(A - (T - Hs[i] * 0.006))
    if diff < min_diff:
        min_diff = diff
        min_i = i
print(min_i+1)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())


N=II()
T,A=LI()
INL=LI()

res = float(INTMAX)
name = 0
for i, h in enumerate(INL,1):
    if abs(A - (T - h*0.006)) < res:
        res = abs(A - (T - h*0.006))
        name = i

print(name)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = tuple(map(int, input().split()))
h = list(map(int, input().split()))
min=599
b=0


def kion(hi):
    return abs(a-t+0.006*hi)

for i in range(0,n):
    ne=kion(h[i])
    if min>ne:
        min=ne
        b=i+1

print(b)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(input().split())
a = []
b = 0
c = 0
for i in range(N):
        a.append(abs(A - (T - int(H[i]) * 0.006)))
b = min(a)
for i in range(N):
    if b == a[i]:
        c += i
print(c + 1)

Submission status: Accepted

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

ans=(abs(t - h_list[0] * 0.006-1),1)   # diff,index
for index,height in enumerate( h_list):
    tempa = t - height * 0.006
    if ans[0] > abs(tempa - a):
        ans = (abs(tempa - a), index + 1)
print(ans[1])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
for i,l in enumerate(h):
    k = t-l*0.006
    if(i == 0):
        abs1 = abs(a-k)
        ans = i+1
    elif(abs1 > abs(a-k)):
        abs1 = abs(a-k)
        ans = i+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
ans = 0
temperature = 1000000000000000
tmp = 0
H = list(map(int, input().split()))
for i in range(n):
    tmp = t - H[i] * 0.006
    if abs(a - tmp) < abs(a - temperature):
        temperature = tmp
        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()))


h_avetmp = [t-x*0.006 for x in h]
err = [abs(a-i) for i in h_avetmp]


print(err.index(min(err))+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()]
ls = []
for i in range(len(h)):
  ls.append(abs(t - h[i]*0.006 - a))
ans = -1
cri = 10000000000
for i in range(len(ls)):
  if ls[i] < cri:
    ans = i+1
    cri = ls[i]
print(ans)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc113/tasks/abc113_b

n=int(input())
t,a=map(int,input().split())
hlist=list(map(int,input().split()))
maingap=10000
answer=0

for i in range(n):
	tmp=t-0.006*hlist[i]
	gap=abs(tmp-a)

	if gap<maingap:
		maingap=gap
		count=i+1	

print(count)

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個
N = int(input())

# T気温の基準 A:理想の気温
T, A = map(int, input().split())

#それぞれの標高
heights = list(map(int, input().split()))

#理想の値を定義しておく
ideal = 1000
#場所の位置の番号を記録
place = 0


# for文で回して一個ずつ確かめる
for number in range(N):
	#平均気温を求める
	average_temperature = T - heights[number]*0.006
    
    #理想との絶対値の差はどれくらいか
	difference = average_temperature - A
	if difference < 0:
		difference = -1*difference
	
    #理想に最も近い地点はどれか　絶対値が一番小さい値はどれか
	if  difference < ideal:
      	#理想の場所の気温
		ideal = difference
        #理想の場所の番号
		place = number

#配列の番号と実際の番号がずれるため+1している
print(place+1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
def abc():
    input()
    t, a = map(int, input().rstrip().split())
    h = [(i + 1, abs(a - (t - x * 0.006))) for i, x in enumerate(map(int, input().rstrip().split()))]
    h.sort(key=lambda x: x[1])
    print(h[0][0])


abc()

Submission status: Accepted

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

gap = 10000
for i in range(n):
    tx = t - lst[i] * 0.006
    abtx = abs(tx-a)
    if abtx < gap:
        gap = abtx
        ans = i+1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = input()
T, A = map(float, input().split())
print(sorted([[i, abs(A - T + float(x) * 0.006)] for i, x in enumerate(input().split())], key=lambda x: x[1])[0][0] + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = [int(e) for e in input().split()]
     
diff=1000000
ans = 0
     
for i in range(len(H_list)):
  if abs(T-H_list[i]*0.006-A)<diff:
    diff = abs(T-H_list[i]*0.006-A)
    ans = i
    
print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

T, A = input().split()

T = float(T)
A = float(A)


H = list(map(float,input().split()))
ans = 0
mini = -1

for i in range(N):

    tem = T - H[i] * 0.006

    if (mini < 0):

        mini = abs(tem - A)

    elif ( mini > abs(tem - A) ):

        #print ("地点", i ,"は ",abs(tem-A),"度で",mini,"より小さい" )
        mini = abs( tem - 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()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

b = t-a
c = b-0.006*h[0]
best = 0
for i in range(0,len(h)):
    if min(abs(b-0.006*h[i]),abs(c)) == abs(b-0.006*h[i]):
        c = abs(b-0.006*h[i])
        best = i

print(best+1)

Submission status: Accepted

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

ans = 100000000000000000
ansi = 100000
for i in range(n):
    temp = t - h[i] * 0.006
    if abs(a - temp) < ans:
        ansi = i + 1
        ans = min(ans, abs(a - temp))
print(ansi)

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

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

N = int(sys.stdin.readline())
T, A = list(map(int, sys.stdin.readline().split()))
H = list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

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

temp = [abs(A-T+h*0.006) for h in H]
m = min(temp)

print(temp.index(m)+1)

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)):
    H[i] = T - H[i] * 0.006
for i in range(len(H)):
    H[i] = abs(H[i] - A)
for i, j in enumerate(H):
    if j == min(H):
        print(i+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
HS = list(map(int, input().split()))
 
result = 1
min_dif = 10000
for i in range(N):
  dif = abs(A - (T - HS[i] * 0.0060))
  if dif < min_dif:
    min_dif = dif
    result = i + 1
print(result)

Submission status: Accepted

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

diff = 10000

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

print(ans+1)