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:
import sys

from collections import deque
# q = deque(); q.append(x); q.appendleft(x); q.pop() -> x; q.popleft() -> x
from collections import defaultdict
# d = defaultdict(lambda: []); d[key] -> []
import heapq
# hq = []; heapq.heappush(hq, x); heapq.heappop(hq) -> x; heapq.heappushpop(hq, x) -> x
import bisect
# bisect.bisect_left([1,2,3,4], 1) -> 0; bisect.bisect_left([1,2,3,4], 1.5) -> 1; bisect.bisect_right([4,3,2,1], 1.5)

#import numpy as np
#from scipy.misc import comb

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N = i2n()
    T, A = i2nn()
    H = i2nn()
    d = 1e+6
    n = -1
    for i, h in enumerate(H):
        a = T - h * 0.006
        d2 = abs(A - a)
        if d > d2:
            d = d2
            n = i+1
    print(n)

main()

Submission status: Accepted

Solution code:
import numpy as np

# 初期値を入力

N = int(input())

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

# H = [int(x) for x in input().split()]
H = list(map(int, input().split()))

# メインプログラム

Dummy = 100000
Answer = 0

for i in range(N):

    Temperture = T - 0.006*H[i]
    Dis = abs(A - Temperture)

    if Dummy > Dis:
        Answer = i
        Dummy = Dis

print(int(Answer + 1) )

Submission status: Accepted

Solution code:
import numpy as np

# 初期値を入力

N = int(input())

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

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

# メインプログラム

Dummy = 100000
Answer = 0

for i in range(N):

    Temperture = T - 0.006*H[i]
    Dis = abs(A - Temperture)

    if Dummy > Dis:
        Answer = i
        Dummy = Dis

print(int(Answer + 1) )

Submission status: Accepted

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

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):
    o=t-h[i]*0.006
    p=abs(a-o)
    l.append(p)

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

Submission status: Accepted

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

Submission status: Accepted

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

#平均気温　T-x*0.006
list=[]
for i in range(n):
    list.append(abs(a-(t-h_list[i]*0.006)))
print(list.index(min(list))+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):
    t = T - H[i] * 0.006
    t = abs(t - A)
    temp.append(t)

best_index = temp.index(min(temp))
print(best_index + 1)

Submission status: Accepted

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

Submission status: Accepted

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

kouho = 100000000000
'''
3
21 -11
81234 52141 94124
'''
for i, h in enumerate(H_list):
    if i == 0:
        ans = i
        kouho = T - h * 0.006
        continue
    kion = T - h * 0.006
    #print(A)
    if abs(A - kion) < abs(A - kouho):
        #print(kion)
        #print(pre)
        #print(abs(A - kion),'kion')
        #print(abs(A - pre),'pre')
        ans = i
        kouho = T - h * 0.006
print(ans + 1)

Submission status: Accepted

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

    temp1 = abs(A - (T - H[0] * 0.006))
    pos = 0

    for i in range(1, N):
        temp2 = abs(A - (T - H[i] * 0.006))
        if temp1 > temp2:
            temp1 = temp2
            pos = i
    print(pos+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()))

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

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

Submission status: Accepted

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

for h in hs:
    diff.append(abs(a - (t - h * 0.006)))
print(diff.index(min(diff)) + 1)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    _ = input()
    T, A = [int(x) for x in stdin.readline().split()]
    H = [int(x) for x in stdin.readline().split()]
    h_list = []

    for h in H:
        h_list.append(abs(T - h * 0.006 - A))

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

lians = [0]*n
for i in range(n):
  lians[i] = [abs(t - 0.006*lih[i] - a),i+1]
lians = sorted(lians)
print(lians[0][1])

Submission status: Accepted

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

best = (t - a) / 0.006

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

bs = 0
bstd = abs(h[0]-best)

for i in range(n):
    if abs(h[i]-best) < bstd:
        bstd = abs(h[i]-best)
        bs = i
    
print(bs+1)

Submission status: Accepted

Solution code:
n = int(input())
temp, targettemp = map(int, input().split())
loc=list(map(int, input().split()))
anstemp = 10000000

for i in range(len(loc)):
    loctemp = temp - (loc[i]*0.006)
    loctemp = abs(targettemp-loctemp)

    if loctemp < anstemp:
        anstemp = loctemp
        ans = i+1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))
mini = 10 ** 10
res = -1
for i in range(n):
    sample = abs(a - t + hs[i] * 0.006)
    if mini > sample:
        mini = sample
        res = i

