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:
# coding: utf-8

n = int(input())
(t, a) = [int(i) for i in input().rstrip().split(" ")]

point_list = [int(i) for i in input().rstrip().split(" ")]

ans = -1
nearest = 100000

for i in range(n):
    kion = abs(t - (point_list[i] * 0.006) - a)
    if kion < nearest:
        ans = i + 1
        nearest = kion

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
closeH = {}
for x in range(len(H)):
    H[x] = T - H[x] * 0.006
    closeH[x + 1] = abs(A - H[x])
min_G = min(closeH, key=closeH.get)
print(min_G)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
S=list(map(int,input().split()))
mini=16777216
mininum=0
for i in range(N):
    if abs(T-0.006*S[i]-A)<mini:
        mini=abs(T-0.006*S[i]-A)
        mininum=i+1

print(mininum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H_li = list(map(int, input().split()))
min_abs = 10 ** 9
num = 2000
for i in range(N) :
    mean_t = T - H_li[i] * 0.006
    abs_ha = abs(mean_t - A)
    if abs_ha < min_abs :
        min_abs = abs_ha
        num = i + 1
print(num)

Submission status: Accepted

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

ans=0
MIN=10000000000000
for i in range(n):
  now=t-h[i]*0.006
  dif=abs(a-now)
  if dif<MIN:
    MIN=dif
    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 = 1000000000000000000000000
memo = 0
for i in range(n):
    if ans > abs(a-(t-h[i]*0.006)):
        ans = abs(a-(t-h[i]*0.006))
        memo = i+1
print(memo)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# palace
n = input()
T, target = [int(e) for e in input().split()]
H = list(map(int, input().split()))

average_temp = []
min_diff = float('inf')
index = -1

for index, value in enumerate(H):
    average_temp = T - value*0.006
    diff = abs(target - average_temp)
    if min_diff > diff:
        min_diff = diff
        min_index = index+1
print(min_index)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
delta = float('inf')
H = list(map(int, input().split()))
for i in range(N):
    # H = int(input())
    if delta > abs((T - H[i] * 0.006) - A):
        delta = abs((T - H[i] * 0.006) - A)
        answer = i + 1

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
hLst = list(map(int, input().split()))
ans = int()
otmp = 10 ** 5

for i in range(n):
    tmp = t - hLst[i] * 0.006
    if abs(a - tmp) < abs(a - otmp):
        otmp = tmp
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
Temp, A = list(map(int, input().split()))
H = list(map(float, input().split()))
k = 0
target = float("inf")
n = []
for i, v in enumerate(H, start=1):
    k = Temp - v * float(0.006)
    if target > abs(k - A):
        target = abs(k - A)
        n.append(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=0
x=10**9
for i in range(n):
    temp=abs(a-(t-h[i]*0.006))
    if temp < x:
        x=temp
        ans=i+1
print(ans)

Submission status: Accepted

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

d0 = 10000
r = -1
    
for i in range(N):
    d = abs(t[i]-A)
    if d < d0:
        d0 = d
        r = i
print(r+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

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

H = np.array([int(i) for i in input().split()])

temp = T - 0.006*H

temp_def = temp-A

temp_target = min(abs(temp_def))

ans = int(np.where(abs(temp_def) == temp_target)[0]) +1


print(ans)

Submission status: Accepted

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

minv = V[0]
index=0

for i,v in list(enumerate(V)):
    if v<minv:
        minv=v
        index=i

print(index+1)

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc113/tasks/abc113_b
# Python 3rd Try


class Problem:
    def __init__(self, allnumber, maxthermo, avepoint, highs):
        self.allnumber = allnumber
        self.maxthermo = maxthermo
        self.avepoint = avepoint
        self.highs = highs

    def problemprint(self):
        print(self.allnumber)
        print(self.maxthermo)
        print(self.avepoint)
        print(self.highs)

    def solve(self):
        maxdiff = 100000.0
        result = 1
        for j in range(0, self.allnumber):
            difftemp = abs(self.avepoint-(self.maxthermo-self.highs[j]*0.006))
#            print('{}->{}'.format(maxdiff,difftemp))
            if difftemp < maxdiff:
                maxdiff = difftemp
                result = j+1
        return result


if __name__ == "__main__":
    N = int(input())
    T, A = map(float, input().split(' '))
    HI = list(map(float, input().split(' ')))
    print(Problem(N, T, A, HI).solve())
#    print(Problem(2, 12.5, 5.0, [1000.0, 2000.0]).solve())
#    print(Problem(3, 21.0, 11.0, [81234.0, 94124.0, 52141.0]).solve())

Submission status: Accepted

Solution code:
N = int(input())
Temperature, A_target = map(int, input().split())
Height = list(map(int, input().split()))

l = [abs(A_target - (Temperature - 0.006 * i)) for i in Height]
print(l.index(min(l)) + 1)

Submission status: Accepted

Solution code:
N = int(input())
Temperature, A_target = map(int, input().split())
Height = list(map(int, input().split()))
mini_temp = float('inf')
index = 0

for i in range(N):
    t = Temperature - 0.006 * Height[i]
    diff = abs(t - A_target)
    if (diff < mini_temp):
        index = i
        mini_temp = diff

print(index + 1)

Submission status: Accepted

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

H_real=(T-A)/0.006

H_index=[]
for i in range(N):
    H_index.append((abs(H[i]-H_real),i+1))
H_index=sorted(H_index,key=lambda x:x[0])

print(H_index[0][1])

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda x: [ni() for _ in range(x)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda x: [na() for _ in range(x)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda x: [ns() for _ in range(x)]
nas = lambda: stdin.readline().split()

n = ni()
t, a = na()
h = na()

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

print(ans)

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=[];R=[]
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
m=10**5
for i in range(N):
  R.append(i)
for i in H:
  S.append(abs(T-i*0.006-A))
F=list(zip(R,S))
F.sort(key=lambda x: x[1])
#print(F)
print(F[0][0]+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
ans, diff = 0, 10**9
for i, h in enumerate(H):
  temp = t - h*0.006
  if abs(a - temp) < diff:
    diff = abs(a - temp)
    ans = i+1
print(ans)

Submission status: Accepted

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

n = int(input().strip())
T,A = list(map(int, input().rstrip().split()))
nums_H = list(map(int, input().rstrip().split()))
#----------
diff=[]
for hight in nums_H:
    diff += [ abs((T - hight*0.006) - A) ]

print([ i+1 for i, v in enumerate(diff) if v == min(diff)][0] )

Submission status: Accepted

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

Submission status: Accepted

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

min = max(h)
ans = []

for i, j in enumerate(h):
    ans.append([abs(t*1000 - (j * 6) - a*1000),i+1])

print(sorted(ans)[0][1])

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    N = int(input())
    T, A = map(int, input().split())
    H = tuple(map(lambda h: abs(T - int(h) * 0.006 - A), input().split()))
    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()))

l = []
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 = int(input())
T, A = map(int,input().split())
list_H = [int(x) for x in input().split()]

min = 1000

for i in range(N) :
    Temp = T - list_H[i] * 0.006
    score = abs(A - Temp)
    if score < min :
        min = score
        ans = i

print(ans+1)

Submission status: Accepted

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

h=map(int, input().split())
res=dict()
for i, v in enumerate(h):
    res[i+1]=abs(a-(t-v*0.006))

print(min(res, key=res.get))

Submission status: Accepted

Solution code:
import numpy as np
import sys
input = sys.stdin.readline

def main():
    n = input()
    t, a = map(float, input().split())
    heights = np.array(list(map(float, input().split())))
    diffs = np.abs(t - heights * 0.006 - a)
    print(np.argmin(diffs) + 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

dt = 10**9
num = 0
for i in range(n):
    ti = t - hl[i] * 0.006
    if abs(a - ti) <= dt:
        dt = abs(a - ti)
        num = i

print(num + 1)

Submission status: Accepted

Solution code:
N = int(input())
[T, A] = list(map(int, input().split()))
H = list(map(int, input().split()))
c = 0.006
H_tem = [T - c*H[_] for _ in range(N)]
min_ans = float("inf")

for i in range(len(H)):
  ans = abs(A - H_tem[i])
  if ans < min_ans:
    min_ans = ans
    point = i+1

print(point)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
best = float("inf")
ind = 0
for i in range(n):
    temp = abs(a-(t- h[i]*0.006))
    if temp < best:
        ind = i
        best = temp
print(ind+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()]

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

print(ans)

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc113/tasks/abc113_b
# Python 2nd Try
import sys


def solver(allplace, maxtemp, targettemp, eachheight):
    answer = 0
    difftemp = 10.0**5
    for j in range(0, allplace):
        heretemp = abs(targettemp - (maxtemp - eachheight[j]*0.006))
        if heretemp < difftemp:
            answer = j
            difftemp = heretemp
    return answer+1


if __name__ == "__main__":
    N = list(map(int, sys.stdin.readline().split()))
    T, A = map(float, sys.stdin.readline().split(' '))
    HI = list(map(float, sys.stdin.readline().split(' ')))
    print(solver(N[0], T, A, HI))

Submission status: Accepted

Solution code:
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006) - A)] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])

