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

h = [  abs(a - (t - i*.006)) for i in h]

mins = h[0]
index = 0
for i in range(1, n):
  if h[i] < mins:
    mins = h[i]
    index = i
    
print((index+1))

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
ans = float('inf')
for h in H:
  if abs(a-(t-ans*0.006)) > abs(a-(t-h*0.006)):
    ans = h
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()))
hh = [abs(a - (t - i * 0.006)) for i in h]
print(sorted(range(n), key=lambda x:hh[x])[0] + 1)

Submission status: Accepted

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

Submission status: Accepted

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

MIN = 10000
ans = 10000

for i in range(N):
  if MIN > abs((T - H[i]*0.006) - A):
    MIN = abs((T - H[i]*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()))
ans = 1
temp = 10**5
for i in range(n):
  T = t - h[i]*0.006
  if abs(a - T) < temp:
    temp = abs(a - T)
    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()))

import copy
t = copy.copy(H)
m = 100000
ans = 0
for i in range(N):
    t[i] = abs(T-0.006*H[i]-A)
    if t[i]<m:
        m = t[i]
        ans = i+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc113_b.py
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
lowest = 10**9
ans = 0
for i in range(N):
    tmperture = abs(A-(T-H[i]*0.006))
    if abs(tmperture) < lowest:
        ans = i + 1
        lowest = tmperture
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
S=list(map(int,input().split()))
ans=0
t=0
temp=[]
for i in range(N):
	t = T-0.006*S[i] - A
	t = t*t
	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()))
temp_dif_abs=[]
for i in range(N):
    temp_dif_abs+=[abs(A-(T-H[i]*0.006))]
print(temp_dif_abs.index(min(temp_dif_abs))+1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split(' '))
H = list(map(int, input().split(' ')))
d_min = abs(a - (t - H[0]*0.006))
ans = 0
i = 1
while i < n:
    if abs(a - (t-H[i]*0.006)) < d_min:
        d_min = abs(a - (t-H[i]*0.006))
        ans = i
    i += 1
print(ans+1)

Submission status: Accepted

Solution code:
# ABC 113: B – Palace
N = int(input())
T, A = map(int, input().split())
H = [int(s) for s in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    T, A = map(int, input().split())
    H = [int(a) for a in input().split()]
    dmin = 10**9
    ind = 0
    for i in range(N):
        t = T - H[i] * 0.006
        d = abs(t - A)
        if d < dmin:
            dmin = d
            ind = i
    print(ind+1)
main()

Submission status: Accepted

Solution code:
# solution

data = int(input())
n,m = map(int, input().split())
k = map(int, input().split())
j = [abs(m-(n-i*0.006)) for i in k]
print(j.index(min(j)) + 1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

for i in range(N):
    if abs(A-(T-0.006*h[i]))<=dif:
        t=i
        dif=abs(A-(T-0.006*h[i]))
print(t+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def myAnswer(N:int,T:int,A:int,H:list) -> int:
   ans = 0
   s = 10**10
   for n,x in enumerate(H):
      tmp = T - x * 0.006
      if(s >= abs(A - tmp)):
         ans = n+1
         s = abs(A - tmp)
   return ans


def modelAnswer():
   tmp=1
def main():
   N = int(input())
   T,A = map(int,input().split())
   H = list(map(int,input().split()))
   print(myAnswer(N,T,A,H[:]))

if __name__ == '__main__':
   main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
MIN=10000
num=0
for s in H:
    if (abs(A-(T-(s*0.006))))<MIN:
        MIN=(abs(A-(T-(s*0.006))))
        num=(H.index(s)+1)
    else:
        continue
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
data = list(map(int, input().split())) 
degree = 1000000
for i,x in enumerate(data):
    temp = t - 0.006*x
    if degree > abs(temp-a):
        degree = abs(temp-a)
        num = i+1
print(num)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

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

ans = [float("inf"), -1]
for i in range(len(H)):
    if abs(T - H[i]*0.006 - A) < ans[0]:
        ans[0] = abs(T - H[i]*0.006 - A)
        ans[1] = i+1

print(ans[1])

Submission status: Accepted

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

min_diff = 10**9
for i in range(n):
    diff = abs(a - (t - h[i]*0.006))
    if min_diff > diff:
        min_diff = 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()))
bestH = (T - A) / 0.006
d = float('inf')
ans = 0
for i in range(N):
    if d > abs(H[i] - bestH):
        d = abs(H[i] - bestH)
        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()))

