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

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

res = float("inf")
for idx, j in sabun:
    if res > j:
        res = j
        ans = idx

print(ans)

Submission status: Accepted

Solution code:
def main():
    from builtins import int, map, list, float, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N = input_number()
    T,A = input_number_list()
    H = input_number_list()
    m = float('inf')
    idx = -1
    for i in range(N):
        if m > abs(A-(T-H[i]*0.006)):
            m = abs(A-(T-H[i]*0.006))
            idx = i
    print(idx+1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np

def getNearestIndex(list, num):
    """
    概要: リストからある値に最も近い値を返却する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx
def main():
    n = int(input())
    T, A = map(int, input().split())
    lst = list(map(int, input().split()))
    temper = [T-l*0.006 for l in lst]
    ind = getNearestIndex(temper, A)
    print(ind + 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()))

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()))
l = []

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

x = (min(l))

print(l.index(x) + 1)

Submission status: Accepted

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

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

import numpy as np
print(np.argmin(ans) + 1)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
t,a = list(map(int,input().split()))
H = list(map(int,input().split()))
H_ave = [a-(t-i*0.006) for i in H]
H = [abs(i) for i in H_ave]
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 = -1
sub = float("INF")
for i in range(N):
  temp = T - H[i] * 0.006
  if sub > abs(temp-A):
    sub = 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())))
nim = 1000000000
for i in range(N):
    H[i] = abs(T-H[i]*0.006 - A)
    if H[i] <= nim:
        nim = H[i]
        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 = 10**9+7

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

Submission status: Accepted

Solution code:
import numpy as np

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

b = 600
num = 0
for j in range(n):
  temp = T - h[j]*0.006 - A
  t = np.abs(temp)
  if t < b:
    b = t
    num = j + 1

print(num)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
mini=10**9
for i in h:
    mini=min(mini,abs(t-i*0.006-a))
for i in range(n):
    if mini==abs(t-h[i]*0.006-a):
        print(i+1)
        import sys
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

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

ans = []

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

min_value = min(ans)

for i in range(n):
    if ans[i] == min_value:
        print(i+1)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

dif=999999
res=0
index=0

for hh in h:
    temp=t-hh*(0.006)
    index+=1
    if 0 <= abs(temp-a) <= abs(dif):
        dif=temp-a
        res=index

print(res)

Submission status: Accepted

Solution code:
spot=int(input())
avg_pre,object_pre =  (int(x) for x in input().split())   
temp_list = list(input().split())

ans_list=[]
for i in temp_list:
	ans_list.append(abs(avg_pre-0.006*int(i)-object_pre))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input().strip())
T, A = [int(str) for str in input().strip().split()]
H = [int(str) for str in input().strip().split()]

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

Submission status: Accepted

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

target=(T-A)/0.006

for i,point in enumerate(H):
  I[i]= abs(H[i]-target)

#print(I)
mini=min(I)
print(I.index(mini)+1)

Submission status: Accepted

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

Submission status: Accepted

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

mini = float('inf')
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
N = input()
TA = input().split()
T = int(TA[0])
A = int(TA[1])

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A * 1000 - (T * 1000 - H[i] * 0.006 * 1000))
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i
        minTmep = compare

print(place + 1)

Submission status: Accepted

Solution code:
n = int(input())

t, a = map(int, input().split())
x = list(map(int, input().split()))
mini = abs(a - (t - x[0] * 0.006))
ans = 1
for i in range(0, n):
    if mini > abs(a - (t - x[i] * 0.006)):
        mini = abs(a - (t - x[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()))
count = 10**9
ans = 0
for i in range(N):
    aveT = abs(A- (T - 0.006 * H[i]))
    if count >= aveT:
        count = aveT
        ans = i+1
print(ans)

Submission status: Accepted

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

t=[T]*N

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
j=0
N=int(input())
T, A=input().split()
#S=input()
#T=input()
#S_list=list(S)
h_list=  list(map(int, input().split(" ")))
#M=int(input())
#drink_list = [list(map(int, input().split(" ")))for i in range(M)]
#print(T_list[1])
T=int(T)
A=int(A)
#不本意だが内包表記で二次元の空のリストを作成する
     
#dp=[['' for i in range(2)] for j in range(N)]
absTH=[''for i in range(N)]
#K=int(K)
#S_list=[]
sentence_list=[]
#total=0
#mojiretu=""
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
#for i in range(K):
# ID_list.append(i+1)
#print(ID_list)
#for i in range(H)
#この下の行が二次元リストの読み込
#intを消して記号を読み込めるようにしたしかしこれでは文字列から読み込んでいるのと同じ
#weight_value_list =  [list(input())for i in range(N)]#一文字づつばらして入れてしまう
#s = [input() for i in range(N)]
#複数行に複数の入力値を取得し、出力する
#sentence_list =  (list(input())for i in range(N))
#for i in range(H):
#  ppixel_list=list(input())
    
#print(pixel_list)
#high_pixel_list =[['' for i in range(W)]for j in range(2*H)]
#print(high_pixel_list)
#print(pixel_list[0][1])#行　列の順番にかっこが並んでいる
#print(a_list)
first_term=0
second_term=0
#整数二次元配列を読み込む時のやり方
#a_b_c_list =  [list(map(int, input().split(" ")))for i in range(N)]
     
#センテンスを暗記するのではなく、まずinput()を書いて、膨らます感じで記述する。すると#思考の流れ通りに書ける。素晴らしい！
  
     
#x, y = [0]*N, [0]*N#N個の空のリストを作成
#l = list(range(N))#範囲がNのリストを作成する
     
#for i in range(N):
#  x[i], y[i] = map(int, input().split())
#分けて入力する形式を設定することで可読性が高く仕上がっている
#素晴らしいことだ
     
     
distance = 0
#comb = list(itertools.permutations(l))
#prmutation:英語の意味としては順列である
'''p[, r]で
長さrのタプル列、重複なしのあらゆる並びを表す
今回はリストlの重複なしの並び替え順序を新たなリストに収納している
並び方を計算しリストに収納しているイメージ
l[0,1,2]
l[0,2,1]これにもリスト番号が0,1,2と割り振られている
これが全通り入っている
これ作った人はすごい
自分も早く理解したい
'''
#for i in range(0, len(comb)):#i番目のパターンの時を考える。
#  for j in range(0, N-1):#lのリスト番号を読み込み
#    distance += math.sqrt((x[comb[i][j]]-x[comb[i][j+1]])**2 + (y[comb[i][j]]-y[comb[i][j+1]])**2)
'''
各経路の距離を足していき全距離分を経路数
で割れば平均距離が出るので各経路ごとの距離は
不必要と判断されている。
'''
#print(distance/len(comb))
i=0
j=0

#1を選んだとき0,2を選ぶってのがどう実装すべきかわからんかった
#だからここで学ぶ
#2019/1/4参考サイトに見当たらず 　仕方がないのでその場しのぎ
#for i in range(N):
for j in range(N):
    absTH[j]=abs(A-T+0.006*h_list[j])
#print(absTH)
print(absTH.index(min(absTH))+1)
# dp[i+1][j]=max(dp[i][j]+a_b_c_list[i],dp[i][j],dp[i][j])
#リストを一周するようにすればいいのか

Submission status: Accepted

Solution code:
N = int(input())
T = list(int(x) for x in input().split())
H = list(int(y) for y in input().split())
ans = list()
for i in H:
  div = 0
  tem = T[0] - i*0.006
  if tem > T[1]:
    div = tem - T[1]
  else:
    div = T[1] - tem
  ans.append(div)
print(ans.index(min(ans))+1)

Submission status: Accepted

Solution code:
import sys

n = int(input())

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

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

temperature_sub = 0
area_no = 0
temperature_store = 0

for index, item in enumerate(area):
    temperature = t - (item*0.006)
    temperature_sub = abs(a - temperature)

    if index == 0:
        temperature_store = temperature_sub
        area_no = index + 1
    else:
        if temperature_store > temperature_sub:
            temperature_store = temperature_sub
            area_no = index + 1

print("{}".format(area_no))

Submission status: Accepted

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

Submission status: Accepted

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

print(result)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [int(x) for x in input().split()]
req_h = int(-(a-t)/0.006)

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

print(ans+1)

Submission status: Accepted

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
temp=[]
pre=[]
ans=1e3
for i in range(n):
    temp.append(t-h[i]*0.006)
    pre.append(abs(temp[i]-a))
    ans=min(ans,pre[i])
for i in range(n):
    if(ans==pre[i]):
        pri=i
        break
print(pri+1)

Submission status: Accepted

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

Submission status: Accepted

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

dt = []
for h in H:
    x = t - h * 0.006
    dt.append(abs(a - x))
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()))
ans = 10000
minnum = float('inf')
for i in range(N):
  if abs(T-H[i]*0.006-A) < minnum:
    minnum = abs(T-H[i]*0.006-A)
    ans = i+1
print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    t, a = map(int, input().split())
    hs = list(map(int, input().split()))
    diff = float("inf")
    for i in range(n):
        temp = t - hs[i] * 0.006
        if diff > abs(temp - a):
            diff = abs(temp - a)
            ans = i + 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

A = [abs(a-(t-x*0.006)) for x in h]
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx+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())))

A = list(map(lambda x: abs(a-(t-x*0.006)), h))
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx+1)

Submission status: Accepted

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

ans = -1
exp = 1000000007 
for i in range(n):
  avg = t - H[i] * 0.006
  
  if abs(a - avg) < exp:
    ans = i + 1
    exp = abs(a-avg)

print(ans)

Submission status: Accepted

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

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

print(ans[-1])

Submission status: Accepted

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

x = 0
temp = float('inf')
ans = 0
tmp = 0
for i in range(N):
    x = T - H[i]*0.006
    tmp = abs(x-A)
    if tmp < temp:
        temp = 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する
l = []
for i in range(N):
    a = T - H[i]*0.006
    b = abs(a-A)
    l.append(b)

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

#空のリストの作成方法
#l = []
#l.append(引数)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int,input()
t, a = map(int,input().split())
dic_oA = {}
dic_lA = {}
H = list(map(int,input().split()))
kome = 0

for i in H:
    T = t -i*6/1000
    kome += 1        
    if T >= a:
        dic_oA[kome] = T
    else:
        dic_lA[kome] = T

if len(dic_oA) == 0:
    print(max(dic_lA,key=dic_lA.get))
elif len(dic_lA) == 0:
    print(min(dic_oA,key=dic_oA.get))
else:
    sa_o = min(dic_oA.values())- a
    sa_l = a - max(dic_lA.values())
    if sa_o > sa_l:
        print(max(dic_lA,key=dic_lA.get))
    else:
        print(min(dic_oA,key=dic_oA.get))

Submission status: Accepted

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

temp = abs(a - (t - h_list[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(result)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
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()))

ans = -1
diff = float('inf')
for i, h in enumerate(H, 1):
  dt = abs(T-h*0.006 - A)
  if dt < diff:
    diff = dt
    ans = i

print(ans)

Submission status: Accepted

Solution code:
import sys
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))
minh = min(h)
for i in range(n):
    if h[i] == minh:
        print(i+1)
        sys.exit()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

    nearest = float('inf')
    nearest_num = 0
    for i in range(N):
        temp = T - H[i] * 0.006
        diff = abs(A-temp)
        if nearest > diff:
            nearest = diff
            nearest_num = i + 1
    
    print(nearest_num)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

mn=10**9
ans=-1
for i in range(n):
        kion = t - (h[i] * 0.006)
        diff = abs(kion-a)
        if diff < mn:
                mn=diff
                ans=i
print(ans+1)

Submission status: Accepted

Solution code:
import numpy as np


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

    H_arr = np.array(H) * 0.006
    H_list = list(abs((T - H_arr) - A))

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

h=[abs(t-i*0.006-a) 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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
ans=1
anst=100000000000
List = list(map(int,input().split()))
for i in range(n):
    if(anst>abs(a-(t-List[i]*0.006))):
        ans=i+1
        anst=abs(a-(t-List[i]*0.006))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t_ = input()
t_ = t_.split(" ")
t_ = list(map(int, t_))
a_d = t_[0]
t_d = t_[1]

s = input()
s = s.split(" ")
s = list(map(int, s))


ans_list = []

for v in range(n):
    ans = a_d - s[v] * 0.006 - t_d
    ans = abs(ans)
    ans_list.append(ans)
ans_ = ans_list.index(min(ans_list))

print(ans_+1)

Submission status: Accepted

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

temp=[T-H[i]*0.006 for i in range(N)]
ans=[abs(temp[i]-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()))

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

Submission status: Accepted

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


arr = []
for i in range(n):
    arr.append(t - h[i]*0.006)

diff = []
for i in range(n):
    diff.append(abs(arr[i] - a))

index = -1
m = 10**12
for i in range(n):
    if m >= diff[i]:
        m = diff[i]
        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()))

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

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

Submission status: Accepted

Solution code:
import math
import itertools
import statistics
#n = int(input())
n = int(input())
t, a = list(map(int, input().split()))
h =  list(map(int, input().split()))

m = 100000
min_index = -1
for i in range(n):
    tem = t-h[i]*0.006
    if abs(a-tem) < m:
        m = abs(a-tem)
        min_index = i

print(min_index+1)

Submission status: Accepted

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

ans_num = 1
ans_para = h[0]
for i, r in enumerate(h):
    deg = t - (r * 0.006)
    ans_para_deg = t - (ans_para * 0.006)
    if abs(a - ans_para_deg) >= abs(a - deg):
        ans_para = r
        ans_num = i+1
print(ans_num)

Submission status: Accepted

Solution code:
#ABC113

n = int(input())
t,a = list(map(int,input().split()))
h = list(map(int,input().split()))
l = [abs(t - h[i]*0.006-a) for i in range(n)]

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


def celsius(x: int) -> float:
    return T - x * 0.006


ans = list(map(lambda h: abs(celsius(h) - A), H))
print(ans.index(min(ans)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
t,a=map(int,input().split())
h=list(map(int,input().split()))
s=[]
for x in h:
    T=t-x*0.006
    s+=[abs(T-a)]
print(s.index(min(s))+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()))
def high(h):
  return T - h*0.006
min_h = 10**4
ans = 0
for i, h in enumerate(H):
  if min_h > abs(A-high(h)):
    min_h = abs(A-high(h))
    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=float('inf')
l=0
for i in range(n):
    tmp=abs(a-(t-h[i]*0.006))
    if tmp<ans:
        l=i+1
    ans=min(ans,tmp)
print(l)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
cal=(t-a)/0.006
tmp=abs(cal-l[0])
pl=1
for i in range(1,n):
  if tmp>abs(cal-l[i]):
    pl=i+1
    tmp=abs(cal-l[i])
print(pl)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())
#x = (A-T)/0.006
diff = float("inf")
ret = 0
for i,h in enumerate(H):
  if abs(T-h*0.006-A) < diff:
    diff = abs(T-h*0.006-A)
    ret = i
print(ret+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
b=[]
for hh in h:
  b.append(abs(t-hh*0.006-a))
c=min(b)

print(b.index(c)+1)

Submission status: Accepted

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
m = dlist[0]
  
for i in range(1,n):
    if dlist[i-1] <= dlist[i]:
        if dlist[i-1] <= m:
            m = dlist[i-1]
        else:
            pass
    else:
        if dlist[i] <= m:
          	m = dlist[i]
        else:
          pass

        
print(dlist.index(m) + 1)

Submission status: Accepted

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
m = min(dlist)
        
print(dlist.index(m) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

min_dif = 99999999999999999
min_pt = 0
for i, h in enumerate(H):
  dif = abs(A - (T - h*0.006))
  if dif < min_dif:
    min_pt=i+1
    min_dif = dif
    
print(min_pt)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    t,a=INTM()
    hs=LIST()
    ct=0
    ans=100000000000
    for i,h in enumerate(hs):
        temp=t-h*0.006
        #print(temp)
        if abs(a-ans)>=abs(a-temp):
            ans=temp
            ct=i
    print(ct+1)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
minval=10**5
ans=0
for i in range(N):
    val=abs(A-(T-H[i]*0.006))
    if val<minval:
        minval=val
        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 = -1
best_diff = 10 ** 5
for idx, hi in enumerate(H):
    t = T - (hi * 0.006)
    diff = abs(A-t)
    if diff < best_diff:
        best_diff = diff
        ans = idx+1
print(ans)

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


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


n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
# print(h)
ans = []
for i in range(n):
    ans.append(t-h[i]*0.006)
# print(ans)
x = 10000
cnt = 0
for i in range(n):
    if abs(ans[i]-a) < x:
        cnt = i+1
        x = abs(ans[i]-a)
print(cnt)

Submission status: Accepted

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

ans = 0
ondosa = float("inf")
for i in range(n):
    if abs(a - (t - 0.006*h_lst[i])) < ondosa:
        ondosa = abs(a - (t - 0.006*h_lst[i]))
        ans = i

print(ans + 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()]

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