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()))
import math
num=[]
ans=10**5
for i in range(n):
    num.append(t-0.006*h[i])
for i in range(n):
    diff=abs(num[i]-a)
    if diff<ans:
        ans=diff
        tmp=i
print(tmp+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = map(int, input().split())
mi = float('inf')
for i, x in enumerate(H):
  d = abs(A - (T - 0.006 * x))
  if d < mi:
    ans = i + 1
    mi = d
print(ans)

Submission status: Accepted

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: Accepted

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(A-(T - H[i]*0.006))
  if diff > tmp:
    diff = tmp
    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()))

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

print(index)

Submission status: Accepted

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 - A) < y:
		y = abs(data - A)
		i_tmp = i+1

print(i_tmp)

Submission status: Accepted

Solution code:
import sys
import 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()))

def update(bit,i, dp):
    bit[i] = dp
    return bit

def query(bit, i):
    lis = [bit[j] for j in range(i)]
    return max(lis)


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

n = INT()

T,A = MAP()
h = LIST()

ans = [INF, INF]
sa=INF

for i, x in enumerate(h):
    if abs(A - T + x * 0.006) < sa:
        ans = [i + 1, x]
        sa=abs(A - T + x * 0.006)

print(ans[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
temp=[]
for k in range(N):
    t=abs(A-(T-0.006*H[k]))
    temp.append(t)

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

Submission status: Accepted

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

min_diff_temperature = 600
min_diff_remparature_i = -1
for i in range(N):
    temperature = T - H[i] * 0.006
    if abs(temperature-A) < min_diff_temperature:
        min_diff_remparature_i = i
        min_diff_temperature = abs(temperature-A)

print(min_diff_remparature_i + 1)

Submission status: Accepted

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

ans = 100000
titen = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

d = 10**9
for i, h in enumerate(H):
    tmp = abs(A - (T - h * 0.006))
    if tmp < d:
        d = 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()))

min=10000
for i in range(n):
  if min >= abs(T-H[i]*0.006-A):
    min = abs(T-H[i]*0.006-A)
    min_i = i+1
print(min_i)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b, c = map(int, input().split())
A = list(map(int, input().split()))
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: Accepted

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

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

ans = 10**20

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

print(cnt)

Submission status: Accepted

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

def f(x):
    return T - x*0.006

ans = 1000
count = 0
for i in range(N):
    y = A - f(H[i])
    y = max(y,-y)
    if y < ans:
        count = i+1
    ans = min(ans,y)

print(count)

Submission status: Accepted

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

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

Submission status: Accepted

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,i] for i,H in enumerate(HH)]
temp.sort()

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

Submission status: Accepted

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
        min_diff = diff

print(counter)

Submission status: Accepted

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

A_dif=[]

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

minimum = min(A_dif)
palace=0

for j in range(N):
    if minimum == A_dif[j]:
        palace = j+1
        break

print(palace)

Submission status: Accepted

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

print(best)

Submission status: Accepted

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)))
Hii = sorted(Hi)
ans = Hi.index(Hii[0])+1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
t = (a - t) * 1000
h = list(map(int, input().split()))
min_val = 10 ** 9
for i, x in enumerate(h):
    if min_val > abs(t + x * 6):
        min_val = abs(t + x * 6)
        ans = i
print(ans + 1)

Submission status: Accepted

Solution code:
N=int(input())
T,A=[int(a) for a in input().split(" ")]
H=[int(a) for a in input().split(" ")]
temps=[abs(T-0.006*h-A) for h in H]
print(min(enumerate(temps), key=lambda t:t[1])[0]+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
dif = 10 ** 10
dif_n = 0

for i in range(len(H)) : 
    if abs(A -(T -0.006 * H[i])) < dif : 
        dif = abs(A -(T -0.006 * H[i]))
        dif_n = i +1
        
print(dif_n)

Submission status: Accepted

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

Submission status: Accepted

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

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

dif = 10 ** 9
for i in range(N):
  if dif > abs(temp(lst[i])-A):
    dif = min(dif, abs(temp(lst[i])-A))
    ans = i

print (ans+1)

Submission status: Accepted

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.index(min(ond))+1)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
yosage = 100000000
ans = 0
for i in range(n):
	hi = abs(a-(t-h[i]*0.006))
	if hi < yosage:
		yosage = hi
		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()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
min = 1000
for i in range(N):
    degree = abs(T-H[i]*0.006-A)
    if degree < min:
        min = degree
        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()))