Submission status: Accepted

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

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

min_k = min(k)
print(k.index(min_k)+1)

Submission status: Accepted

Solution code:
#入力（後でいじる）
def pin(type=int):
    return map(type,input().split())
#どっかで最悪計算量の入力データを用意する関数を作ろう？
"""

"""
#solution:
#潜 影 蛇 手 ! !
N=int(input())
T,A=pin()
H=[i for i in pin()]
c=(T-A)/0.006
HH=[abs(h-c) for h in H]
#print(c,HH)
print(HH.index(min(HH))+1)

Submission status: Accepted

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

dt = 10**9
num = 0
for i in range(n):
    ti = t - hl[i] * 0.006
    if abs(a - ti) <= dt:
        dt = abs(a - ti)
        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()))

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = input()
t, a = map(int, input().split())
h = list(map(int, input().split()))
a = (t - a)/0.006
hNew = h.copy()
hNew.append(a)
hNew.sort()
num = hNew.index(a)
if abs(hNew[num] - hNew[num-1]) < abs(hNew[num+1] - hNew[num]):
    print(h.index(hNew[num-1])+1)
else:
    print(h.index(hNew[num+1])+1)

Submission status: Accepted

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

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

answer = -1
dif = 10 ** 15
for i, h in enumerate(H, 1):
    if abs(A - (T - h * 0.006)) < dif:
        answer = i
        dif = abs(A - (T - h * 0.006))

