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 = [int(x) for x in input().split()]
locations =[int(x) for x in input().split()]
print(min([(i+1,abs(a - (t - x * 6e-3))) for i, x in enumerate(locations)],key=(lambda j:j[1]))[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Num = int(input())
Num2, Num3 = map(int,input().split())
Num_Array = list(map(int,input().split()))
result = 1000000000

for i  in range(0,Num):
    Check = Num3 - ( Num2 - (Num_Array[i] *0.006))
    if result > abs ( Check ):
        result = abs(Check)
        kekka = i + 1
print(kekka)

Submission status: Accepted

Solution code:
N = int(input())
T,A =list(map(int,input().split(" "))) 
Hs = list(map(int,input().split(" ")))
ans = 0
mindiff = 10 ** 9
for i,h in enumerate(Hs):
  temp = T - h * 0.006
  if abs(temp - A ) < mindiff:
    ans = i + 1
    mindiff = abs(temp - A )
print(ans)

Submission status: Accepted

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

temp=[]
c=t-hl[0]*0.006
ans=abs(c-a)
temp.append(ans)
for i in range(1,n) :
  cal=abs((t-hl[i]*0.006)-a)
  temp.append(cal)
  if ans>cal :
    ans=cal
print(temp.index(ans)+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
hlist=list(map(int,input().split()))
def temp(t,x):
  temp = t-0.006*x
  return temp

diff = []
min=1000000
index=0
diff = 0
for i,h in enumerate(hlist):
  diff = abs(temp(t,h) - a)
  if min > diff:
    min = diff
    index = i
print(index+1)

Submission status: Accepted

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

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

x = 10**5 + 60
ans = 0
for i in range(len(h)):
    tmp = t-h[i]*0.006
    if abs(tmp-a) < x:
        x = abs(tmp-a)
        ans = i
print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
h=list(map(int,input().split()))
t=[]
for i in range(N):
  tmp=T-h[i]*0.006
  t.append(abs(tmp-A))
val=min(t)
for i in range(N):
  if t[i]==val:
    ans=i+1
  else:
    pass
print(ans)

Submission status: Accepted

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

sa = 100000000000

for j in range(N):
    tmp = T - H[j] *0.006
    if sa > abs(tmp - A):
        sa = abs(tmp - A)
        ans = j + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0
diff = 10000000000000000000
for i in range(n):
    if diff > abs(a-h[i]):
        ans = i+1
        diff = abs(a-h[i])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
avg_temparature, kijun_temparature = map(int,input().split())
list_height = [int(i) for i in input().split()]

result_position = 0
for candidate in range(1,len(list_height)):
    a = avg_temparature - (list_height[result_position] * 0.006)
    b = avg_temparature - (list_height[candidate] * 0.006)
    if abs(kijun_temparature - a) > abs(kijun_temparature - b):
        result_position = candidate

print(result_position+1)

Submission status: Accepted

Solution code:
ConstNum = 0.006
castle_N = int(input())
T,avg_A = input().rstrip().split()

dict_rec = {}
place_Cnt = 1
for i in input().rstrip().split():
  dict_rec[place_Cnt] = abs((int(T) - int(i) * ConstNum) - int(avg_A))
  place_Cnt += 1

rec = [k for k, v in dict_rec.items() if v == min(dict_rec.values())][0]
print(rec)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    D.append(T - H[i]*0.006)

D = [abs(A - D[i]) for i in range(N)]
ans = min(D)

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

Submission status: Accepted

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

H_to_T = []
for i in range(N):
    H_to_T.append(abs(T[1] - (T[0]-H[i]*0.006)))


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
t,a = map(int,input().split())
l = list(map(int,input().split()))
l = [abs(t-i*0.006-a) for i in l]
print(np.argmin(l)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

n = int(input())
t, a = map(int, input().split())
h_list = list(map(int, input().split()))
h_temp = [abs((t - h * 0.006) - a) for h in h_list]

min_h = min(h_temp)

for i in range(n):
    if h_temp[i] == min_h:
        print(i + 1)
        sys.exit()

Submission status: Accepted

Solution code:
n1 = int(input())

n2, n3 = [int(i) for i in input().split()]
n4 = [int(j) for j in input().split()]


t1 = 1000
r1 = 0
for i1 in range(n1):
    if abs((n2 - (n4[i1] * 0.006))  - n3) <= t1:
        t1 = abs((n2 - (n4[i1] * 0.006))  - n3)
        r1 = i1 + 1

print(r1)

Submission status: Accepted

Solution code:
from numpy import array, argmin

input()
temp_on_sea, oracle = map(int, input().rstrip("\n").split())
heights = list(map(int , input().rstrip("\n").split()))
temp_diff = [abs(temp_on_sea - height * 0.006 - oracle) for height in heights]

print(array(temp_diff).argmin() + 1)

Submission status: Accepted

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

elevation_list = list(map(int, input().split()))
ans_list = []
min_ans = 1000
min_index = 0

for i in range(len(elevation_list)):
    ans = abs(a - (t - elevation_list[i] * 0.006))

    if ans < min_ans:
        min_ans = ans
        min_index = i + 1

print(min_index)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
t,a = list(map(int, input().split()))
hhh = list(map(int, input().split()))
ttt = [abs((t - h*0.006)-a) for h in hhh]
min_t = min(ttt)
for i in range(n):
  if ttt[i] == min_t:
    print(i+1)
    sys.exit()

Submission status: Accepted

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

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

target = (T - A) / 0.006
sub = 10 ** 6
for i in range(N):
    if abs(H[i] - target) < sub:
        sub = abs(H[i] - target)
        ans_idx = i

print(ans_idx + 1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
tmp_list = [ abs((t - h_ * 0.006) - a) for h_ in h]
print(tmp_list.index(min(tmp_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 = []
for i,h in enumerate(H):
    ans.append([i+1, abs(T-0.006*h - 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()))
ma = 10 ** 9
ans = 0
for i in range(n):
    if abs(t - h[i] * 0.006 - a) < ma:
        ma = 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()))
b = []

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    T, A = map( int, input().split())
    H = list (map( int, input().split()))
    pos = -1
    best = 1 << 64
    for i in range(0, N):
        avg = T - H[i] * 0.006
        if best > abs(A - avg):
            best = abs(A - avg)
            pos = i + 1
    print(pos)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

temp = [0]*N

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

temp2 = sorted(temp)
print(temp.index(temp2[0])+1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
d = [abs(T-0.006*h[i]-A) for i in range(N)]
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()))
tmp = list(map(lambda x: t - x * 0.006,h))
diff = list(map(lambda y: abs(a - y),tmp))
mini = min(diff)
for i in range(n):
  if mini == diff[i]:
    print(i+1)

Submission status: Accepted

Solution code:
N = int(input())
list = input().split()
T = list[0]
A = list[1]
list2 = input().split()
H = []
T_mean = []
minimum = []
for i in range(N):
    H.append(list2[i])
    T_mean.append(int(T)-int(H[i])*0.006)
    minimum.append(abs(T_mean[i] - int(A)))


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

Submission status: Accepted

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

new = []
x = (T-A)/0.006
for h in H:
  new.append(abs(h-x))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = (map(int, input().split()))
H = list(map(int, input().split()))
m = 10 ** 100
num = 0
for i in range(len(H)):
	H[i] = T - H[i] * 0.006
	if m > abs(A - H[i]):
		m = abs(A - H[i])
		num = i + 1
	# m = min(m, abs(A - H[i]))
print(num)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
h = map(int, input().split())
import numpy as np
print(np.argmin([abs(a - (t - i*6e-3)) for i in h])+1)

Submission status: Accepted

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

Submission status: Accepted

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

tmpr_list = [T - h * 0.006 for h in H_list]
abs_min = abs(tmpr_list[0] - A)
abs_min_index = 1

for i in range(length):
    if abs_min >= abs(tmpr_list[i] - A):
        abs_min = abs(tmpr_list[i] - A)
        abs_min_index = i + 1

print(abs_min_index)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
li = []
for i in range(n):
    diff = abs((t-(h[i]*0.006))-a)
    li.append(diff)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
t*=1000;a*=1000
h=list(map(int,input().split()))
m=10**17
ans=1
for i in range(n):
  l=abs(t-h[i]*6-a)
  if m>l:
    m=l
    ans=i+1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
INF = 1000000
d = [INF] * n
for hi, hv in enumerate(h):
    d[hi] = abs(a - (t - hv * 0.006))

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

Submission status: Accepted

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

def main():
	w = 0.006
	n = int(input().strip())
	t, a = map(int, input().strip().split())
	v = list(map(int, input().strip().split()))
	T = 10**9
	ans = 0
	for i in range(n):
		if abs(a - (t-v[i]*w)) < T:
			T = abs(a - (t-v[i]*w))
			ans = i
	print(ans+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()))
ans = 1
temp1 = t - h[0] * 0.006
for i in range(1,n):
    temp2 = t - h[i] * 0.006
    if abs(temp1-a) > abs(temp2-a):
        ans = i + 1
        temp1 = temp2
print(ans)

Submission status: Accepted

Solution code:
n,t,a,*h=map(int,open(0).read().split());y=[abs(t-a-i*6e-3)for i in h];print(y.index(min(y))+1)

Submission status: Accepted

Solution code:
N = int(input())
TA = list(map(int, input().split(' ')))
T = TA[0]
A = TA[1]
heights = list(map(int, input().split(' ')))
diff_temps = []
for height in heights:
    diff_temps.append(abs(A - (T - height * 0.006)))
res = diff_temps.index(min(diff_temps)) + 1
print(res)

Submission status: Accepted

Solution code:
#Coding:Utf-8

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


for i in range(N):
    if i==0:
        temp=abs(A-(T-H[i]*0.006))
        point=i+1
    else:
        if temp>abs(A-(T-H[i]*0.006)):
            temp=abs(A-(T-H[i]*0.006))
            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 = []
for i in range(n):
    diff.append(abs(t - h[i] * 0.006 - a))
print(diff.index(min(diff)) + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n=int(input())
u=.006
t,a=map(int,input().split())
h=list(map(int,input().split()))
lst=[]
for i,j in enumerate(h):
    lst.append(abs(t-u*j-a))
print(lst.index(min(lst))+1)

Submission status: Accepted

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

mi = 100000
idx = 1000

for i in range(N):
    temp = T - H[i]*0.006
    diff = abs(temp-A)
    if diff < mi :
        mi = diff
        idx = i+1
        
print(idx)

Submission status: Accepted

Solution code:
# ABC 113, B - palace
n = int(input())
t, a = map(int, input().split(' '))
H = [int(el) for el in input().split(' ')]

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

Submission status: Accepted

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

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

dt = abs(a - temp(h[0], t))
di = 0
for i in range(n):
  ti = temp(h[i], t)
  dti = abs(a - ti)
  if dti < dt:
    dt = dti
    di = i
print(di+1)

Submission status: Accepted

Solution code:
n = int(input())
l = [int(i) for i in input().split(" ")]
t = l[0]
a = l[1]
diff_list = [abs(t-int(i)*0.006-a) for i in input().split(" ")]
print(diff_list.index(min(diff_list))+1)

Submission status: Accepted

Solution code:
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    [T, A] = string_to_int(inputs[1])
    H = string_to_int(inputs[2])

    min_diff = -1
    min_diff_i = -1
    for i, h in enumerate(H):
        t = T - h * 0.006
        diff = abs(A-t)
        if min_diff == -1 or diff < min_diff:
            min_diff = diff
            min_diff_i = i
    return min_diff_i + 1


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(3))
    print(ret)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
lst = list(map(int, input().split()))
diff = 10 ** 5
ans = 0
for i, k in enumerate(lst):
    tmp = T - k* 0.006
    if (abs(tmp - A) < diff):
        diff = abs(tmp - 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 = 0
for i in range(N):
    diff = abs(A - (T-H[i]*0.006))
    if i == 0:
        temp = diff
        ans = i+1
    else:
        if diff < temp:
            temp = diff
            ans = i+1

print(ans)

Submission status: Accepted

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

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

print(okok)

Submission status: Accepted

Solution code:

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

t=list(map(lambda h: temp-h*0.006, hs))
t=list(enumerate(t,1))

def solve(best,a,t):
    if not t:
        return best[0]
    if abs(best[1] - a) < abs(t[0][1] - a):
        return solve(best, a, t[1:])
    else:
        return solve(t[0],a,t[1:])

min_diff = 100000000
res = 0
for i in range(len(t)):
    if min_diff > abs(t[i][1] - a):
        min_diff = abs(t[i][1] - a)
        res = i + 1


print(res)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
l=[]
q=[]
for i in range(n):
    l.append(t-h[i]*0.006)
    q.append(abs(l[i]-a))

ans=0
b=10**20
for i in range(n):
    if q[i]<=b:
        b=q[i]
        ans=i+1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = list(map(int, input().split()))
V = [abs(T-int(h)*0.006-A) for h in input().split()]
m = min(V)
for i,v in enumerate(V):
    if v==m:
        print(i+1)
        break

Submission status: Accepted

Solution code:
    
def main():

    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)
    
    


if __name__== "__main__":
    main()

Submission status: Accepted

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

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

degrees=[]

for i in can:
    degrees.append(t-i*0.006)

#print(degrees)

ans=[]

for j in degrees:
    ans.append(abs(j-a))

#print(ans)

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

Submission status: Accepted

Solution code:
import math
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
place_list = []
ans = []

for num in h:
  place = t - num*0.006
  place_list.append(place)

for num in place_list:
  i = math.fabs(a - num)
  ans.append(i)
  
print(ans.index(min(ans)) + 1)

Submission status: Accepted

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

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

c = 10**9
for j in range(N):
    if abs(H[j]-A) <= c:
        ans = j+1
        c = abs(H[j]-A)
        
print(ans)

Submission status: Accepted

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

ans=-1
ansT=-1000000000

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

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
min=10000 #  aとの差
ans=0

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

Submission status: Accepted

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

index = -1
min_temp = 10**9
for i in range(N):
  now_temp = abs(T-Hs[i]*0.006-A)
  if min_temp > now_temp:
    min_temp = now_temp
    index = i+1
print(index)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

res=[0]*n
for i in range(n):
	res[i]=abs(h-0.006*x[i]-t)

print(int(np.argmin(res)+1))

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#A
def A():
    x, y = LI()
    print(x+y//2)
    return

#B
def B():
    II()
    t, a = LI()
    h = LI()
    ans = [0,inf]
    for num, i in enumerate(h):
        if ans[1] > abs(t - a - i * 0.006):
            ans = [num, abs(t - a - i * 0.006)]
    print(ans[0] + 1)
    return

#C
def C():
    n, m = LI()
    py = LIR(m)
    pya = py[::1]
    py.sort(key=lambda x: x[1])
    city = [1 for i in range(n)]
    dicity = {}
    for p, y in py:
        dicity[(p,y)] = city[p-1]
        city[p-1] += 1    
    for p, y in pya:
        a = "00000" + str(p)
        a = a[-6:]
        b = "00000" + str(dicity[(p, y)])
        b = b[-6:]
        print(a+b)

    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

min_temp = float('inf')
ans = None
for i in range(N):
    temp = abs(A - (T - H[i] * 0.006))
    if min_temp > temp:
        min_temp = temp
        ans = i
print(ans + 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()]
diff = (abs(A-(T-H[0]*0.006)))
palace = 0
for i in range(len(H)):
    if(abs(A-(T-H[i]*0.006)) < diff):
        palace = i
        diff = abs(A-(T-H[i]*0.006))
print(palace+1)

Submission status: Accepted

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

min_diff = float('inf')
min_index = None
for i, h in enumerate(H):
    ave_temp = T - h * 0.006
    diff = abs(ave_temp - A)
    if diff < min_diff:
        min_diff = diff
        min_index = i
print(min_index + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

ans = 0
tmp = 1000000000
for i in range(N):
    ansTmp = abs(A - (T - (hLst[i] * 0.006)))
    if tmp >= ansTmp:
        ans = i + 1
        tmp = ansTmp

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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