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

import numpy as np

ans = (t - a) / 0.006

h = np.abs(np.array(list(map(int, input().split()))) - ans)

print(np.argmin(h) + 1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
imin=100000
suf=0
for i in range(n):
  h[i]=t- h[i]*0.006
  if a>=h[i]:
    if imin>a-h[i]:
      #print("!!",a-h[i],h[i],i)
      imin=abs(a- h[i])
      suf=i
  else:
    if imin>h[i]-a:
      #print("!!",a-h[i],h[i],i)
      imin=abs( h[i]-a)
      suf=i 
print(suf+1)

Submission status: Accepted

Solution code:
N=int(input())
a,b=input().split()
test=lambda x:float(x)
a=test(a)
b=test(b)
h=[int(i) for i in input().split()]
d=1000
c=0
p=0
for i in h:
    c=c+1
    t=a-test(i*0.006)
    if abs(b-t)<d:
        d=abs(float(b)-t)
        p=c

print(p)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    h = list(map(lambda n: abs(A - (T - n * 0.006)), H))
    print(h.index(min(h)) + 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()))
tmp=[]
for i in range(N):
    tmp.append(abs(A-(T-H[i]*0.006)))
print(tmp.index(min(tmp))+1)

Submission status: Accepted

Solution code:
import numpy as np

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

diff = [abs(A -(T - i*0.006)) for i in nums]
print(np.argmin(diff) + 1)

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

diff = sys.maxsize
ans = ""

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

for i in range(0, N):
    t = T - H[i] * .006
    d = abs(A - t)
    if diff > d:
        ans = i + 1
        diff = d

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

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

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

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

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

Submission status: Accepted

Solution code:
B = int(input())
T, A = map(int, input().split())
N = map(int, input().split())
i = 9999
j = 1
for ids,k in enumerate(N):
  if abs(A - (T - k * 0.006)) < i : 
    i = abs(A - (T - k * 0.006))
    j = ids

print(j + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = [base_t - 0.006 * x for x in hs]
dif = [abs(ti - a) for ti in t]

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))
best_sub = 100000
ans = -1
for i, h in enumerate(hs):
    t_ = t - h * 0.006
    if abs(a - t_) < best_sub:
        best_sub = abs(a - t_)
        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()))

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

Submission status: Accepted

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

def elev(t, n):
    high = t - n * 0.006
    return abs(a - high)

for i in range(n):
    ans = elev(t, h[i])
    ans_l.append(ans)

num = min(ans_l)
print(ans_l.index(num) + 1)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
d=10**4
n=0
for j in range(N):
  dj=abs(A-(T-H[j]*0.006))
  if dj<d:
    d=dj
    n=j
print(n+1)

Submission status: Accepted

Solution code:
candidate = int(input())
ave_temp, ide_temp = map(float, input().split(' '))
ls_candidate = [abs((ave_temp - (float(x) * 0.006) - ide_temp))  for x in input().split(' ')]

for x, i in enumerate(ls_candidate):
    if ls_candidate[x] == min(ls_candidate):
        print(x + 1)
        break

Submission status: Accepted

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

HH=list(map(lambda x:abs(A[1]-(A[0]-x*0.006)),H))
print(HH.index(min(HH))+1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def argmin(a):
    m, n = INF, -1
    for i, v in enumerate(a):
        if m > v:
            m, n = v, i
    return m, n


def solve(N: int, T: int, A: int, H: "List[int]"):
    print(argmin([abs(T-h*0.006-A) for h in H])[1]+1)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    H = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, T, A, H)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

sa = []

for i in df:
    b = t - i * 0.006  
    c = abs(b - a)
    sa.append(c)
  
x = sa.index(min(sa)) + 1
print(x)

Submission status: Accepted

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

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(t-h[i]*0.006-a))
c=min(b)
print(b.index(c)+1)

Submission status: Accepted

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

Submission status: Accepted

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

ls = [T-i*0.006 for i in H]
num = 999999
index = 0

for i, tmp in enumerate(ls, 1):
    tmp = abs(tmp-A)
    if num > tmp:
        num = tmp
        index = i

print(index)

Submission status: Accepted

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

dif = 1000
loc = 1
for i in H:
    a = abs(A-(T-i*0.006))
    if a < dif:
        dif = a
        ans = loc
    loc += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
def abs(k,l):
  if k>l:
    return k-l
  else:
    return l-k  
b=20000313
cnt=0
for i in range(n):
  if b>abs(a,t-0.006*h[i]):
    b=abs(a,t-0.006*h[i])
    cnt=i
  else:
    b=b
    cnt=cnt
print(cnt+1)

Submission status: Accepted

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

min_diff_t = 10e6
ans = 0

for i, e in enumerate(h):
    ti = t - 0.006 * e
    d = abs(a - ti)

    if d < min_diff_t:
        min_diff_t = d
        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()))