print(answer)

Submission status: Accepted

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

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

Th = [T - h * 0.006 for h in H]

answer = -1
dif = 10 ** 15
for i, t in enumerate(Th, 1):
    if abs(A - t) < dif:
        answer = i
        dif = abs(A - t)

print(answer)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
c=0
li=[]
for x in l:
    c+=1
    tmp=[]
    tmp.append(abs(a-t+x*0.006))
    tmp.append(c)
    li.append(tmp)
print(sorted(li)[0][1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
def diff(t,high,flag):
    temp = t - high * 0.006
    d = abs(flag - temp)
    return d
min_d = diff(t,h[0],a)
ans = 1
for i in range(n):
    if min_d > diff(t,h[i],a):
        min_d = diff(t,h[i],a)
        ans = i+1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 1
diff_min = abs(temp[0]-A)

for cnt, t in enumerate(temp,1):
  if abs(A-t) < diff_min:
    diff_min = abs(A-t)
    place = cnt

print(place)

Submission status: Accepted

Solution code:
try:
    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))
    print(H.index(min(H))+1)
except EOFError:
    pass

Submission status: Accepted

Solution code:
n = int(input())
const, target = (int(x) for x in input().split())
h_lst = list(map(int, input().split()))

infinity = float('inf')
min_i = -1
min_abs = infinity

for i in range(n):
    if abs(target - const + h_lst[i]*0.006) < min_abs:
        min_i = i
        min_abs = abs(target - const + h_lst[i]*0.006)
    else:
        pass
print(min_i + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int,input().split())
# print(N,T,A)
list_H = list(map(int,input().split()))
# print(list_H)
ans = 0
min_diff = 1000
for i, h in enumerate(list_H):
    tmp = abs(A-(T-h*0.006))
    if tmp < min_diff:
        ans = i+1
        min_diff = tmp
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int,input().split())
h = list(map(int, input().split()))
ans = 0
val = 100000000000000
for i in range(n):
    if abs(a- (t-(h[i]*0.006))) < val:
        val =  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())
Hlist = list(map(int, input().split()))
sbn = 10**9 + 7
for i in range(N):
    temp = T - Hlist[i]*0.006
    nowsbn = abs(A - temp)
    if nowsbn < sbn:
        ans = i + 1
        sbn = nowsbn
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem https://atcoder.jp/contests/abc113/tasks/abc113_b
# Python 1st Try
import sys