temp_now = 0
temp_ans = 999999999
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
y = 0
z = 0
# aに近い値を調べる
h = list(map(int, input().split()))
for i in range(1,n+1):
  x = t - (h[i-1] * 0.006)
#  print(x)
  if y ==0:
    y=x
    z=i
  else:
    if abs(x-a) <= abs(y-a):
      y = x
      z = i
print(z)

Submission status: Accepted

Solution code:
import numpy as np
def Palace(n , t , a , hli):

    ans = 0
    count = 10**8

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

    return ans

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
diff = 1000
for i, h in enumerate(H):
    if diff > abs(A - (T-h*0.006)):
        ans = i+1
    diff = min(diff, 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()))

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

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

Submission status: Accepted

Solution code:
n = int(input())
t, a =map(int, input().split())
h = list(map(int, input().split()))
d_degree = 100000
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: Accepted

Solution code:
_, t, a, *h = map(int, open(0).read().split())
print(sorted(map(lambda x: (x[0], abs(t - x[1]*.006 - a)), enumerate(h)), key = lambda y: y[1])[0][0]+1)

Submission status: Accepted

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

idx = 0
best = 10e9
for i, h in enumerate(H):
    t = T - h * 0.006
    res = abs(A - t)
    if (best > res):
        best = res
        idx = i + 1

print(idx)

Submission status: Accepted

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

rT = T - (H[0]*0.006)
dif = abs(A - rT)
ans = 1

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

print(ans)

Submission status: Accepted

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

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

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

a =0
h = len(H)
b =[]

for i in range(h):
    a = A - (T - H[i]*(0.006))
    if a >= 0:
        b.append(a)
    else:
        b.append(-a)

c = min(b)

print(b.index(c)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,T,A,*H=map(int,open(0).read().split());v=[]
for i in H:
    v.append(abs(A-T+i*0.006))
print(v.index(min(v))+1)

Submission status: Accepted

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

min = 10000

def func(h):
    return t - h*0.006

for i, height in enumerate(h):
    temperature = func(height)
    diff = abs(temperature-a)
    if min > diff:
        ans = i+1
        min = diff

print(ans)

Submission status: Accepted

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

ans, tmp = 0, 10000000
for i in range(n):
    if abs(a - (t - h[i] * 0.006)) < tmp:
        tmp = abs(a - (t - h[i] * 0.006))
        ans = i

print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

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

temp_dif = np.zeros(N)
for i in range(N):
  temp_dif[i] = abs ( (T - H[i] * 0.006) - A )
ind=np.where(temp_dif==min(temp_dif))
print(ind[0][0]+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
t,a = iim()
H = iil()
mdif = 10**9
ans = 0
for i,item in enumerate(H):
    tem = t - item*0.006
    if abs(tem - a) < mdif:
        ans = i+1
        mdif = abs(tem - a)
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

ave = T-H*0.006
dif = abs(ave - A)

print(np.where(min(dif) == dif)[0][0]+1)

Submission status: Accepted

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

for i in range(n):
    dic[i+1] = abs(a-(t-H[i]*0.006))

print(min(dic,key=dic.get))

Submission status: Accepted

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    T, A = il()
    H = il()
    S = []

    for h in H:
        S.append(abs(A-(T-(h*0.006))))
    print(S.index(min(S))+1)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II(); t, a = MII(); hh = MII()
    d = [(i+1, abs(a-(t-h*0.006))) for i,h in enumerate((hh))]
    d.sort(key=lambda x: x[1])
    print(d[0][0])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))

def main():
    n = II()
    t, a = MII()
    hh = MII()
    d = []
    for i, h in enumerate(hh):
        d.append((i+1, abs(a - (t - h*0.006))))
    d.sort(key=lambda x: x[1])
    print(d[0][0])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

A=[]
for j in range(n):
    A.append(abs(T[j]-a))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

h=[int(i) for i in input().split()]

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
H=[int(_) for _ in input().split()]
Tx=[]
for i in range(n):
    Tx.append([i+1,abs(a-t+H[i]*0.006)])
Tx.sort(key=lambda x:x[1])
print(Tx[0][0])

Submission status: Accepted

Solution code:
def main():
  n = int(input())
  #s = input()
  #s = input().split()
  t,a = list(map(int,input().split()))
  h = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = t - h[0]*0.006
  count = 1
  lis = []
  
  for i in range(1,len(h)):
    hi = t - h[i]*0.006
    if abs(a - hi) < abs(a - ans):
      ans = hi
      count = i + 1
  print(count)
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = -1.0
d = 1e100
for i,j in enumerate(h):
  if abs(t - j*0.006 - a) < d:
    ans = i+1
    d = abs(t - j*0.006 - a)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