tmp = [abs(A - (T - i * 0.006)) for i in H]
print(tmp.index(min(tmp)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(raw_input())
T, A = map(int, raw_input().split())
H = map(int, raw_input().split())
min = 10000000
ans = -1
for i in range(0, N):
	temp = 1000*T - 6*H[i]
	if abs(temp-1000*A) < min:
		min = abs(temp-1000*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()))
t=10**6
index=1

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

min_i = 0
min_temp = 100000000000000

for i, h in enumerate(H):

    temp = T - h * 0.006

    if abs(A - temp) < min_temp:
        min_i = i
        min_temp = abs(A - temp)

print(min_i + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = 10**6
index = 1

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

print(index)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
lis = list(map(int,input().split()))
tmperature = [T-_*0.006 for _ in lis]
ans_lis = [abs(A-_) for _ in tmperature]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

temparatures = [T-x*0.006 for x in Hs]
differences = [abs(A-t) for t in temparatures]
best_location = differences.index(min(differences)) + 1

print(best_location)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# T - x * 0.006 = A
# x = (T-A)/0.006
x = (T-A)/0.006
def error(i):
    return abs(H[i]-x)
n = 0
e = error(0)
for i in range(len(H)):
    if error(i) <= e:
        n = i
        e = error(i)

print(n+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(raw_input())
t0, a = map(int, raw_input().split())
h = np.array(map(int, raw_input().split()))
t = t0 - h * 0.006
t = abs(t - a)
print np.argmin(t) + 1

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
x_list = list(map(int, input().split()))
min_dif = 10**10
ans = 0
for i in range(N):
    dif = abs(T - x_list[i] * 0.006 - A)
    if min_dif > dif:
        min_dif = dif
        ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_t(T, x):
    return (T - x*0.006)

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

ans = (-1, 1000000)

for i, h in enumerate(H):
    if abs(ans[1] - A) > abs(get_t(T, h) - A):
        ans = (i + 1, get_t(T, h))

print(ans[0])

Submission status: Accepted

Solution code:
# coding: utf-8

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

def mean_temp_diff (x):
  return abs(A - (T - x * 0.006))

min_diff = 10000
min_idx = 0

for i in range(len(H)):
  mtd = mean_temp_diff(H[i])
  if mtd < min_diff :
    min_diff = mtd
    min_idx = i

print(min_idx + 1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in input().split()]
mini = 1000
ind = 0
for i in range(N):
  new_mini = min(mini, abs(A-(T-H[i]*0.006)))
  if new_mini != mini:
    ind = i
  mini = new_mini
print(ind+1)

Submission status: Accepted

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

Ts = list(map(lambda x: T-x * 0.006, Hs))

i = 0
v = None
for _i, _T in enumerate(Ts):
    if v is None or abs(_T-A) < v:
        v = abs(_T-A)
        i = _i

print(i+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split(' '))
H = [int(h) for h in input().split(' ')]
#　平均気温がAに最も近い場所の温度
best_place = -float('inf')
#A点に最も近い場所の地点
point = 0
for i,x in enumerate(H):
  TEM = T-x*0.006
  if abs(A-best_place)> abs(A-TEM):
    point = i
    best_place = TEM
print(point+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(map(int,input().split()))
sa=10**6
ans=0
for hi,hk in enumerate(h):
    sak=abs(t-hk*0.006-a)
    if sak<sa:
        ans=hi+1
        sa=sak
print(ans)

Submission status: Accepted

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

min = 999
min_i = -1
for i in range(N):
  if abs(A-(T-H[i]*0.006))<min:
    min = abs(A-(T-H[i]*0.006))
    min_i = i

print(min_i+1)

Submission status: Accepted

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


def solve(N: int, T: int, A: int, H: "List[int]"):
    mn = float('inf')
    ret = -1
    for i in range(N):
        t = T - H[i] * 0.006
        diff = abs(A - t)
        if diff < mn:
            ret = i + 1
            mn = diff
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    H = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, T, A, H)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

difference = 1000000
for i, height in enumerate(H):
    tmp = T - 0.006*height
    sub = abs(tmp - A)
    if sub < difference:
        difference = sub
        answer = i + 1

print(answer)

Submission status: Accepted

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

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]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = [abs(A - (T-h*0.006)) for h in map(int, input().split())]

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

Submission status: Accepted

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

tempertures = [abs(A - (T - 0.006 * h)) for h in H]
min_t = None
min_index = 0
for i, t in enumerate(tempertures):
    if min_t is None or t < min_t:
        min_t = t
        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()))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

diff_min=1000
ans=0

for h in range(N):
    tmp=abs(A-T+0.006*H_list[h])
    if tmp<diff_min:
        diff_min=tmp
        ans=h
    else:
        ans=ans 

print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

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

near = 1000
for i in range(len(H)):
    temp = T-H[i]*0.006
    if abs(temp-A) < near:
        ans = i+1
        near = abs(temp-A)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

H = list(map(lambda x: abs(A - (T - x*0.006)), H))

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()))
near_temp = T - H[0]*0.006
near_index = 0
for i in range(N):
    temp = T - H[i]*0.006
    if abs(A - temp) < abs(A - near_temp):
        near_temp = temp
        near_index = i
        #print("check_i")
