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 = list(map(int, input().split()))
hs = list(map(int, input().split()))

min_diff = 100000
min_index = -1
for i, h in enumerate(hs):
    cut_t = t - h * 0.006
    if abs(cut_t - a) < min_diff:
        min_index = i
        min_diff = abs(cut_t - a)
print(min_index + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
ans = None; v = 10**18
for i, h in enumerate(H):
    w = abs(A*1000 - T*1000 + 6*h)
    if w < v:
        v = w
        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()))

mindiff = 1e9
ans = -1

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

Submission status: Accepted

Solution code:
n = input()
t,a = map(int,raw_input().split())
arr = map(int,raw_input().split())
val = 10**20
ind = -1
for i in range(n):
	z = t-arr[i]*.006
	if abs(z-a) < val:
		ind = i+1
		val = abs(z-a)
print ind

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getN():
    return int(input())


def getNM():
    return map(int, input().split())


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

n =getN()
t, a = getNM()
high = getList()

diff = 100000000
for i, h in enumerate(high):
    temp = t - h*0.006
    if abs(temp-a) < diff:
        ans = i
        diff = abs(temp-a)


print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
t,a = map(int, input().split())
h = [int(x) for x in input().split()]

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

ret = -1
diff = 10**5
for i in range(n):
    ht = temp(h[i])
    if abs(a-ht)<diff:
        diff = abs(a-ht)
        ret = i+1
print(ret)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
N = int(input())
T, A = inpl()
H = inpl()
good = 1e9
ans = 0
for i in range(N):
    temp = abs(A - (T - 0.006*H[i]))
    if good > temp:
        good = temp
        ans = i + 1

print(ans)

Submission status: Accepted

Solution code:
from fractions import Fraction

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

v = float('inf')
x = -1

for i in xrange(N):
    vv = T - H[i] * Fraction(6, 1000)
    vvv = abs(A - vv)
    if vvv < v:
        v = vvv
        x = i

print x + 1

Submission status: Accepted

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

n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ans = [(abs(t-h[i]*0.006-a), i) for i in range(len(h))]
print(sorted(ans)[0][1]+1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


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


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, T, A, H):

    tmp = []
    for i, h in enumerate(H):
        tmp.append((abs(A-(T-h*0.006)), i))
    return min(tmp)[1] + 1


def main():
    N = read_int()
    T, A = read_int_n()
    H = read_int_n()
    print(slv(N, T, A, H))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()
t,a = map(float,raw_input().split())
l = map(float,raw_input().split())
ans = abs(t-0.006*l[0]-a)
index = 1
for i in xrange(1,n):
	x = abs(t-0.006*l[i]-a)
	if x < ans:
		ans = x
		index = i+1
print index

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
h = list(map(int,input().split()))
dist = 10**6
ans = -1
c = 0.006
for i in range(N):
    if abs(T-c*h[i]-A) < dist:
        dist = abs(T-c*h[i]-A)
        ans = i+1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
arr=list(map(int,input().split()))
ans=10**18
ans1=-1
for i in range(len(arr)):
    val=t-(arr[i]*.006)
    if(abs(val-a)<ans):
        ans=abs(val-a)
        ans1=i
print(ans1+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

n = ni()
t,a = li()
h = list(li())

temp_list = []

for i in range(n):
    temp_list.append(t - h[i]*0.006)
 
ans = 10**18
for j, temp in enumerate(temp_list):
    if abs(a-temp) < ans:
        point = j
        ans = abs(a-temp)
        
print(point+1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

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

ans = 0
cost = INF
for i in range(N):
    if abs(T - H[i] * 0.006 - A) < cost:
        cost = 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())
ans, at = 0, float('inf')
for i, h in enumerate(map(int, input().split())):
    tt = abs(t - h * 0.006 - a)
    if at > tt:
        ans = i + 1
        at = tt
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t,a = (int(i) for i in input().split())
x = [t-int(i)*0.006 for i in input().split()]
m = float("inf")
for i in range(n):
	if m>abs(a-x[i]): m,k = abs(a-x[i]),i+1
print(k)

Submission status: Accepted

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

result = 0
rd = 100000000000000000000000

for i, x in enumerate(H):
    t = T - 0.006 * x
    d = abs(A - t)
    if d < rd:
        rd = d
        result = i + 1

print(result)

Submission status: Accepted

Solution code:

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

min_dis = 10**9
ans = -1
for i in range(N):
    d = abs(A-(T-H[i]*0.006))
    if min_dis>d:
        ans=i+1
        min_dis = d

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(i) for i in input().split()]
CT, Ans = float("inf"), 0
for i in range(N):
    Av = T - H[i] * 0.006
    if CT > abs(Av - A):
        CT, Ans = abs(Av-A), i
