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())
def calc(A):
  return((T - A) / 0.006)

H = list(map(int,input().split()))
x = calc(A)
ans=max(H) - x
for i in range(N):
  if abs(H[i] - x) < abs(ans):
    ans = H[i] - x
    
ans = int(ans + x)
print(H.index(ans)+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T,A,*H = map(int, open(0).read().split())
B=[]
ans = -1;
minim = 10000000000000000;
for i in range(N):
  B.append(T - H[i] * 0.006)
for i in range(N):
  if(abs(B[i]-A) < minim):
    ans = i+1
    minim = abs(B[i]-A)

print(ans)

Submission status: Accepted

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

ans = -1
min = 1000000000
for i in range(len(H)):
  dif=abs(A - H[i])
  if dif < min:
    ans = i + 1
    min = dif
print(ans)

Submission status: Accepted

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

minT = 651
ans = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = map(int,input().split())
h = list(map(int,input().split()))
l = []
for i in range(n):
    d = abs(t - h[i] * 0.006 - a)
    P = [d,i+1]
    l.append(P)
L = sorted(l)
print(L[0][1])

Submission status: Accepted

Solution code:
n = int(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())
Hs = list(map(int, input().split()))

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

Submission status: Accepted

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

i = 0
d_min = 1000

for j, h in enumerate(map(int, input().split())):
  d = abs(t - h * 0.006 - a)
  if d < d_min:
    d_min = d
    i = j

else:
  print(i+1)

Submission status: Accepted

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

before = max(h)
ans = 0
i = 0
for i in range(n):
  if abs(h[i]-x) < before:
    before = abs(h[i]-x)
    ans = i+1
print(ans)

Submission status: Accepted

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

tmp = 10 ** 9 + 7
ind = -1

for i, j in zip(H, list(range(1, N + 1))):
    c_tmp = abs(A - T + i * 0.006)
    if c_tmp < tmp:
        tmp = c_tmp
        ind = j
print(ind)

Submission status: Accepted

Solution code:
N = int(input())
L = list(range(1, N + 1))
T, A = map(int, input().split())
H = list(map(int, input().split()))
tmp = 10 ** 9 + 7
ind = -1
for i, j in zip(H, L):
    if abs(A - T + i * 0.006) < tmp:
        tmp = abs(A - T + i * 0.006)
        ind = j
print(ind)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = 999 #平均気温とAとの最短の差
p = 0 #その差を記録したポイント
for i in range(len(H)):
  if t > abs(A - T + H[i]*0.006):
    t = abs(A - T + H[i]*0.006)
    p = i+1
print(p)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
H = [ (a - (t - (i * 0.006))) **2 for i in 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()))
s=[]
for i in range(N):
  a=T-h[i]*0.006
  if a>=A:
    b=a-A
    s.append(b)
  elif a<A:
    b=A-a
    s.append(b)
f=min(s)
o=s.index(f)
print(o+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()]

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
t, a = na()
hhh = na()
tmp = 100000000
for i, h in enumerate(hhh):
    dif = abs(t - h * 0.006 - a)
    if dif < tmp:
        ans = i + 1
        tmp = dif
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# xメートルの地点での平均気温は T−x*0.006度
#input
input()
T, A = map(int, input().split())
H=list(map(int, input().split()))

S=[((T-i*0.006)-A)**2 for i in H]

#インデックス（Sから最小のSを返す）
print(S.index(min(S))+1)

Submission status: Accepted

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

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

s = []

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

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

Submission status: Accepted

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

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

temps = {}
for i in range(len(heights)):
    temp = t - heights[i] * 0.006
    temps[i] = abs(a - temp)

ranking = sorted(temps.items(), key = lambda x: x[1])
# print(ranking)
print(ranking[0][0] + 1)

Submission status: Accepted

Solution code:
n=int(input())
T, A = map(int,input().split())
H=list(map(int,input().split()))
temp=[abs(T-x*0.006-A) for x in H]
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()))
ans=A-(T - H[0]* 0.006)
place=1
for i in range(1,n):
    if abs(ans)>abs(A-(T - H[i]* 0.006)):
        ans=A-(T - H[i]* 0.006)
        place=i+1
print(place)

Submission status: Accepted

Solution code:
N = int(input())

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

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

box = []

