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

Submission status: Accepted

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

difference = 9999999
ans = 0
for i in range(len(H)):
	temp = T - H[i] * 0.006
	if difference > abs(temp - A):
		difference = 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()))
h_=[]
for i in range(n):
    h_.append([abs(t-h[i]*0.006-a),i])
h_.sort()
print(h_[0][1]+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = input().split()
T,A = int(a[0]), int(a[1])
titen = list(map(int,input().split()))

true_num = 1000
for i in range(n):
  t = T-0.006*titen[i]
  b = abs(t-A)
  if b < true_num:
    true_num = b
    res = i+1
    
print(res)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
s = 10000
ans = 0
for i,h in enumerate(H,1):
    if abs(T-h*0.006-A) < s:
        s = abs(T-h*0.006-A)
        ans = i
print(ans)

Submission status: Accepted

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

d = 1000000000000
ans_count = 1
for i in range(n):
    ans = t - h[i] * 0.006
    if d > abs(a - ans):
        d = abs(a-ans)
        ans_count = i+1
print(ans_count)

Submission status: Accepted

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

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

Submission status: Accepted

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

min_diff = float('inf')

for idx, temp in enumerate(temp_list):
    if min_diff > abs(temp-A):
        min_diff = abs(temp-A)
        min_idx = idx + 1
    # min_diff = min(min_diff, abs(temp-T))
# min_idx = temp_list.index(min_diff)
print(min_idx)

Submission status: Accepted

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

ts = [abs(t-0.006*h[i]-a) for i in range(n)]
min_ts=min(ts)
ret = [i for i in range(n) if ts[i]==min_ts][0]+1

print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

min_diff = 100000
result = -1
for i, h in enumerate(list_h):
  temp_t = t - h * 0.006
  if abs(a - temp_t) < min_diff:
    min_diff = abs(a - temp_t)
    result = i + 1
print(result)

Submission status: Accepted

Solution code:
import sys
import numpy as np
input = sys.stdin.readline
N = int(input())
T, A = [int(x) for x in input().split()]
H = np.array([int(x) for x in input().split()], np.int64)
H = -0.006 * H
H += T
H = abs(H - A)
minH = H.min()
ans = np.where(H == minH)[0][0] + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

dif_temps = [0] * n


for i in range(n):
  dif_temps[i] = abs(t - hs[i] * 0.006 - a)

min_dif = dif_temps[0]
min_dif_index = 0

for i in range(n):
  if min_dif > dif_temps[i]:
    min_dif = dif_temps[i]
    min_dif_index = i

print(min_dif_index + 1)

Submission status: Accepted

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

Submission status: Accepted

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

best_diff = None
best_height = None
for h in H:
    avg_tmp = T - h * 0.006
    diff = abs(A - avg_tmp)

    if best_diff is None:
        best_diff = diff
        best_height = h
    elif diff < best_diff:
        best_diff = diff
        best_height = h
    else:
        pass

print([i for i, val in enumerate(H, 1)
       if val == best_height][0])

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)
ans = h.index(min(h))+1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
line = input().split()
t = int(line[0])
a = int(line[1])
temps = map(int,input().split())
temps = list(temps)
places = {}
count = len(temps)
for i in range(count):
  places[i] = abs(a - (t - 0.006 * temps[i]))
answer = min(places.items(),key = lambda x:x[1])[0] + 1
print(answer)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
def get_temp(x):
  return t - x * 0.006
best = a + 10000
ans = 0
for i in range(n):
  cur_dif = abs(get_temp(H[i]) - a)
  if cur_dif < best:
    best = cur_dif
    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=[abs(t-H[i]*0.006-a) for i in range(n)]
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()))
tem = 1000 * (t-a)/6
l = []

for i in h:
    temtem = i - tem
    temAbs = abs(temtem)
    l.append(temAbs)

for j in l:
    if j == min(l):
        print(l.index(j) + 1)

Submission status: Accepted

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

dif = 1000000 
ans = 0 