print(Ans+1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
temp = []
for i in h:
    temp.append(t - i*0.006)
m = float('inf')
ans = 0
for i,j in enumerate(temp):
    if m > abs(j-a):
        m = abs(j-a)
        ans = i
print(ans+1)

Submission status: Accepted

Solution code:
from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]

n = int(input())
t, a = il()
h = il()
mint = 10000000
for cnt, i in enumerate(h):
    if abs(a- (t - i * 0.006)) < mint:
        mint = abs(a- (t - i * 0.006))
        ans = cnt+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

z = float('inf')
zi = -1
for i, hi in enumerate(h):
    ti = t - hi*0.006
    if abs(a-ti) < z:
        z = abs(a-ti)
        zi = i+1
print(zi)

Submission status: Accepted

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

TEMP=[(abs((T-H[i]*0.006)-A),i+1) for i in range(N)]

print(min(TEMP)[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-h*0.006))for h in H]
print(X.index(min(X)) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

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

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

best = -99999999999
arg = -1
for i in range(n):
    tt = t - h[i]*0.006
    if abs(tt-a) < abs(best-a):
        best = tt
        arg = i+1
print(arg)

Submission status: Runtime Error

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

diff = []
for i in H:
	diff.append(abs(A-T+i*0.006))

diffmin = diff[0]
ans = 0
for i in range(N):
	if diffmin > diff[i]:
		diffmin = diff[i]
			ans = i
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = np.array(input().split(), dtype="int")[:2]
H = [int(i) for i in input().split()]
    
min_dif = 10000
place = 0
for i in range(N):
  temp = T - H[i] *0.006
  dif = abs(A-temp)
        
  #誤差の最小値(→候補地も更新)
  if min_dif >= dif:
    min_dif = dif
    place = i+1
    
print(place)

Submission status: Runtime Error

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

counter = 0
diff = abs(a - (t - h[0] * 0.006))

for x in h:
    average_temple = t - x * 0.006
    counter += 1
    if diff > abs(a - average_temple):
        poss = counter

print(poss)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[0]==abs(c-(b-l[0]*0.006))
for i in range(a):
  if l[i]==min.l
  print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int,input().split())
beta = 0.006
H = list(map(int,input().split()))
import numpy as np 
H = np.array(H) 
use = t - beta * H - a 
use = use**2 
pre_answer = min(use) 
ans = 1 + use.index(pre_answer) 
print(ans)

Submission status: Runtime Error

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

x = []

for i in h:
    b = t - 0.006 * j - a
    x.append(b)

print(x.index(min(x)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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-x*6/1000)))
print(l.index(min(l))+1)

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
X=10000
Y=1
for i in range(N):
  H[i]=T-H[i]*6/1000
for i in range(N):
  if abs(H[i]-A)<X:
    X=abs(H[i]-X)
    Y+==i