for x in H:
    tmp = T - x*0.006
    ans = abs(A-tmp)
    box.append(ans)
    
print(box.index(min(box))+1)

Submission status: Accepted

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


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

index = None
min_diff = float('inf')
for i in range(n):
    diff = abs(temp(t, hs[i]) - a)
    if diff < min_diff:
        min_diff = diff
        index = i
print(index + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

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

def getTemp(T,h):
  return T - (h * 0.006)

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

lst = list(map(int,input().split()))
anslist = []

for i in lst:
  tmp = getTemp(T,i)
  anslist.append(tmp)

print(int(getNearestValue(anslist,A)))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  if abs(a-(t-h[i]*0.006)) < minabs:
    minabs = abs(a-(t-h[i]*0.006))
    j = i

print(j+1)

Submission status: Accepted

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

temp=[]
for i in range(n):
    temp.append(abs(A-(T-H[i]*0.006)))
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()))

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

Submission status: Accepted

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

place=0
degree=10000000000
for i,h in enumerate(hs):
  if degree>abs(a-(t-h*0.006)):
    degree=abs(a-(t-h*0.006))
    place=i
print(place+1)

Submission status: Accepted

Solution code:
#B - Palace(ABC113)
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
s=abs(A-(T-H[0]*0.006))
m=0
ans=1
for i in range(1,N):
    m=abs(A-(T-H[i]*0.006))
    if m<s:
        s=m
        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()))

min_diff = float('inf')
ans = 0
for i in range(1,len(H)+1):
  diff = abs(T - H[i-1]*0.006 - A)
  if diff < min_diff:
    min_diff = diff
    ans = i

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

temp = [T-_*0.006 for _ in H]
li = [abs(A-_) for _ in temp]

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

Submission status: Accepted

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

    ans = float('inf')
    cnt = 0
    for i, h in enumerate(H):
        tmp = abs(A - (T - h * 0.006))
        if ans > tmp:
            ans = tmp
            cnt = i + 1

    print(cnt)


main()

Submission status: Accepted

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

at=list(map(lambda x:abs(a-(t-x*0.006)), h))