d = 1000
ans = 0
for i,h in enumerate(H):
    d_ = abs(A-(T-h*0.006))
    if d > d_:
        d = d_
        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()))

place = -1
gap = 1000000

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

print(place+1)

Submission status: Accepted

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

ans, tmp = None, float('inf')
for i in range(N):
    t = T - H[i] * 0.006
    d = abs(A - t)
    if d < tmp:
        ans = i + 1
        tmp = d
print(ans)

Submission status: Accepted

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

x = [abs(A - (T-0.006*h)) 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 = list(map(int, input().split()))

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

print(point)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
x=0
onds=[]
while x<=n-1:
 onds.append(abs(t-0.006*h[x]-a))
 x+=1
m=min(onds)
x=0
while x<=n-1:
 if onds[x]==m:
  print(x+1)
  x+=1
 else:
  x+=1

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return map(int, input_tuple)


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


n = intin()
t, a = intin()
hlist = intina()

minsub = 999999999999999999999999999999999999999
minidx = None
for i, h in enumerate(hlist):
    temp = t - h * 0.006
    if abs(a - temp) < minsub:
        minsub = abs(a - temp)
        minidx = i

print(minidx + 1)

Submission status: Accepted

Solution code:
n = int(input())
ta = input().split()
t = int(ta[0])
a = int(ta[1])
hlist = [int(h) for h in input().split()]


minsub = 999999999999999999999999999999999999999
minidx = None
for i, h in enumerate(hlist):
    temp = t - h * 0.006
    if abs(a - temp) < minsub:
        minsub = abs(a - temp)
        minidx = i


print(minidx + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

#temp = []
diff = ''
index = ''
for i in data:
    #temp.append(t - i * 0.006)
    temp = t - i * 0.006
    if diff == '':
        diff = abs(temp - a)
        index = 1
    else:
        if abs(temp - a) < diff:
            diff = abs(temp - a)
            index = data.index(i) + 1
        else:
            continue
print(index)

Submission status: Accepted

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-t+h[i]*0.006):
    ans=i+1
  m=min(m,abs(a-t+h[i]*0.006))
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

T, A = map(int, input().split())

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

H = T - H * 0.006
ans = np.abs(A - H)
ans = np.where(ans == ans.min())[0][0] + 1

print(ans)

Submission status: Accepted

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.006*H[i]) < var):
    var = abs(T-A-0.006*H[i])
    idx = i
    
print(int(idx+1))

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
for i in range(1, N):
    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())
tmp = list(map(int, input().split()))
bst = 100000
p = 0

for i in range(n):
    x = abs(a - float(t - tmp[i]*0.006))
    
    if x < bst:
        p = i+1
        bst = x    
        
print(p)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
yama = int(input())
T, A = map(int, input().split())
takasas = list(map(int, input().split()))
takasass = np.array(takasas)
mokuhyou=(T-A)/0.006
sabun=takasass-mokuhyou
sabun2=sabun*sabun
saisyou=np.argmin(sabun2)
kotae=saisyou+1
print(kotae)

Submission status: Accepted

Solution code:
_ = input()
T,A = map(int, input().strip().split(' '))
H = list(map(int, input().strip().split(' ')))
min_idx, min_diff = None, float('inf')
for i in range(len(H)):
  tmp = abs(A-(T-H[i]*0.006))
  if tmp < min_diff:
    min_diff = tmp
    min_idx = i
print(min_idx+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
b,c=map(int,input().split())
d=[int(i) for i in input().split()]
e=f=999
g=0
for i in range(a):
    f=e
    e=min(e,abs(c-b+d[i]*0.006))
    if f!=e:
        g=i
print(g+1)

Submission status: Accepted

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: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
n=int(input())
ta=list(map(int,input().split()))
t=ta[0]
a=ta[1]
h=list(map(int,input().split()))
temp=[0 for i in range(n)]
for i in range(n):
    temp[i] = abs((t-0.006*h[i])-a)
ans = np.argmin(temp) + 1
print(ans)

Submission status: Accepted

Solution code:
def calc_temp(i):
  return T - 0.006*H[i]

N = int(input())
[T,A] = list(map(int,input().split()))
H = list(map(int,input().split()))
ans = 0
for i in range(N):
  if abs(A-calc_temp(i)) < abs(A-calc_temp(ans)):
    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()))

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h_list = list(map(int, input().split()))
rate = 0.006
dif = 10**10
for i, h in enumerate(h_list):
    if dif > abs(t-rate*h - a):
        ans = i+1
        dif = abs(t-rate*h - a)