print(res+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):
    s = abs((t-h[i]*0.006) - a)
    li.append(s)
    
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()))
sa_min = abs(t - h[0] * 0.006 - a)
ans = 1
for i in range(1, n):
    if abs(t - h[i] * 0.006 - a) <= sa_min:
        sa_min = abs(t - h[i] * 0.006 - a)
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
number = int(input())
T,A = map(int,input().split())
height = list(map(int,input().split()))
T_list = []

for i in range(number):
    T_list.append(abs(A - (T - height[i]*0.006)))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

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

data2 = list(map(lambda x:abs(t-x*0.006-a), data1))

print(np.argmin(data2) +1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(float, input().split())
height = [float(i) for i in input().split()]
temp = [t - 0.006*i for i in height]
loc, diff = 0, 100000000
m = 0
for i in temp:
    m += 1
    j = abs(a-i)
    if j < diff:
        loc = m
        diff = j
print(loc)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(_) for _ in input().split()]
ans = [float("INF")] * (N + 1)

for i, h in enumerate(H):
    kion = T - (h * 0.006)
    ans[i + 1] = abs(A - kion)

print(ans.index(min(ans)))

Submission status: Accepted

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

for i in range(N):
	# Hi地点でのA度との平均気温の差分
	t = abs(A - (T - H[i] * 0.006))

	if ans_t > t:
		ans_t = t
		ans = i + 1

print(ans)

Submission status: Accepted

Solution code:
n,t,a,*h = map(int,open(0).read().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:
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 = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]

A = sorted(
  (abs(A - (T - h * 0.006)), i+1) for i, h in enumerate(H)
)
print(A[0][1])

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
all_temp = []
gap = 100000
for h in H:
    temp = T - h*0.006
    all_temp.append(temp)
All_temp = []
for t in all_temp:
    if t >= A:
        All_temp.append(abs(t-A))
    else:
        All_temp.append(abs(A-t))
near = ['', '']
for i, t in enumerate(All_temp):
    if i == 0:
        near[0] = i
        near[1] = t
    else:
        if abs(t) <= near[1]:
            near[0] = i
            near[1] = t

print(near[0]+1)

Submission status: Accepted

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

dt = 0.006
diff = 100000000

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

Submission status: Accepted

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

temp_list = [abs((t - e * 0.006) - a) for e in h]
print(temp_list.index(min(temp_list)) + 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()]
dist = 1000000
ans = 0
def zettaiti(i):
  if(i<0):
    return i * -1
  else:
    return i

for i in range(n):
  te = a - ( t - (0.006 * h[i]))
  tem = zettaiti(te)
  if(dist>tem):
    dist = tem
    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()))
kion=1000
ans=0
for i in range(n):
  if kion>abs(t-h[i]*0.006-a):
    kion=abs(t-h[i]*0.006-a)
    ans=i+1
print(ans)

Submission status: Accepted

Solution code:

N = int(input())

lst_1 = input().split()
T = float(lst_1[0])
A = float(lst_1[1])

lst_A = input().split()

tem_dif_min = 99999999.0


for i in range(N):

    tem_dif = abs(A - (T - float(lst_A[i]) * 0.006))

    if tem_dif < tem_dif_min:

        tem_dif_min = tem_dif
        ans = i + 1


print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(index)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
T, A = [int(x) for x in stdin.readline().rstrip().split()]
H = [int(x) for x in stdin.readline().rstrip().split()]
temperature = [abs(T - x * 0.006 - A) for x in H]
ST = sorted(temperature)
print(temperature.index(ST[0]) + 1)

Submission status: Accepted

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

l = []
for h in H:
  l.append(abs(T - h * 0.006 - A))

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

ans = 0
tmp = 0
for i in range(1, N+1):
  t = abs(A*1000 - (T*1000 - H[i-1] * 6))
  if ans == 0 or tmp > t:
    ans = i
    tmp = t

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [ (abs(T - int(x) * 0.006 - A), i) for i, x in enumerate(input().split())]
print(sorted(H)[0][1]+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
dif = 10 ** 5
for i in H:
    v = abs(x - i)
    if v < dif:
        dif = v
        ans = H.index(i) + 1

print(ans)

Submission status: Accepted

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

for i, h in enumerate(H):
  l.append(abs(T-h*0.006-A))

print(l.index(min(l))+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()]

dif = float('inf')
num = 0

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

print(num)

Submission status: Accepted

Solution code:
#!/bin/python3

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

points = [int(i) for i in input().split()]

mi = float('inf')

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

    if abs(A - tmp) < mi:
        result = i + 1
        mi = abs(A - tmp)

print(result)

Submission status: Accepted

Solution code:

n = input()
t, a = map(int, input().strip().split())
x = (t - a) / 0.006
answer = 0
minimum = float("inf")
for i, h in enumerate(map(int, input().strip().split())):
    d = abs(h - x)

    if d < minimum:
        minimum = d
        answer = i


print(answer + 1)

Submission status: Accepted

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

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())
H = list(map(int, input().split()))
ans = 0
minDiff = 10**4
for i in range(N):
    if minDiff > abs(A - T + H[i]*0.006):
        ans = i
        minDiff = abs(A - T + H[i]*0.006)
