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: Wrong Answer

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

Submission status: Wrong Answer

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):
    if abs(A-(T-H[i]*0.006)) < (A-(T-H[i-1]*0.006)):
        ans = i
    else:
        ans = i-1
print(ans+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

print(ans + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

diff = 1000
index = 0

for i in range(N):
  tmp = abs(T - H[i]*0.006)
  if diff > tmp:
    diff = tmp
    index = i + 1
    
print(index)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
T, A = MAP()
H = LIST()

tmp = [T-x*0.006 for x in H]
# print(tmp)
y = 100000000
i_tmp = 0
for i, data in enumerate(tmp):
	if abs(data - T) < y:
		y = abs(data - T)
		i_tmp = i+1

print(i_tmp)

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
T, A = MAP()
H = LIST()

tmp = [int(T-x*0.006) for x in H]
y = 100000000
i_tmp = 0
for i, data in enumerate(tmp):
	if abs(data - T) < y:
		y = abs(data - T)
		i_tmp = i+1

print(i_tmp)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = input().split()
T = int(T)
A = int(A)
H = [int(x) for x in input().split()]
t = [int(y) for y in range(N)]
a = [int(z) for z in range(N)]
for i in range(N):
  t[i] = T - 0.006*H[i]
  a[i] = abs(t[i]-A)
print(a.index(max(a)))

Submission status: Wrong Answer

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

diff_T = [abs(T-h*0.006-A) for h in Hs]
print(diff_T.index(min(diff_T)))

Submission status: Wrong Answer

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

diff_T = [abs(T-h*0.006) for h in Hs]
print(diff_T.index(min(diff_T)))

Submission status: Wrong Answer

Solution code:
a = int(input())
b, c = map(int, input().split())
A = list(map(int, input().split()))
print(A)
tem = 0
st = 0
st2 = 0
for i in range(a):
    tem = c-(b-A[i]*0.006)
    tem = abs(tem)
    if i == 0:
        st = tem
    else:
        if st < tem:
            st = st
        else:
            st = tem
            st2 = i
print(st2+1)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = int(input())
T,A = inpl()
HH = inpl()

temp = [T-0.006*H for H in HH]
temp.sort()

ans = -1
MIN = INF
for i,t in enumerate(temp):
    if MIN > abs(t-A):
        ans = i
        MIN = abs(t-A)
print(ans+1)

Submission status: Wrong Answer

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

min_diff = 100000
counter = 0
for i in range(N):
    diff = abs(A - T + H[i] * 0.006)
    if diff < min_diff:
        counter = i + 1

print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
Hi = []
for i in H:
    Hi.append(abs(a-(t-i*0.006)))
Hi = sorted(H)
ans = H.index(Hi[0])+1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

place = -1
gap = 1000

for i in range(N):
    tmp = T - H[i]*0.006
    if gap > abs(A-tmp):
        gap = abs(A-tmp)
        place = i

print(i)

Submission status: Wrong Answer

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

place = -1
gap = 1000

for i in range(N):
    tmp = T - H[i]*0.006
    if gap > A-tmp:
        gap = A-tmp
        place = i

print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
T,A = map(int,input().split())
H = list(map(lambda x :  abs(T - int(x)*0.006) , input().split()))
print(H.index(min(H)) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 - H * 0.006
ans = np.abs(A - H)
ans = np.where(ans == ans.min())[0][0]

print(ans)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np
from copy import deepcopy

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

var = float('inf')
idx = 1
for i in range(len(H)):
  if (abs(T-A-0.0006*H[i]) < var):
    var = abs(T-A-0.0006*H[i])
    idx = i
    
print(int(idx+1))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(N: int, T: int, A: int, H: "List[int]"):
    d = float('inf')
    ret = 0
    for i, h in enumerate(H):
        if abs(A - T - h * 0.006) < d:
            ret = i
            d = abs(A - T - h * 0.006) 
    return ret + 1


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]"
    result = solve(N, T, A, H)
    print(result)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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(int(t-h[i]*0.006-a))
print(h.index(min(h))+1)

Submission status: Wrong Answer

Solution code:
from operator import itemgetter

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

L = []
for i in range(N):
    L.append([i+1,abs(T-H[i]*0.006)])
L = sorted(L, key=itemgetter(1))

print(L[0][0])

Submission status: Wrong Answer

Solution code:
## ABC113B - Palace
n = int(input())
t, a = list(map(int, input().rstrip().split()))
data = list(map(int, input().rstrip().split()))

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

Submission status: Wrong Answer

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

minH = min(H, key=lambda h:abs(A - T - h * 0.006))
print(H.index(minH) + 1)

Submission status: Wrong Answer

Solution code:
def temp(T,A,x):
    return abs(12 - (T - x * 0.006))
N = input()
T, A = map(int, input().split())
H = list(map(int, input().split()))

m = temp(T,A,H[0])
idx = 1
for i in range(1,len(H)):
    if m > temp(T,A,H[i]):
        m = temp(T,A,H[i])
        idx = i + 1

print(idx)

Submission status: Wrong Answer

Solution code:
def temp(T, x, A):
    return abs(A - int(T - x * 0.006))

N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
m = abs(temp(T,H[0], A))
idx = 1
for i in range(len(H)):
    if(temp(T,H[i], A) < m):
        m = temp(T, H[i],A)
        idx = i + 1
print(idx)

Submission status: Wrong Answer

Solution code:
def temp(T, x):
    return int(T - x * 0.006)

N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
m = abs(A - temp(T,H[0]))
idx = 0
for i in range(len(H)):
    if(abs(A - temp(T,H[i]) < m)):
        m = abs(A - temp(T, H[i]))
        idx = i + 1
print(idx)

Submission status: Wrong Answer

Solution code:
#coding:UTF-8
num = int(input())
s = input()
ss = s.split(" ")
t = int(ss[0])
a = int(ss[1])
high = input()
high_list = high.split(" ")
calc_list = list()
for i in range(num):
  high_work = int(high_list[i])
  work = t-high_work*0.006
  calc_list.append(abs(a-work))
print(calc_list)
print(calc_list.index(min(calc_list))+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tmp = 1000000
ans = 0
h.sort(reverse = True)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys

diff = sys.maxsize
ans = ""

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

for i in range(0, N):
    t = T - H[i] * .006
    d = abs(T - t)
    if diff > d:
        ans = i + 1
        diff = d

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
N = map(int, input().split())
i = 9999
j = 1
for ids,k in enumerate(N):
  if abs(A - (T - k * 0.006)) < i : 
    i = abs(A - (T - k * 0.006))
    j = ids

print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
minH = min(H)
print(H.index(minH) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))
best_sub = 100000
ans = -1
for i, h in enumerate(hs):
    t_ = t - h * 0.006
    if abs(a - t_) < best_sub:
        best_sub = (a - t_)
        ans = i + 1
print(ans)

Submission status: Wrong Answer

Solution code:
def elev(t, n):
    return int(t - n * 0.006)

n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
elev_l = []
ans_l = []

for i in range(n):
    ans = elev(t, h[i])
    elev_l.append(ans)

for j in elev_l:
    ans_l.append(abs(a - j))

num = min(ans_l)
print(ans_l.index(num) + 1)

Submission status: Wrong Answer

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

sa = []

for i in df:
    b = t - i * 0.006
    b = int(b)
    c = abs(b - a)
    sa.append(c)
    
x = sa.index(min(sa)) + 1
print(x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
def abs(k,l):
  if k>l:
    return k-l
  else:
    return l-k  
b=20000313
cnt=0
for i in range(n):
  if b>abs(a,t-0.006*h[i]):
    b=t-0.006*h[i]
    cnt=i
  else:
    b=b
    cnt=cnt
print(cnt+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

res = [abs(A - j) for j in tmp]
print(res.index(min(res)) + 1)

Submission status: Wrong Answer

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

min_diff_t = 10e6
ans = 0

for i, e in enumerate(h):
    d = abs(a - (t - 0.006 * e))

    if d < min_diff_t:
        ans = i + 1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Ts = list(map(lambda x: T-x * 0.006, Hs))

i = 0
v = None
for _i, _T in enumerate(Ts):
    if v is None or abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)

Submission status: Wrong Answer

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

Ts = list(map(lambda x: T-x * 0.006, Hs))

i = 0
v = None
for _i, _T in enumerate(Ts):
    print(v)    
    if v is None or abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split(' '))
H = [int(h) for h in input().split(' ')]
#　平均気温がAに最も近い場所の温度
best_place = -float('inf')
#A点に最も近い場所の地点
point = 0
for i,x in enumerate(H):
  TEM = T-x*0.006
  if abs(A-best_place)> abs(A-TEM):
    point = i
    best_place = TEM
print(i+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
sa=10*6
ans=0
for hi,hk in enumerate(h):
    if abs(t-hk*0.006-a)<sa:
        ans=hi
print(ans)

Submission status: Wrong Answer

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

xtemp = [T - H[_] * 0.006 for _ in range(N)]

mini = 0
index = 0
for i, _ in enumerate(xtemp):
    if _ < 0:
        _ = A + _
        if i == 0:
            mini = _
        if _ > mini:
            index = i
            mini = _
    else:
        _ = A - _
        if i == 0:
            mini = _
        if _ < mini:
            index = i
            mini = _

print(index+1)

Submission status: Wrong Answer

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

def diff(i, num, mini, A):
    num = A - num
    if i == 0:
        mini = num
    if num < mini:
        return i, num
    else:
        return -1, mini

xtemp = [T - H[_] * 0.006 for _ in range(N)]

mini = 0
index = 0
for i, _ in enumerate(xtemp):
    if _ < 0:
        index, mini = diff(i, _, mini, A)
    else:
        i, mini = diff(i, _, mini, A)
        if i != -1:
            index = i

print(index+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

delta = abs(T-H[0]*0.006-A)
ans = 0

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

dif = []

for i, h in enumerate(H):
  temp = int(T - h*0.006)
  diff = abs(A - temp)
  dif.append([dif, i+1])

dif = sorted(dif)

print(dif[0][1])

Submission status: Wrong Answer

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

ht = []

for i in h:
    ht.append(abs(a-t-i*0.006))

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

Submission status: Wrong Answer

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

temp_list=[]

for h in h_list:
	temp_list.append(abs(t-h*0.006-a))

print(temp_list.index(min(temp_list)))

Submission status: Wrong Answer

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

temp_list=[]

for h in h_list:
	temp_list.append(abs(a-t-h*0.006))
print(temp_list.index(max(temp_list)) + 1)

Submission status: Wrong Answer

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

temp_list=[]

for h in h_list:
	if a >= 0:
		temp_list.append(t-h*0.006-a)
	else:
		temp_list.append(t-h*0.006+a)
print(temp_list.index(max(temp_list)) + 1)

Submission status: Wrong Answer

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

temp_list=[]

for h in h_list:
	temp_list.append(t-h*0.006-a)

print(temp_list.index(max(temp_list)) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d = float("inf")
ans = 0
for i in range(n):
    di = a - (t - h[i]*0.006)
    if di < d:
        d = di
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = map(int, input().split())
H = np.array(list(map(int, input().split())))
H = T - 0.006*H - A
H = np.abs(H)
print(np.argmin(H))

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = map(int, input().split())
H = np.array(list(map(int, input().split())))
meanx = (T - A)/0.006
H = H - meanx
H = np.abs(H)
print(np.argmin(H))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
ans=200
for i in range(N):
  if ans>abs((T-H[i]*0.006)-A):
    ans=abs((T-H[i]*0.006)-A)
print(int(ans))

Submission status: Wrong Answer

Solution code:
n=int(input());t,a=map(int,input().split());t=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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
ans=10**18
n=int(input())
t,a=map(int,input().split())
for i in map(int,input().split()):
  b=t-i*0.006
  if abs(ans-a)>abs(b-a):
    ans=b
    
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
h = 100000
a = 0
for i in range(N):
    if H[i] < h:
        h = H[i]
        a = i+1
print(a)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

temp = list(map(lambda x: T - x*0.006, height))
print(height)
print(temp)

def getNearesValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

print(temp.index(getNearesValue(temp, A)) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int , input().split())
l = list(map(int , input().split()))
print(l.index(min(l))+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import exit
N = int(input())
T,A = [int(n) for n in input().split()]
H = [int(n) for n in input().split()]
mnear = 0
mint = (1 << 20)
for i in range(N):
    if abs(A - (T - H[i]*0.006)) < mint:
        mint = abs(A - (T - H[i])*0.006)
        mnear = i

print(mnear+1)
exit()

Submission status: Wrong Answer

Solution code:
from sys import exit
N = int(input())
T,A = [int(n) for n in input().split()]
H = [int(n) for n in input().split()]
# a = [int(input()) for _ in range(N)]
# S = str(input())
# L = len(S)
# T = str(input())
mnear = 0
mint = (1 << 20)
for i in range(len(H)):
    if abs(A - (T - H[i])*0.006) < mint:
        mint = abs(A - (T - H[i])*0.006)
        mnear = i



print(mnear+1)
exit()

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
Hs = list(map(int,input().split()))
ts = []
for H in Hs:
    ts.append(T - H * 0.006)
min_t = -10**6
min_idx = 0
for idx, t in enumerate(ts):
    print(idx)
    if abs(t - A) > min_t:
        min_idx = idx
print(min_idx+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
m=abs(int(t-l[0]*0.006)-a)
k=0
for i in range(1, len(l)):
  if abs(int(t-l[i]*0.006)-a)<m:
    m=abs(int(t-l[i]*0.006)-a)
    k=i

print(k+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(x) for x in input().split()]
H = list(map(int, input().split()))
min = 100000
result = 0

for i in range(N):
    if abs(A - (T-H[i]*0.006)) < min:
        min = abs(A - (T-H[i]*0.006))
        result = i

print(result)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h=list(map(lambda x:t-x*0.006-a,h))
print(h.index(max(h))+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h=list(map(lambda x:t-x*0.006-a,h))
print(h.index(min(h))+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
h=list(map(lambda x:x*0.006-t,h))
print(h.index(min(h))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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