print(Y)

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
H=list(map(int,inpt().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
H=list(map(int,inpt().split()))
minn=10**10
for i in range(n):
  if minn>t*(1000)-6*H[i]:
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+h[i]*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

dif_list = []
answer = 0

for i in range(n):
    t_i = t - list(i) * 0.006
    t_i_dif = abs(a - t_i)
    dif_list.append(t_i_dif)
    if min(dif_list) == t_i_dif:
        answer = i + 1

print(answer)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
min=T
index=0

for i in range(N):
  if(min>abs(T-0.006*mylist[i])):
    min=mylist
    index=i
print(index)

Submission status: Runtime Error

Solution code:
N¥N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
a =[]
def cal(n):
  ans = T-n*0.006
  return ans
  
for i in H:
  a.append(int(abs(A-cal(i))))
  
print(a.index(min(a))+1)

Submission status: Runtime Error

Solution code:
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 110
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        list.append(abs(c-a))
        if min > abs(c-a):
            min=abs(c-a)
    print(list.index(min)+1)

Submission status: Runtime Error

Solution code:
if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 110
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        list.append(abs(c-a))
        if min > abs(c-a):
            min=abs(c-a)
    print(list.index(min)+1)

Submission status: Runtime Error

Solution code:
a = int(input())
x  = 0
lists = []
ass =[]
#bが気温c、standardが平均気温の基準
b,standard = map(int,input().split())
#標高
elev = list(map(int,input().split()))

for i in range(a):
    lists.append(abs(b - elev[i] * 0.006 - standard))

m = min(lists)
mindex = lists.index(1.0)
print(mindex + 1)

Submission status: Runtime Error

Solution code:
a = int(input())
x  = 0
lists = []
ass =[]
#bが気温c、standardが平均気温の基準
b,standard = map(int,input().split())
#標高
elev = list(map(int,input().split()))

for i in range(a):
    lists.append(abs(b - elev[i] * 0.006 - standard))
    print(lists)

m = min(lists)
mindex = lists.index(1.0)
print(mindex + 1)

Submission status: Runtime Error

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

for height in l:
  deltatemperature.append(abs(T- height* 0.006- A))
  
m = min(deltatemperature)
mindex = l.index(m)
print(mindex+ 1)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))
count = 1
ss = 1000000000
ans = 0
for h in hl:
    if t-h*0.006-a >= 0:
        if float(t-h*0.006-a) < ss:
            ans = count
            count+=1
        else:
            count+=1
    else:
        if float(-t+h*0.006+a) > -ss:
            ans = count
            count+=1
            count+=1
        else:

print(ans)

Submission status: Runtime Error

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n = i_input()
    t, a = i_map()
    num_list = i_list()

    abs_num = INF
    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

min_val = 10000

for i in range(len(H)):
    tmp = T - H[i] * 0.006
    sub = abs(tmp - A)
    if min_val > sub:
        ans = i
        min_val = sub2


print(ans+1)

Submission status: Runtime Error

Solution code:
import math

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

    ans = 0
    temp = math.inf
    for i in range(n):
        if temp > abs(a - (t - h[i] * 0.006)):
            temp = abs(a - (t - h[i] * 0.006))
            ans = i + 1
        
    print(ans)

main()

Submission status: Runtime Error

Solution code:
N = input()
T, A = map(int, input().split())
temperatures = list(map(int, input().split()))
 
r = 50000000
results = ''
 
list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      

    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Runtime Error

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

r = 50000000
results = ''

list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):
  	if avg_temp < 0:
      	avg_temp = avg_temp * -1
      
    ondo_sa = A - avg_temp
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Runtime Error

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

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

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

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
h = list(map(int,input().split()))
a = int(input())
def getNearestValue(h, a):
	idx = np.abs(np.asarray(h) - a).argmin()
	return h[idx]
print(getNearestValue(h, a))

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int,input().split()))
a = int(input())
def getNearestValue(h, a):
	idx = np.abs(np.asarray(h) - a).argmin()
	return h[idx]
print(getNearestValue(h, a))

Submission status: Runtime Error

Solution code:
n = int(input())
h = list(map(int,input().split()))
a = int(input())
def getNearestValue(h, a):
	idx = np.abs(np.asarray(h) - a).argmin()
	return h[idx]
getNearsest(h, a)

Submission status: Runtime Error

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