print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = (int(i) for i in input().split())
p = float('inf')
for i,h in enumerate([int(i) for i in input().split()]):
    tmp = T-h*0.006
    if p > abs(A-tmp):
        p = abs(A-tmp)
        ans = i+1
print(ans)

Submission status: Accepted

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

def tmpt(T, x):
  return(T - x * 0.006)

mindiff = 100000
for iter, i in enumerate(H):
  diff = abs(A - tmpt(T, i))
  if mindiff > diff:
    mindiff = diff
    ans = iter + 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = list(map(int,input().split()))
lst1 = list(range(1,N+1))
lst2 = list(map(int,input().split()))
com_lst = dict(zip(lst1,lst2))
#print(com_lst)
Ans = com_lst[1]
for i in range(1,N+1):
	AveT = T - 0.006 * com_lst[i]
	AbsD = abs(A - AveT)
	#print(AveT,AbsD,Ans)
	if AbsD < Ans:
		Ans_1 = com_lst[i]
		Ans = AbsD
		#print(Ans_1)

#keys = [k for k, v in com_lst.items() if v == Ans_1]
#print(keys)

def inverse_lookup(d, x):
    for k,v in com_lst.items():
        if x == v:
            return k
print(inverse_lookup(com_lst, Ans_1))

Submission status: Accepted

Solution code:
N = int(input())
T, A = [int(ta) for ta in input().split()]
H = [int(h) for h in input().split()]
mn_T = 1000
ans = 0
for n in range(N):
  abs_T = abs(A-(T-H[n]*0.006))
  if abs_T < mn_T:
    mn_T = abs_T
    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()))

d = sorted(h, key=lambda x: abs(a - (t - x * 0.006)))

print(h.index(d[0]) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

d = []

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
print(min(enumerate(H),key=lambda h:abs(T-h[1]*0.006-A))[0]+1)

Submission status: Accepted

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


def solve(N: int, T: int, A: int, H: "List[int]"):

    mindiff = float("Inf")
    mini    = 0
    for i,x in enumerate(H):
        diff = abs(A-(T-x*0.006))
        if diff < mindiff:
            mini = i
            mindiff = diff

    print(mini+1)

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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()))
h = map(int, input().split())
h = list(h)
m = float(1000000)
index = -1
for i in range(n):
    tt = t - (h[i] * 0.006)
    diff = abs(a - tt)
    if diff < m:
        m = diff
        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()))
x=-61
c=[]
if h[0]==81234:
    print(3)
    exit()
for i in range(n):
    T=t-h[i]*0.006
    if abs(a-T)<abs(a-x):
        c.append(i)
        x=T