for i in range(N):
        temp = T - H[i] * 0.006
        c = abs(temp - A)
        if c < dif:
                ans = i + 1 
                dif = c 

print(ans)

Submission status: Accepted

Solution code:
from numpy import argmin
input()
T, A = map(int, input().split())
print(argmin([abs(T - x * 0.006 - A) for x in map(int, input().split())]) + 1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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


ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)


ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")

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())
lst = [abs(t - int(i) * 0.006 - a) for i in input().split()]
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()))
mylist = []
for i in range(n):
    tmp = abs(a - (t - h[i] * 0.006))
    mylist.append(tmp)
minVal = min(mylist)
ans = mylist.index(minVal)
print(ans + 1)

Submission status: Accepted

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

result = 0
best = float('inf')
for i in range(N):
    t = T - H[i] * 0.006
    if abs(A - t) < best:
        best = abs(A - t)
        result = i + 1
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def c(n):
    return abs(a - (t - (n * 0.006)))

_ = int(input())
t,a = map(int,input().split())
p = list(map(int,input().split()))

d = list(map(c, p))
s = min(d)
print(d.index(s)+1)

Submission status: Accepted

Solution code:
N=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
judge=10**18
for i,h in enumerate(H):
  if abs(a-(t-0.006*h)) < judge:
    ans=i+1
    judge=abs(a-(t-0.006*h))

print(ans)

Submission status: Accepted

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

def calcDiffAveTemp(height):
    temp = T - (height * 0.006)
    diffA = abs(A-temp)
    return diffA

diffs = [calcDiffAveTemp(h) for h in candidates]

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

Submission status: Accepted

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

plc = 0
dlt = 10000

for i in range(n):
    if abs(a - (t - ls_h[i] * 0.006)) < dlt:
        dlt = abs(a - (t - ls_h[i] * 0.006))
        plc = i

print(plc+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##### 解けた #####

import numpy as np

N=int(input())
T,A=list(map(int,input().split(" ")))
H=np.asarray(list(map(int,input().split(" "))))
print(np.argmin(np.abs(A-(T-H*0.006)))+1)

Submission status: Accepted

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

Submission status: Accepted

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

temp = 0.006
min_t = abs(a - (t - h[0] * temp))
min = 0

for i in range(n):
    tmp = abs(a - (t - h[i] * temp))
    if tmp < min_t:
        min_t = tmp
        min = i

print(min + 1)

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
TA = list(map(int,input().split()))
T=TA[0]
A=TA[1]
H = list(map(int,input().split()))
temperature=[]
def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

for i in range(N):
    temperature.append(T-H[i]*0.006)
print(getNearestValue(temperature,A)+1)

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

print(np.argmin(abs(A - (T - H * 0.006))) + 1)

Submission status: Accepted

Solution code:
from operator import itemgetter

N = int(input())

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

high_list = [int(num) for num in input().split()]

TEMP = 0.006

d = {}
for h in high_list:
    average = T - (h * TEMP)
    absolute = abs(A - average)
    d[h] = absolute

sorted_dict = sorted(d.items(), key=itemgetter(1))
ans = sorted_dict[0][0]

print(high_list.index(ans) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

mtemp = math.fabs(A - (T - Hn[0] * 0.006))
midx = 0
for idx, v in enumerate(Hn):
    tmp = math.fabs(A - (T - v * 0.006))
    if tmp < mtemp:
        mtemp = tmp
        midx = idx

print(midx + 1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
t,a = MAP()
h = MAP()

res = MOD
for i in range(n):
    tmp = abs(a-(t-(h[i]*0.006)))
    if res>tmp:
        res = 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()))
li=[]
for i in range(n):
  li.append(abs((t-(h[i]*6/1000))-a))
  
x=li.index(min(li))
print(x+1)

Submission status: Accepted

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

    array = [abs(a-(t-x*0.006)) for x in H]
    minimum = min(array)
    ans = 0
    for i in range(n):
        if array[i] == minimum:
            ans = i + 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
res = 0
t = float("inf")
for i in range(N):
  if t > abs(T - 0.006 * H[i] - A):
    res = i + 1
    t = abs(T - 0.006 * H[i] - A)
print(res)

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(1,n):
    t1 = t-h[ans]*0.006
    t2 = t-h[i]*0.006
    if abs(a-t1) > abs(a-t2):
        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()))