p,q= input().split()
b,c =(int(p), int(q))
d = input().split()
ans_list = []
for i in range(a):
    e = abs(c+0.006 * int(d[i])-b)
    ans_list.append(e)
for i in range(a):
    if ans_list[i] == min(ans_list):
        print(i+1)
        break

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
temp_diff = 10**6
ans = 0
for i in range(n):
    if abs(t-h[i]*0.006-a) < temp_diff:
        temp_diff = 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(" ")))
H = list(map(int,input().split(" ")))
ans_t = 10000
ans = 0
 
for i in range(N):
  t = T - H[i] * 0.006
  l = abs(A - t)
  if l < ans_t:
    ans_t = l
    ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

res = 1e+9
c = 0
for i in range(N):
    t = T - H[i] * 0.006
    tmp = abs(t - A)
    if res > tmp:
        res = tmp
        c = i
print(c+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

lis = []
for i in range(len(H)):
  lis.append(abs(T-H[i]*0.006-A))

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

Submission status: Accepted

Solution code:
n=int(input().rstrip())
data=input().rstrip().split()
t=int(data[0])
a=int(data[1])
h=input().rstrip().split()
deg=[abs((t-int(x)*0.006)-a) for x in h]
for i in range(len(deg)):
  if min(deg)==deg[i]:
    print(i+1)
    break

Submission status: Accepted

Solution code:
import numpy as np

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

T_list = [abs(t-0.006*H[i]-a) for i in range(n)]
print(np.argmin(T_list) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC-113-B
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = -1
ans_diff = 10**19

for i in range(N):
    tempe = (T-H[i]*0.006)
    if ans_diff > abs(A - tempe):
        ans_diff = abs(A - tempe)
        ans = i

print(ans+1)

Submission status: Accepted

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

ans = 0
check = abs(a - (t - h[0]*0.006))
for i in range(n):
  if abs(a - (t - h[i]*0.006)) < check:
    check = abs(a - (t - h[i]*0.006))
    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()))

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
t,a = LI()
h = LI()
ans = inf
for i in range(n):
    if ans > abs(a-(t-h[i]*0.006)):
        ans = abs(a-(t-h[i]*0.006))
        idx = i+1
print(idx)

Submission status: Accepted

Solution code:
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n = int(input())
  t,a = map(int,input().split())
  H = list(map(int,input().split()))
  mi_ = float('inf')
  for i in range(n):
    temp = t - H[i] * 0.006
    if mi_ > abs(a-temp):
      mi_ = abs(a-temp)
      idx = i+1
  print(idx)
  
  
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()))
ans = 0
for i in range(n):
    if abs(a - (t - h_list[i] * 0.006)) < abs(a - (t - h_list[ans] * 0.006)):
        ans = i
print(ans + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
A_h = (T - A) / 0.006
# print(A_h)

# print('HT', HT)
v, idx = 10**10, 0
for i in range(len(H)):
    tmp = abs(H[i] - A_h)
    if v > tmp:
        idx = i
        v = tmp
print(idx + 1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n, t, a, *h = map(int, open(0).read().split())
mni = 0
mn = 1e18
for i in range(n):
	if mn>=abs(t-h[i]*0.006 - a):
		mn = abs(t-h[i]*0.006 - a)
		mni = i
print(mni+1)

Submission status: Accepted

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

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

ans = 0
T = 1000000000

for i in range(n):
    if T >= abs((t - H[i] * 0.006) - a):
        T = 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(" "))
Pos = [int(i) for i in input().split(" ")]
best_pos = 0
temp_abs = 10**9
for i in range(N):
  t = T - Pos[i]*0.006
  Abs = abs(A - t)
  if Abs < temp_abs:
    best_pos = i+1
    temp_abs = Abs
print(best_pos)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
INF = 10 ** 10
MOD = 10 ** 9 + 7
from heapq import heapify,heappop,heappush
input = sys.stdin.readline

def main():
    n = int(input())
    t,a = list(map(int,input().split()))
    dif = INF
    ans = -1
    h = list(map(int,input().split()))
    for i in range(n):
        if dif > abs(a - t + h[i] * 0.006):
            dif = abs(a - t + h[i] * 0.006)
            ans = i + 1
    print(ans)
if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

avg = [abs(t-hi*0.006-a) for hi in h]

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

Submission status: Accepted

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

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

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