def solver(allnum, maxtemp, targettemp, heightplace):

    answer = 0
    mindiff = 100000000
    for j in range(0, allnum):
        difftemp = abs(targettemp - (maxtemp-heightplace[j]*0.006))
        if difftemp < mindiff:
            mindiff = difftemp
            answer = j
    return answer+1


if __name__ == "__main__":
    N = list(map(int, sys.stdin.readline().rsplit()))
    SLINE = list(map(float, sys.stdin.readline().split()))
    HI = list(map(float, sys.stdin.readline().split()))
    print(solver(N[0], SLINE[0], SLINE[1], HI))

Submission status: Accepted

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

tmp = max(h)
ans = 0
for i in range(len(h)):
  if abs(t - h[i] * 0.006 - a) <= tmp:
    ans = i + 1
    tmp = 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()))
num1 = 9999
ans = 0

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

print(ans)

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

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

Submission status: Accepted

Solution code:
h = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tem = 10**6
x = 1
for i in h:
    if abs(a-(t-i*0.006)) < tem:
        tem = abs(a-(t-i*0.006))
        ans = x
    x += 1
print(ans)

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())))
temp = abs((t - 0.006 * h) - a)
ans = np.where(min(temp) == temp)
print(ans[0][0] + 1)

Submission status: Accepted

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

h = list(map(int, (input().split())))
min = abs(a - (t - h[0]*0.006))
ans = 1

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split(" "))
H = list(map(int,input().split(" ")))
avg = 0
# diff = []
index,clst = 0,500
for i in range(len(H)):
	avg=(T-H[i]*0.006)
	# diff.append(avg-A)
	if abs(avg-A) <= clst:
		clst = abs(avg-A)
		index = i 
# print(diff)
print(index+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))
#print(ans)
#print(A_raw)
#print(built)
index = 0

a = min(built)

for k in range(0, N):
	if a == built[k]:
		built_num = k
	

print(str(built_num + 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 H:
    temp=t-i*0.006
    Ans.append(abs(a-temp))
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()))

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

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

Submission status: Accepted

Solution code:
a = input()
t, a = map(int, input().split())
basho = list(map(int, input().split()))
dstlist = [t - 0.006 * b for b in basho]
minsa = abs(t - 0.006 * basho[0])
count = 0
for i, d in enumerate(dstlist):
    if minsa > abs(a-d):
        minsa = abs(a-d)
        count = i
print(count+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
x=list(map(int,input().split()))
b=[]
for i in range(n):
  x[i]=t-x[i]*0.006
  b.append(a-x[i])
  if(b[i]<0):
    b[i]=b[i]*-1
    
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()))
min_t=1000000
for x in H:
    res=abs(A-(T-x*0.006))
    if min_t>=res:
        min_t=min(min_t,res)
        min_idx=H.index(x)
print(min_idx+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

ans, mi=0, 1000000
for i, x in enumerate(A):
    t = T-x*0.006
    if abs(t-K) <= mi:
        mi = abs(t-K)
        ans = i+1
print(ans)

Submission status: Accepted

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

nearest = 100000000
ans = 0

for idx, i in enumerate(h):
    temp = t - i * 0.006
    temp = abs(a-temp)
    if nearest > temp:
        nearest = temp
        ans = idx + 1

print(ans)

Submission status: Accepted

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

print(index+1)

Submission status: Accepted

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

l = list(map(lambda x: abs(a - (t - 0.006 * x)), h))
print(l.index(min(l))+1)

Submission status: Accepted

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

h2=[]
for hh in h:
 h2.append(t-0.006*hh)

v=10**9
for i in range(n):
 if abs(v-a)>abs(h2[i]-a):
  v=h2[i]
  inx=i+1
print(inx)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
best = 10**6
ans = 0
for i in range(n):
    if best > abs((t-h[i]*0.006)-a):
        best = abs((t-h[i]*0.006)-a)
        ans = i+1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
list=list(map(int, input().split()))
mini=[]
for i in list:
    m = abs((T - i*0.006)-A)
    mini.append(m)
print(mini.index(min(mini))+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):
    m = T - H[i] * 0.006
    l.append(abs(A-m))
print(l.index(min(l))+1)

Submission status: Accepted

Solution code:
# リストの中から最小値のインデックスを返す方法が肝

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

x = []
for i in range(n):
    x.append(abs(a- (t - l[i] * 0.006)))
print(x.index(min(x))+1) # リストの最小値のインデックス ＋ 1

Submission status: Accepted

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