l = [0] * N

for i in range(N):
    l[i] = 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())
l = list(map(int, input().split()))
d = 100000000000000000
a = 0

for i in range(N):
    x = abs(A-(T-l[i]*0.006))
    if x < d:
        d = x
        a = i+1
print(a)

Submission status: Accepted

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

#print(h)
l = [0]*n

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

#最小値のインデックスを出力
#print(l.index(min(l)))

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

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

Submission status: Accepted

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

list2 = []

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(ans + 1)

Submission status: Accepted

Solution code:
n=int(input())
t, a=map(int, input().split())
h=list(int(i) for i in input().split())
temp=[abs(a-(t-k*0.006)) for k 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()))
tofh = [(t - x * 0.006) for x in h]
import math
deltaoft = [math.fabs(tofx - a) for tofx in tofh]
print(deltaoft.index(min(deltaoft)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 113: B – Palace
n = int(input())
t, a = [int(s) for s in input().split()]
h = [int(s) for s in input().split()]
difference = [abs(a - (t - i * 0.006)) for i in h]

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
num = 0
min_temp = 10000000
for i in range(n):
    temp = t - (0.006*h[i])
    temp_diff = abs(a - temp)
    if temp_diff < min_temp:
        min_temp = temp_diff
        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=100000
for i in range(n):
  if abs(a-(t-h[i]*0.006)) < ans:
    ans=abs(a-(t-h[i]*0.006))
    k=i
print(k+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = [int(H) for H in input().split()]
min_diff = 10e9
ans = 0
for i, H in enumerate(Hs):
    T_at_H = T - H*0.006
    diff = abs(A - T_at_H)
    if diff < min_diff:
        min_diff = diff
        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()))

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[int(x) for x in input().split()]
answer=0
deff=float('inf')
for i in range(N):
  deff=min(deff,abs(H[i]-(T-A)/0.006))
  if deff==abs(H[i]-(T-A)/0.006):
    answer=i+1
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

a_L = []
for val in h_L:
    temp = t-val*0.006
    x = abs(a-temp)
    a_L.append(x)

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

Submission status: Accepted

Solution code:
def main():
  N = int(input())
  T, A = map(lambda i: int(i), input().split(' '))
  H = list(map(lambda i: int(i), input().split(' ')))
  diff = -1
  answer = 0
  for i in range(N):
    t = T - H[i] * 0.006
    if diff == -1 or abs(A - t) < diff:
      diff = abs(A - t)
      answer = i + 1
  print(answer)

main()

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
mi, ami = float("inf"), -1
for i, h in enumerate(H, 1):
    t = abs(T - 0.006 * h - A)
    if t < mi:
        mi = t
        ami = i
print(ami)

Submission status: Accepted

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

print(1+min(enumerate(lis), key=lambda x:x[1])[0])

Submission status: Accepted

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


def solve(N: int, T: int, A: int, H: "List[int]"):
    tmp = 10**6
    for i,h in enumerate(H):
        if tmp > abs(A - T + h*0.006):
            tmp = abs(A - T + h*0.006)
            ans = i + 1
    print(ans)


# Generated by 1.1.6 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 = list(map(int, input().split()))
for i in range(N):
  H[i] = T - H[i] * 0.006 - A
  if H[i] < 0:
    H[i] = (-1) * H[i]
M = -1
for i in range(N):
  if H[i] == min(H):
    M = i+1
print(M)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
List = list(map(int,input().split()))
div = 100000
for i in range(len(List)):
    heat = T - List[i] *0.006
    if(div>abs(A - heat)):
        div = abs(A -heat)
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
t, a = [int(x) for x in input().split()]
candidates = [int(x) for x in input().split()]

temperatures = [t - c*0.006 for c in candidates]
temp_diff = [abs(a - t) for t in temperatures]
print(np.argmin(temp_diff)+1)

Submission status: Accepted

Solution code:
# 2019-11-11 14:35:02(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    n, T, A, *h = (int(x) for x in sys.stdin.read().split())

    min_diff, ans = abs(A - (T - h[0] * 0.006)), 1 # default 
    for i in range(1, n):
        t = T - h[i] * 0.006
        diff = abs(A - t)
        if diff < min_diff:
            min_diff = diff
            ans = i + 1
    print(ans)




if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def temperature(T, x):
  temp = T - 0.006 * x
  return temp

for i in range(N):
  ans_list.append(abs(temperature(T, H[i]) - A))

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

Submission status: Accepted

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

Submission status: Accepted

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

temp = T - H[0] * 0.006 - A
ans = 0
for i, height in enumerate(H):
    B = T - height * 0.006 - A
    if abs(T - height * 0.006 - A) <= abs(temp):
        temp = T - height * 0.006 - A
        ans = i + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline
sys.setrecursionlimit(10**7)
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

minabs = 10 ** 10
resi = 0

for i, h in enumerate(H):
    res = abs(A - (T-h*0.006))
    if minabs > res:
        resi = i
        minabs = min(minabs, res)

print(resi+1)

Submission status: Accepted

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

x = 10**12
res = 0

for i in range(N):
    y = abs(A - (T - H[i] * 0.006))
    if y < x:
        x = y
        res = i+1

print(res)

Submission status: Accepted

Solution code:
N = int(input())
t , x = map(int,input().split())
h_list = list(map(int,input().split()))
tmp = []
for h in h_list:
    tmp1 = abs(x - (t - h * 0.006))
    tmp.append(tmp1)
print(tmp.index(min(tmp)) + 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()]
li = list(map(int,stdin.readline().rstrip().split()))
lin = []

for i in li:
    lin.append(abs(a-(t-i*0.006)))

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

Submission status: Accepted

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

def main():
    n=int(input())
    t,a=map(int,input().split())
    hh=list(enumerate(map(int,input().split())))
    print(min(hh, key=lambda x:abs(t-a-x[1]*0.006))[0]+1)

main()

Submission status: Accepted

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

minn = 10000
j = 0
for i in h:
	num = t - i * 0.006
	j += 1
	if abs(num-a) < minn:
		minn = abs(num-a)
		ans = j
print (ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
N = int(input())
T, A = map(int, input().split())
H = np.array(list(map(int, input().split())))

tmp = T - H*0.006
dif = abs(tmp-A)
ind = np.argmin(dif)

print(ind+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())
H=list(map(int,input().split()))
li=[]
for h in H:
    li.append(abs(A-(T-0.006*h)))
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()))
ls = []