ans = 1
mn = np.inf
for i, h in enumerate(H):
    if mn > abs(A - (T - h * 0.006)):
        ans = i+1
        mn = abs(A - (T - h * 0.006))
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int, input().split())
H = list[input()]
judge = abs(A - (T - 0.006*H[0]))
k = 0

for i in range(N):
  a = abs(A - (T - 0.006*H[i]))
  if judge > a:
    judge = a
    k = i
    
print(k)

Submission status: Runtime Error

Solution code:
option = int(input())
ref_t, tmp_id = int(input().split())
height = list((int(n) for n in input().split()))

ave_t = []
for i in range(option):
  ave_t.append(abs(tmp_id - (ref_t - height[i] * 0.06)))

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

Submission status: Runtime Error

Solution code:
option = int(input())
ref_t, tmp_id = int(input().split())
height = (int(n) for n in input().split())

ave_t = []
for i in range(option):
  ave_t.append(abs(tmp_id - (ref_t - height[i] * 0.06)))

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

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=map(int, input().split())
list=list(map(int, input().split()))
l_b=[]
d=0
for i in range(N):
  d=A-(T-list[i]*0.006)
  if d<0:
    d=-d
  l_b.append(d)
print(l_b.index(min(l_b))+1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
for i in range(len(a)):
    if abs(T-0.006*a[i]-A) <= min_val:
        min_val = abs(T-0.006*a[i]-A)
        min_num = i
print(min_num+1)

Submission status: Runtime Error

Solution code:
input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
for i in range(len(a)):
    print("min_val={}".format(min_val))
    if abs(T-0.006*a[i]-A) <= min_val:
        min_val = abs(T-0.006*a[i]-A)
        min_num = i
print(min_num+1)

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
ans = float('inf')
for h in H:
  if abs(t-ans*0.006) > abs(t-ans*0.006):
    ans = h
print(H.index(ans)+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input()) - 1
T,A = map(int,input().split())
tmp = 0
X = 0
List = list(map(int,input().split()))
List2 = []
for i in range(N):
  tmp =abs(A - (T - List.pop(i) * 0.001))
  List2.append(tmp)
X = min(List2)
print(str(List2.index(X) + 1))

Submission status: Runtime Error

Solution code:
N = int(input()) - 1
T,A = map(int,input().split())
tmp = 0
X = 0
List = list(map(int,input().split()))
List2 = []
for i in range(N):
  tmp =abs(A - (T - List.pop(i) * 0.001))
  List2.append(tmp)
X = min(List2)
print(List2.index(X) + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
s = input()
src = s.split("\n")

numberOfPlace = int(src[0])
standardTemparature, bestTemparature = tuple(src[1].split(" "))
placeList = src[2].split(" ")

temparetureDifferencesList = list(map(lambda evelation: int(standardTemparature) - ( int(evelation) * 0.006 )), placeList)
theBestPlace = temparetureDifferencesList.sort()[0]

print(theBestPlace)

Submission status: Runtime Error

Solution code:
s = input()
src = s.split("\n")

numberOfPlace = int(src[0])
standardTemparature, bestTemparature = tuple(src[1].split(" "))
placeList = src[2].split(" ")

temparetureDifferencesList = list(map(lambda evelation: standardTemparature - ( evelation * 0.006 )))
theBestPlace = temparetureDifferencesList.sort()[0]

print(theBestPlace)

Submission status: Runtime Error

Solution code:
using System;
using System.Linq;
using System.Collections.Generic;
public class B{
    public static void Main(){
        int n = int.Parse(Console.ReadLine());
        double[] ta = Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        double t = ta[0]; double a = ta[1];
        List<double> h = Console.ReadLine().Split(' ').Select(double.Parse).ToList();
        
        for (int i = 0;i<n;i++){
            h[i]*=-0.006; h[i] += t;
        }
        
        double diff = 10000;
        int ans = -1;
        for (int i = 0;i<n;i++){
            if (diff > a-h[i] & diff > h[i]-a){
                ans = i;
                diff = Math.Abs(a-h[i]);
            }
        }
        
        Console.WriteLine(ans+1);
    }
}