print(at.index(min(at))+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
minn = 10**5
for i in range(n):
    dif = abs(a-H[i])
    if dif == min(minn,dif):
        minn = dif
        p = i
print(p+1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = [int(x) for x in input().split()]
H_optim = (T-A)/0.006
_min = 1145141919
H_result = 1
for i,x in enumerate(H):
    if abs(x-H_optim) < _min:
        _min = abs(x-H_optim)
        H_result = i+1
print(H_result)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
hl=[]
ttl=[]
for x in h:
    tt = t-(x*0.006)
    hl.append(tt)


for y in hl:
    result = abs(a-y)
    ttl.append(result)

rel=ttl.index(min(ttl))
print(rel+1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
Hn = list(map(int,input().split()))
minnum = 10**9
minindex = 0
for h in range(len(Hn)):
    if minnum>abs((T-Hn[h]*0.006)-A):
        minnum = abs((T-Hn[h]*0.006)-A)
        minindex = h
print(minindex+1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
H = map(int, input().split())
H = list(enumerate(H))
suitability = lambda x: abs(t - x[1] * 0.006 - a)
print(min(H, key=suitability)[0] + 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:
def main():
    N = int(input())
    T, A = map(int, input().split())
    H = [int(h) for h in input().split()]
    min_d, min_i = float('inf'), None
    for i in range(N):
        aveT = T - 0.006 * H[i]
        if abs(aveT - A) < min_d:
            min_d = abs(aveT-A)
            min_i = i
    return min_i+1


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
l = list(map(int, input().split()))
a = [abs(A - (T - h * 0.006)) for h in l]
print(sorted(list(zip(a, range(len(a)))))[0][1] + 1)

Submission status: Accepted

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

min_value = 10 ** 9
location = -1

for i, h in enumerate(H):
    tmp = abs((T - h * 0.006) - A)
    if tmp < min_value:
        min_value = tmp
        location = i

print(location + 1)

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    ans = 0
    best = abs(T - h[ans] * 0.006 - A)
    for i in range(1, N):
        tmp = abs(T - h[i] * 0.006 - A)
        if tmp < best:
            best = tmp
            ans = i
    print(ans+1)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import numpy as np
def temp(T1,H):
    return T1-H*0.006
   
Q=[]
for i in range(len(H)):
    Q.append(np.abs(temp(T,H[i])-A))

print(np.argmin(Q)+1)

Submission status: Accepted

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


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

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

min_diff = temp(T, H[0], A)
answer = 0
for i in range(1, N):
    diff = temp(T, H[i], A)
    if diff < min_diff:
        answer = i
        min_diff = diff
print(answer + 1)

Submission status: Accepted

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

tem = []
for i in range(n):
  tem.append((t - h[i] * 0.006, i + 1))

print(sorted(tem, key=lambda x: abs(x[0] - a))[0][1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 0

p = [t-j*0.006 for j in h]
q = [abs(a-j) for j in p]
ans_bef = q.index(min(q))
print(ans_bef + 1)

Submission status: Accepted

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

array = [int(i) for i in input().split()]
ans = list(map(lambda x: t-x*0.006,array))
ans = list(map(lambda x: abs(x-a),ans))

minans = min(ans)
minidx = ans.index(minans)

print(minidx+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()]
nearest_temper = 10000
ans_i = 0
for i in range(n):
    cur = t - h[i] * 0.006
    if abs(a - cur) < nearest_temper:
        nearest_temper = abs(a - cur)
        ans_i = i + 1
print(ans_i)

Submission status: Accepted

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

ans = 0
min_diff = 2**32
for i, h in enumerate(H):
  d = abs((T-int(h)*0.006)-A)
  if min_diff > d:
    min_diff = d
    ans = i+1
print(ans)

Submission status: Accepted

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

hss = [t-i*0.006 for i in hs]

hsss = [abs(i-a) for i in hss]

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

Submission status: Accepted

Solution code:
n = int(input())
ta = input().split()
h = input().split()

t = int(ta[0])
a = int(ta[1])
for i in range(n):
	h[i] = int(h[i])

tem = []#各地点の平均気温
for i in range(n):
	tem.append(t - (h[i]*0.006))

rem = []#各地点の平均気温とaの差の絶対値
for i in range(n):
	if tem[i] >= a:
		rem.append(tem[i] - a)
	else:
		rem.append(a - tem[i])

tmp = rem[0]
ans = 0
for i in range(1, n):#差が一番小さい地点を探す
	if tmp > rem[i]:
		tmp = rem[i]
		ans = i

print(ans+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
d=sorted(l+[(t-a)*500/3])
b=d.index((t-a)*500/3)
bn=(t-a)*500/3
if b==0:
  print(l.index(d[1])+1)
elif b==n:
  print(l.index(d[n-1])+1)
else:
  x,y=d[b-1],d[b+1]
  k=min([bn-x,y-bn])
  print(l.index(x)+1) if k==bn-x else print(l.index(y)+1)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int,input().split())
array = list(map(lambda x: abs(a - (t - int(x) * 0.006)),input().split()))
cnt = 0
Min = 9999
for i in range(n):
    if Min > array[i]:
        Min = array[i]
        cnt = i + 1
print(cnt)

Submission status: Accepted

Solution code:
import numpy as np
N = input()
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
l = list()
for h in H:
    l.append(T - h * 0.006)

print(np.abs(np.asarray(l) - A).argmin() + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = [int(x) for x in input().split()]
HN = [int(x) for x in input().split()]
dT = 10 ** 10
res = 0
for i, h in enumerate(HN):
  tdT = abs(A - (T - h * 0.006))
  if tdT < dT:
    res = i
    dT = tdT
    
print(res + 1)

Submission status: Accepted

Solution code:
N=int(input())

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

min=5000

H=[int(x) for x in input().split()]

for i in range(N):
    #print(abs(A-(T-H[i]*0.006)))
    if abs(A-(T-H[i]*0.006)) <= min:
        min=abs(A-(T-H[i]*0.006))
        buf=i+1

print(buf)

Submission status: Accepted

Solution code:
import math
import sys
from itertools import accumulate
from functools import reduce
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

sys.setrecursionlimit(10000)

mod = 1000000007

"""
# 0埋め, 小数点出力桁指定時のときの出力
a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654

# 文字列をリストに格納
char_list = list("abcd") # ["a","b","c","d"]

# 標準入力取得
## 文字列
    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())

## 数値
    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき
"""

if __name__ == "__main__":
    N = int(sys.stdin.readline())
    T, A = map(int, sys.stdin.readline().split())
    H = list(map(int, sys.stdin.readline().split()))
    ans = H[0]
    ansi = 1
    for i, h in enumerate(H):
        temper = T - h * 0.006
        if abs(A - ans) > abs(A - temper):
            ans = temper
            ansi = i + 1
    print(ansi)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
minV = 10**8
ans = 0

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

print(ans)

Submission status: Accepted

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

min_diff = 9999999999
min_index = 0
for i, h in enumerate(h_list):
    diff = abs(y - (x - h * 0.006))
    if min_diff > 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()))

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

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

Submission status: Accepted

Solution code:
n = int(input())

tmp , near = map(int, input().split())

height = [int(x) for x in input().split()]

num = 0

box=[]

for x in height:
    av =tmp - x*0.006
    result = abs(av-near)
    box.append(result)
    
    
    
print(box.index(min(box))+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
hList = list(map(int, input().split()))
closest = 99999999
cIndex = 0

for i, temp in enumerate(hList):
  t = T - 0.006 * temp
  if closest > abs(A - t):
    closest = abs(A - t)
    cIndex = i

print(cIndex + 1)

Submission status: Accepted

Solution code:
def solve():
    n = int(input())
    t, a = map(int, input().split())
    h = list(map(int, input().split()))
    ans = 0
    min_diff = 10 ** 9
    for idx, hi in enumerate(h):
        diff = abs(t - hi * 0.006 - a)
        if diff < min_diff:
            min_diff = diff
            ans = idx + 1
    return ans


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

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

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()))
ans= 0
tmp = 100000
for i in range(N):
    s = T - H[i]*0.006
    if tmp > abs(A - s):
        tmp = abs(A - s )
        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()))
_abs = 10 ** 9
place = 0
for i in range(n):
    tem = t - h[i] * 0.006
    if _abs > abs(a - tem):
        _abs = abs(a - tem)
        place = i + 1
print(place)

Submission status: Accepted

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

Submission status: Accepted

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

list_judge = []

for i in list_h:
    aaa= T-(i*0.006)
    bbb = abs(A - aaa)
    list_judge.append(bbb)

min = list_judge.index(min(list_judge))+1
print(min)

Submission status: Accepted

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

answer = 1
answer_t = T - H[0] * 0.006

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

Submission status: Accepted

Solution code:

n = int(input())
T, a = map(int, input().split())
Hs = list(map(int, input().split()))

ans = 10**6
result = 0
for i in range(n):
    t = T- Hs[i]*0.006
    if abs(a - t) < ans:
        ans = abs(a-t)
        result = i

print(result+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

min_k = 999999999999999999999999
for i in range(n):
    if abs(a - (t - h[i]*0.006)) < min_k:
        min_k = abs(a - (t - h[i]*0.006))
        min_index = i

print(min_index+1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import copy
import sys

inputa = input().split()
inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

x = int(inputb[0])
y = int(inputb[1])

inputb = input().split()
inputbList = [int(n) for n in inputb]
#
# inputList=[]
# for i in range(a):
#     inputNum = input().split()
#     inputList = [int(n) for n in inputNum]
#     # inputList.append(int(inputNum))

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

min = sys.maxsize
idx = -1
for i in range(a):
    tmp = abs(y - (x - 0.006*inputbList[i]))
    if min > tmp:
        min = tmp
        idx = i+1

print(idx)

Submission status: Accepted

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

temp_diff = 10000
tidx = -1

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

    if abs_temp_diff <= temp_diff:
        temp_diff = abs_temp_diff
        tidx = i+1
print(tidx)

Submission status: Accepted

Solution code:
n=int(input())
t,a=input().split()
t,a=int(t),int(a)
h1=input().split()
h2=[]
for i in h1:
    h2.append(int(i))

d=abs(t-h2[0]*0.006-a)
j=1
for i in range(n-1):
    #print(t-h2[i]*0.006)
    if d>abs(t-h2[i+1]*0.006-a):
        d=abs(t-h2[i+1]*0.006-a)
        j=i+2

print(j)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0
for i in range(N):
  if abs(T - 0.006 * H[i] - A) < abs(T - 0.006 * H[ans] - A):
    ans = i
print (ans + 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])
diff = [abs(a - (t - x * 6e-3)) for x in locations]
print(diff.index(min(diff))+1)