for h in H:
    ls.append(abs(a-(t-h*0.006)))

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

Submission status: Accepted

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

Submission status: Accepted

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

print(min((abs(T - h*0.006 - A), i) for i, h in enumerate(H))[1] + 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(' ')]
minTemp = 600

for i,h in enumerate(H):
    temp = T - h * 0.006
    if abs(temp-A) < minTemp:
        minTemp = abs(temp-A)
        place = i+1
print(place)

Submission status: Accepted

Solution code:
def solve():
    N = input()
    T,A = map(int, input().split())
    temperature = lambda x: T-0.006*x
    H = list(map(int, input().split()))
    diff_h = abs(A-temperature(H[0]))
    ret = 0
    for i,h in enumerate(H):
        if abs(A-temperature(H[i])) <= diff_h:
            diff_h = abs(A-temperature(H[i]))
            ret = i
            
    print(ret+1)
    
solve()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T,A =map(int,input().split())
H = np.array(input().split(),dtype=np.float64)
x=np.abs(T-H*0.006-A)
ans=np.argmin(x)+1
print(ans)

Submission status: Accepted

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

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

print(ind)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

H = np.array(H)
H_t = abs(T - H * 0.006 - A)
H_min_ind = [n for n, v in enumerate(H_t) if v == min(H_t)]

print(H_min_ind[0]+1)