print(near_index+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
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

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

#B
def B():
    n = I()
    t,a = LI()
    h = LI()
    x = 1
    ans = abs(a-t+h[0]*0.006)
    for i in range(1,n):
        if ans > abs(a-t+h[i]*0.006):
            ans = abs(a-t+h[i]*0.006)
            x = i+1
    print(x)
    return

#C
def C():
    n,m = LI()
    v = LIR(m)
    for i in range(m):
        v[i] = [v[i][0],v[i][1],i]
    v.sort(key = lambda x:x[1])
    f = [0 for i in range(n+1)]
    ans = [None for i in range(m)]
    for p,y,i in v:
        f[p] += 1
        s = "{:0>6}".format(p)
        t = "{:0>6}".format(f[p])
        ans[i] = s+t
    for i in ans:
        print(i)
#D
def D():
    h,w,k = LI()
    dp = [[0 for i in range(w)] for j in range(h+1)]
    dp[0][0] = 1
    p = [1 for i in range(w+1)]
    for i in range(w):
        p[i+1] = p[i]*2
    l = [i for i in range(p[w-1])]
    i = 0
    while i < len(l):
        a = l[i]
        for j in range(w):
            if a&p[j] and a&p[j+1]:
                l.pop(i)
                i -= 1
                break
        i += 1
    d = [[0 for i in range(3)] for j in range(w)]
    for j in range(w):
        for s in l:
            if 0 < j < w-1:
                if p[j]&s:
                    d[j][2] += 1
                elif p[j-1]&s:
                    d[j][0] += 1
                else:
                    d[j][1] += 1
            elif j == 0:
                if p[j]&s:
                    d[j][2] += 1
                else:
                    d[j][1] += 1
            else:
                if p[j-1]&s:
                    d[j][0] += 1
                else:
                    d[j][1] += 1
    for i in range(h):
        for j in range(w):
            dp[i+1][j] += d[j][1]*dp[i][j]
            dp[i+1][j] %= mod
            if j > 0:
                dp[i+1][j-1] += d[j][0]*dp[i][j]
                dp[i+1][j-1] %= mod
            if j < w-1:
                dp[i+1][j+1] += d[j][2]*dp[i][j]
                dp[i+1][j+1] %= mod
    print(dp[h][k-1])
#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Accepted

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

Submission status: Accepted

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

min_dst = 10**9
ans = 0

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

for i, h in enumerate(H):
  # print(h)
  temp = T - h*0.006
#  print(temp)
  diff = abs(A - temp)
  dif.append([diff, i+1])

dif = sorted(dif)

print(dif[0][1])

Submission status: Accepted

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

ht = []

for i in h:
    ht.append(abs(a-(t-i*0.006)))

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

Submission status: Accepted

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

best = abs(A - (T - (10**5) * 0.006 + 1))
best_i = -1
for i, H in enumerate(Hn):
    t = T - H * 0.006
    d = abs(A - t)
    if d < best:
        best = d
        best_i = i
print(best_i+1)

Submission status: Accepted

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

temp_list=[]

for h in h_list:
	temp_list.append(abs(t-h*0.006-a))

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
L=[]
for i in map(int,input().split()) :
  B=abs(A-(T-i*0.006))
  L.append(B)
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()))
P=float("inf")
X=B=0
for i in range(N) :
  X=abs(A-(T-H[i]*0.006))
  if X<P :
    B=i
    P=X
print(B+1)

Submission status: Accepted

Solution code:
def cal_temperture(x):
    return abs((t - x * 0.006) - a)


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

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

Submission status: Accepted

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


n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
cal_h = list(map(cal_temperture, h))
ans = 0
temp = 1000000
for i in range(n):
    if temp > abs(cal_h[i] - a):
        temp = abs(cal_h[i] - a)
        ans = i

print(ans+1)

Submission status: Accepted

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

ans = 0
diff = -1
for i, H in enumerate(Hs):
    t = T - H * 0.006
    d = abs(A - t)
    if diff < 0 or d < diff:
        diff = d
        ans = i + 1

print(ans)

Submission status: Accepted

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

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

minlen = 10000
minnum = -1

for i in range(n):
    len = abs(a - temp[i])
    if minlen > len:
        minlen = len
        minnum = i + 1

print(minnum)

Submission status: Accepted

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

d = float("inf")
ans = 0
for i in range(n):
    di = abs(a - (t - h[i]*0.006))
    if di < d:
        d = di
        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()))

tmp = float('inf')
ans = 0
for i, x in enumerate(H):
    avg_tmp = T - x * .006
    if abs(A - tmp) > abs(A - avg_tmp):
        tmp = avg_tmp
        ans = i+1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
     
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H_[i]
     
print(arg)

Submission status: Accepted

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

def main():
    ans = 0
    diff_max= 1000
    for i, x in enumerate(H, start=1):
        diff = abs(T-x*0.006 - A)
        if diff < diff_max:
            diff_max = diff
            ans = i
    return ans

if __name__ == '__main__':
    print(main())

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())))
H = T - 0.006*H - A
H = np.abs(H)
print(np.argmin(H) + 1)