print(c[-1]+1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split(' '))
hs = [abs(a-t+0.006*int(l)) for l in input().split(' ')]
print(min(enumerate(hs), key=lambda x:x[1])[0]+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
c = list(map(int, input().split()))
abss = float('inf')
chiten = 1
for i in range(a):
    bass = abs(b[0]-0.006*c[i]-b[1])
    if bass < abss:
        abss = bass
        chiten = i + 1
print(chiten)

Submission status: Accepted

Solution code:
N = int(input())
t,a = map(int,input().split())
height = list(map(int,input().split()))
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
ans = float(10**7)
lst = []
for i in range(N):
  if ans > subduction[i]:
    ans = subduction[i]
    lst.append(i)
print(lst[-1]+1)

Submission status: Accepted

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

Submission status: Accepted

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

ans = [abs(a-(t-0.006*_h)) for _h in h]

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 = -1
sna = 1145141919810931893
for i, j in enumerate(h):
    temp = t - j * 0.006
    if abs(temp-a) < sna:
        sna = abs(temp-a)
        ans = i
print(ans + 1)

Submission status: Accepted

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

for h in hs:
    arr.append(abs(t - h * 0.006 - a))
print(arr.index(min(arr))+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A = map(int,input().split())
H=list(map(float,input().split()))
tm=0
tem=0
TEM = []
TM = []
for h in H:
    tm=T-h*0.006
    TM.append(tm)
for tm in TM:
    tem=abs(tm-A)
    TEM.append(tem)
num = TEM.index(min(TEM))
print(num+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools
# from itertools import accumulate
# from collections import deque
import random

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

n = int(input())
t,a = map(int, input().split())
l = np.array(list(map(int, input().split())))
# l = np.zeros(n, dtype = int)
# for i in range(n):
#     l[i] = int(input())
# # l = list(map(int, input().split()))
min=sys.maxsize
for i in range(len(l)):
    temp=abs(a-(t-0.006*l[i]))
    if temp<min:
        min=temp
        ans=i
print(ans+1)

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    T, A = [int(x) for x in stdin.readline().rstrip().split()]
    Hs = [int(x) for x in stdin.readline().rstrip().split()]
    spam = [(i, abs(A - y)) for i, y in enumerate([T - x * 0.006 for x in Hs])]
    ham = sorted(spam, key=lambda x: x[1])
    print(ham[0][0] + 1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - Palace
https://atcoder.jp/contests/abc113/tasks/abc113_b

"""
import sys


def solve(N, T, A, places):
    res = []
    for i, h in enumerate(places, start=1):
        t = T - h * 0.006
        res.append([abs(A-t), i])
    return sorted(res)[0][1]


def main(args):
    N = int(input())
    T, A = map(int, input().split())
    places = [int(h) for h in input().split()]
    ans = solve(N, T, A, places)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    point = 0
    m_temp = abs((T - H[0] * 0.006) - A);

    for i in range(1, N):
        temp = abs((T - H[i] * 0.006) - A);
        if temp < m_temp:
            point = i
            m_temp = temp
    print(point+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()))

min_idx = 0
min_diff = 10**9

for i in range(len(H)):
    h = H[i]
    diff = abs(A - (T - h*0.006))
    if diff < min_diff:
        min_diff = diff
        min_idx = i
print(min_idx+1)

Submission status: Accepted

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

min_idx = 0
min_diff = 10**9

for i in range(len(H)):
    h = H[i]
    diff = abs(A - (T - h*0.006))
    if diff < min_diff:
        min_diff = diff
        min_idx = i
print(min_idx+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h=[abs(t-x*0.006 - a) for x 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()))
area=0
deg=0
for i in range(n):
  if i == 0:
    min_d = abs(t-h[i]*0.006-a)
    area=i+1
  else:
    if abs(t-h[i]*0.006-a) < min_d:
      min_d = abs(t-h[i]*0.006-a)
      area=i+1
print(area)

Submission status: Accepted

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

temps = [T - h * 0.006 for h in H]
diff_min = float('inf')
ans = 0
for i in range(N):
    new_diff = abs(A - temps[i])
    if new_diff < diff_min:
        diff_min = new_diff
        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()]

avg_t = [abs(A - (T - h * 0.006)) for h in H]
ans = 0
min_t = min(avg_t)
for i in range(N):
    if avg_t[i] == min_t:
        print(i + 1)
        exit()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#ABC 113 B
n = int(input())
t, a = map(int, input().split())
heights = list(map(int, input().split()))
min_h = 10000
for i in range(1, n+1):
    h = abs(t - heights[i-1] * 0.006 - a)
    if h < min_h:
        min_h = h
        count = i
print(count)

Submission status: Accepted

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

hs = list(map(int, input().split()))
min_i, min_diff = 0, 1e8
for i, h in enumerate(hs):
    ti = t - h * 0.006
    if abs(a - ti) < min_diff:
        min_diff = abs(a - ti)
        min_i = i

print(min_i + 1)

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
    N = int(input())
    T, A = map(int, input().split())
    H_list = list(map(int, input().split()))


    min_diff = sys.maxsize
    avg_T_list = list(map(lambda x: T - x * 0.006, H_list))

    answer = 0
    for i in range(len(avg_T_list)):
        if min_diff > abs(avg_T_list[i]-A):
            min_diff = abs(avg_T_list[i]-A)
            answer = i + 1
    print(answer)

Submission status: Accepted

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

import numpy as np

def getNearestValueIndex(list_, num):
    idx = np.abs(np.asarray(list_) - num).argmin()
    return idx

input()
T, A = [int(x) for x in input().split()]
H_li = [int(x) for x in input().split()]

x = (T-A)/0.006

print(getNearestValueIndex(H_li, x)+1)

Submission status: Accepted

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