print(ans)

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[i] * 0.006)) for i in range(N)]
print(X.index(min(X))+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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-A)])
L = sorted(L, key=itemgetter(1))

print(L[0][0])

Submission status: Accepted

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

K = []
index = 10000
ans=0
for i in H:
        j = T - i * 0.006
        K.append(j)

for i in range(len(K)):
       if abs(K[i] - A) < index:
               ans = i+1
               index = abs(K[i] - A)

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
temperatures = []
for i in range(N):
    temperatures.append(T - H[i] * 0.006)
# print(temperatures)
diff = 10**9
ans = -1
for i in range(N):
    new_diff = abs(temperatures[i] - A)
    if diff > new_diff:
        diff = new_diff
        ans = i

print(ans+1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

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

mini = abs(1000 * t - 6 * h[0] - 1000 * a)
ans = 1

for i in range(1, n):
    if mini > abs(1000 * t - 6 * h[i] - 1000 * a):
        mini = abs(1000 * t - 6 * h[i] - 1000 * a)
        ans = i + 1
        
print(ans)

Submission status: Accepted

Solution code:
def temp(T,A,x):
    return abs(A - (T - x * 0.006))
N = int(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: Accepted

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

for i in range(N):
    dt = abs(T - int(H[i])*0.006 - A)
    T_best = min(dt,T_best)
    if dt == T_best:
        i_best = i


print(i_best+1)

Submission status: Accepted

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

tmplst=[]
for i in range(n):
    tmp=abs(t-hlst[i]*0.006-a)
    tmplst.append(tmp)


print(tmplst.index(min(tmplst))+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):
	tmp = T - H[i] * 0.006
	t.append(abs(tmp - A))
print(t.index(min(t)) + 1)

Submission status: Accepted

Solution code:
import numpy as np

n=int(input())
t,a=map(int,input().split())
li=np.array(list(map(int,input().split())))
print(np.argmin(abs(a-(t-0.006*li)))+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

minimum = 10000000
ans = 100000000
for n in range (N):
    A_now = T-H[n]*0.006
    if minimum >= abs(A_now - A):
        minimum = abs(A_now - A)
        ans = n +1
print(ans)

Submission status: Accepted

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

n = int(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: Accepted

Solution code:
N = int(input())
T, A  = map(int, input().split())
hight_list = list(map(int, input().split()))
 
ans = 10000
ans_ind = 0
 
for i in range(N):
  temp = T - 0.006 * hight_list[i]
  diff = abs(temp - A)
  if  diff < ans:
    ans = diff
    ans_ind = i
    
print(ans_ind+1)

Submission status: Accepted

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

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

minimum=min(d)

for i in range(N):
  if d[i]==minimum:
    ans=i+1
    break

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = []
H_list = list(map(int, input().split()))
kion = lambda k: T - k * 0.006
min = 1000
ans = 0
diff = 0
for i in range(N):
  H_list[i] = kion(H_list[i])
  diff = abs(H_list[i] - A)
  if min > diff:
    min = diff
    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()))
mi=float("inf")
ans=0
for i in h:
    if abs(a-(t-0.006*i))<mi:ans,mi=i,abs(a-(t-0.006*i))
print(h.index(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(abs(T - i*0.006 - A))

mini = min(temp)
for i in range(len(temp)):
    if temp[i] == mini:
        print(i+1)
        break

Submission status: Accepted

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.index(min(calc_list))+1)

Submission status: Accepted

Solution code:
#113 B
N =int(input())
T,A= map(int,input().split())
H =[int(j) for j in input().split()]
ans = 10**9
for i,j in enumerate(H):
    if ans >= abs(A-(T- 0.006 *j)):
        ans =abs(A-(T- 0.006 *j))
        ans2=i+1
print(ans2)

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

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

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

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

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

Submission status: Accepted

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

ideal = (t-a)/0.006

mindif = 100000
ans = 100001
for i in range(n):
  dif = abs(ideal - h[i])
  if dif < mindif:
    ans = i
    mindif = dif

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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: Accepted

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

for n, i in enumerate(tem_h):
    dif = abs(A - i)
    if min > dif:
        min = dif
        ans = n + 1

print(ans)

Submission status: Accepted

Solution code:
n,t,a,*h=map(int,open(0).read().split());f=lambda i:t-i*.006;r=[abs(a-f(e))for e in h];print(r.index(min(r))+1)