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 = map(int, input().split())
h = [abs(t - _h * 0.006 - a) for _h in h]
m = min(h)
for i, v in enumerate(h):
    if v == m:
        print(i + 1)
        break

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

Submission status: Accepted

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

mini = None
minv = float('inf')

for i, h in enumerate(H):
  delta = abs(A - (T - 0.006 * h))
  if delta < minv:
    mini = i + 1
    minv = delta
print(mini)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ansIndex = 0
smallestDiff = 999999
for index, height in enumerate(H):
    temp = T - height * 0.006
    diff = abs(A - temp)
    if smallestDiff > diff:
        smallestDiff = diff
        ansIndex = index

print(ansIndex+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()))
h = np.array(h)

dift = abs((t - h * 0.006) - a)

ans = np.argmin(dift) + 1

print(ans)

Submission status: Accepted

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

res = float("inf")
ret = float("inf")
for i, y in enumerate(h_array, 1):
    if res > abs(a-(t-y*0.006)):
        res = abs(a-(t-y*0.006))
        ret = i
print(ret)

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

for i in range(N):
  if i == 0:
    ans = 1
    temp = abs((T - 0.006 * places[i]) - A)
  else:
    tt = abs((T - 0.006 * places[i]) - A)
    if tt < temp:
      ans = i+1
      temp = tt

print(ans)

Submission status: Accepted

Solution code:
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n = I()
t,a = Is()
lis = Is()
tmin = 10**10
for i in range(n):
    if abs(a-(t-lis[i]*0.006)) < tmin:
        tmin = abs(a-(t-lis[i]*0.006))
        tmin_i = i
print(tmin_i+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

min_d = min(delta)
print(delta.index(min_d)+1)

Submission status: Accepted

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

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

print(p)

Submission status: Accepted

Solution code:
# encoding: utf-8
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = -1
dmin = 1000
for i, Hi in enumerate(H):
    tmp = T - Hi * 0.006
    dtmp = tmp - A if tmp > A else A - tmp
    if dtmp < dmin:
        ans = i
        dmin = dtmp

print(ans + 1)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n=int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
ta=10000
pos=1
for i in range(0,n):
  x = h[i]
  temp=abs(t-x*0.006-a)
  if temp < ta:
    pos = i+1
    ta = temp


print(pos)

Submission status: Accepted

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


diff = [abs(A - (T-h*0.006)) for h in H]

min_pos = 0
min = 1e5

for i, d in enumerate(diff):
    if min > d:
        min = d
        min_pos = i+1

print(min_pos)

Submission status: Accepted

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

minimum = 1000
point = 0
for i in range(N):
    Ti = T - (H[i]*0.006)
    if abs(Ti-A) < minimum:
        minimum = abs(Ti-A)
        point = i
print(point+1)

Submission status: Accepted

Solution code:

def main():
    buf = input()
    buflist = buf.split()
    N = int(buflist[0])
    buf = input()
    buflist = buf.split()
    T = int(buflist[0])
    A = int(buflist[1])
    buf = input()
    buflist = buf.split()
    H = list(map(int, buflist))

    mindiff = float("inf")
    point = None
    for i in range(N):
        temp = T - (H[i] * 0.006)
        diff = abs(A - temp)
        if diff < mindiff:
            mindiff = diff
            point = i
    print(point+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()))

ans = 0
score = float("inf")
for index, i in enumerate(H):
    x = T - i * 0.006
    if abs(A - x) < score:
        score = abs(A - x)
        ans = index + 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import collections
import itertools
import math
import re
from collections import Counter
from collections import deque

MOD = 10 ** 9 + 7

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

B = [T - h * 0.006 for h in H]

min_diff = 99999999999999999
min_idx = 0
for i in range(N):
    diff = abs(B[i] - A)
    if min_diff > diff:
        min_diff = diff
        min_idx = i

print(min_idx+1)


sys.exit(0)

Submission status: Accepted

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

tikasa=100000
motto=100000
answer=100
H=list(map(int,input().split()))

for i in range(len(H)):
  tempature=T-H[i]*0.006
  tikasa=abs(tempature-A)
  if tikasa<motto:
    motto=tikasa
    answer=i+1
print(answer)

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()]
for i in range(N):
    H[i]=T-(H[i]*0.006)
    H[i]=abs(H[i]-A)
p=min(H)
print(H.index(p)+1)

Submission status: Accepted

Solution code:
#coding:utf-8
n = int(input())
T,A = list(map(int,input().split()))
ls_H = list(map(int,input().split()))
diff_min = 1e+8
for i,H in enumerate(ls_H):
    diff = abs((T - H  * 0.006) - A)
    if diff < diff_min:
        diff_min = diff
        ans = i
print (int(ans+1))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))

ans = 0
for i in range(N):
    del_T = abs(A - (T - H[i]*6/1000))
    if i == 0:
        ans = del_T
        ind = 0
    elif ans > del_T:
        ans = del_T
        ind = i
print(ind+1)

Submission status: Accepted

Solution code:
n = int(input())
t, a = [int(_) for _ in input().split()]
h = [int(_) for _ in input().split()]
ans = float('inf')
for i in range(n):
    tem = t - 0.006 * h[i]
    res = abs(tem - a)
    if res <= ans:
        ans = res
        result = i+1
print(result)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input().strip('\n'))
T,A = [int(x) for x in input().strip('\n').split(' ')]
H = np.array([int(x) for x in input().strip('\n').split(' ')])
H = T-0.006*H
H_res = np.abs(H-A)
print(int(np.argmin(H_res))+1)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T, A = [int(_) for _ in input().split()]
H_A = [abs(T - 0.006 * int(i) - A) for i in input().split()]
print(np.argmin(H_A) + 1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int, input().split())
plcs = map(int, input().split())
min_val = float('inf')
min_ind=0
for i, plc in enumerate(plcs,1):
  tmp = t - 0.006 * plc
  if abs(tmp - a) < min_val:
    min_val = abs(tmp - a)
    min_ind = i

print(min_ind)

Submission status: Accepted

Solution code:
import numpy as np

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

diff_temp = [abs((T - x*0.006) - A) for x in H]
ans = np.argsort(diff_temp)[0]

print(ans + 1)

Submission status: Accepted

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

m="a"

for i in range(N):
	if m=="a" or m>abs(A-(T-(H[i]*0.006))):
		m=abs(A-(T-(H[i]*0.006)))
		m_i=i

print(m_i+1)

Submission status: Accepted

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

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

for i in range(n):
    if ans[i] == min(ans):
        place = i
        break

print(place + 1)

Submission status: Accepted

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

Best = 0
Bestabs = abs(A - (T-H[0]*0.006))
for i in range(N):
    Ti = T - H[i]*0.006
    if Bestabs > abs(A-Ti):
        Best = i
        Bestabs = abs(A-Ti)

print(str(Best+1))

Submission status: Accepted

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

Submission status: Accepted

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

Hd = [abs(T - 0.006 * h - A) for h in H]
m = min(Hd)
print(Hd.index(m) + 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()]

ans = 0
m = 10000

for i, h in enumerate(H):
    if m > abs(a - (t - h*0.006)):
        ans = i
        m = abs(a - (t - h*0.006))

print(ans+1)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:

import sys
from collections import deque
import copy

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_raw = read_func().strip().split()
    [T, A] = [long(input_raw[0]), long(input_raw[1])]
    input_raw = read_func().strip().split()
    min_sub = sys.maxint
    min_idx = 0
    for i in range(N):
        H = long(input_raw[i])
        sub = abs(float(A) - (T - H * 0.006))
        if sub < min_sub:
            min_sub = sub
            min_idx = i
    print min_idx + 1

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    t, a = map(int, input().split())
    h = [int(s) for s in input().split()]
    y = [abs(t - 0.006 * x - a) for x in h]
    i = min(range(n), key=lambda j: y[j])
    print(i + 1)

main()

Submission status: Accepted

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

def calc_score(h):
    return abs(A - (T - h*0.006))

ans_id = 0
ans_score = calc_score(H[0])

for i in range(1, N):
    score = calc_score(H[i])
    if ans_score > score:
        ans_id = i
        ans_score = score

print(ans_id + 1)

Submission status: Accepted

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

index = None
mindiff = 1000000000
for i in range(1, n + 1):
  diff = abs(t - a - 0.006 * h[i - 1])
  if mindiff > diff:
    mindiff = diff
    index = i

print(index)

Submission status: Accepted

Solution code:
from math import fabs

n = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
index, ave = 0, fabs(T - 0.006 * H[0] - A)
for i in range(1, n):
    tmp = fabs(T - 0.006 * H[i] - A)
    if tmp < ave:
        index, ave = i, tmp
print(index + 1)

Submission status: Accepted

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

Submission status: Accepted

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

s = min(range(1, 1 + n), key=lambda x: abs(t - 0.006 * h[x-1] - a))
print(s)

Submission status: Accepted

Solution code:
import sys


def main() -> None:
    n = next_int()
    t = next_int()
    a = next_int()

    key = 0
    val = sys.maxsize

    for i in range(n):
        h = next_int()
        p = t - h * 0.006
        if val > abs(a - p):
            key = i + 1
            val = abs(a - p)

    print(key)


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = sys.stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


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

Submission status: Accepted

Solution code:
def run(N, T, A, H):
    ret = 0
    diff = 999
    for i in range(len(H)):
        tmp = T - H[i]*0.006
        if diff > abs(tmp - A):
            ret = i+1
            diff = abs(tmp - A)
    return ret


def main():
    N = int(input())
    T, A= map(int, input().split())
    H = list(map(int, input().split()))
    print(run(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()))

best_i = -1
diff = float("inf")

for i in range(N):
    h = H[i]
    tmp = T - h * 0.006
    new_diff = abs(tmp - A)
    if new_diff < diff:
        best_i = i
        diff = new_diff

print(best_i + 1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
h=map(int,input().split())
*x,=map(lambda x:t-x*0.006,h)

df=float("inf")
ans=0

for i,j in enumerate(x):
  if df>abs(a-j):
    df=abs(a-j)
    ans=i+1

print(ans)

Submission status: Accepted

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

m = 10**5+1
m_index = -1
for i in range(N):
    H[i] = abs(A - (T - H[i]*0.006))
    if m > H[i]:
        m = H[i]
        m_index = i
        
print(m_index + 1)

Submission status: Accepted

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

tikai = 1e9
idx = 1e9
for i in range(len(H)):
    tmp = t - H[i] * 0.006
    if tikai > abs(a - tmp):
        idx = i + 1
        tikai = abs(a - tmp)
print(idx)

Submission status: Accepted

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

Submission status: Accepted

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

    ts = []
    x = float("inf")
    ans = -1
    for i, h in enumerate(H, 1):
        t = T - h * 0.006
        diff = abs(A - t)
        if diff < x:
            x = diff
            ans = i

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = [T - h * 0.006 for h in H]
ans = 10**9
for i in range(len(t)):
    if abs(t[i] - A) < ans:
        ans_i = i
        ans = abs(t[i] - A)
print(ans_i + 1)

Submission status: Accepted

Solution code:
n=input()
t,a=map(int, input().split(" "))
H=list(map(int, input().split(" ")))
diff=99999999999999999999999999999999999999999999999
for num,i in enumerate(H):
    tmp=abs(t-a-i*0.006)
    if tmp<diff:
        out=num+1
        diff=tmp
print(out)

Submission status: Accepted

Solution code:
n = input()
t, a = map(int, raw_input().strip().split())
arr = map(int, raw_input().strip().split())

ans = int(1e20)
pans = 0
for i in xrange(n):
    x = arr[i]
    add = t - x * 0.006
    diff = abs(add - a)
    if diff < ans:
        ans = diff
        pans = i

print pans + 1

Submission status: Accepted

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

ans = -1
abs_val = 1e9

for i, v in enumerate(H):
  if abs_val > abs((T - v * 0.006) - A):
    abs_val = abs((T - v * 0.006) - A)
    ans = i
print(ans + 1)

Submission status: Accepted

Solution code:
import sys
fin = sys.stdin.readline
N = int(fin())
T, A = [int(elem) for elem in fin().split()]
H_list = [int(elem) for elem in fin().split()]
assert len(H_list) == N

temperatures = [T - H * 0.006 for H in H_list]

idx_closest = 1
temp_closest = float('inf')
for i, temperature in enumerate(temperatures, start=1):
    if abs(A - temperature) < abs(A - temp_closest):
        temp_closest = temperature
        idx_closest = i

print(idx_closest)

Submission status: Accepted

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

ans = 0

diff =  10 ** 5
for index,cell in enumerate(H):
    if abs(T - (0.006*cell) - A) <= abs(diff-A):
        ans = index + 1
        diff = T - (0.006*cell)
print(ans)

Submission status: Accepted

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


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

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

Submission status: Accepted

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

min_dif = 1e10
ans = 0

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

ans = 1
ans2 = abs((t-h[0]*0.006)-a)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
ls=[]
for i in range(N):
    ls.append((i+1,abs(A-(T-H[i]*0.006))))
ls0=list(sorted(ls, key=lambda x :x[1]))
print(ls0[0][0])

Submission status: Accepted

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

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

ansindex = 0
mindelta = 100000
for i, h in enumerate(H):
	average = t - h * 0.006
	delta = abs(a - average)
	if delta < mindelta:
		ansindex = i + 1
		mindelta = delta

print(ansindex)

Submission status: Accepted

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

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

Submission status: Accepted

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

T_list = []
margin = []
for i in range(N):
    h = h_list[i]
    t = T - h*0.006
    margin.append(abs(A-t))

min_margin = float("inf")
min_i = -1

for i in range(N):
    if min_margin >= margin[i]:
        min_margin = margin[i]
        min_i = i+1
print(min_i)

Submission status: Accepted

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

Submission status: Accepted

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

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

diff_tmp = sorted([(abs((T - h*0.006) - A), i+1) for i, h in enumerate(H)])
print(diff_tmp[0][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):
  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( )))

l = []
for i in range(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 = [T - h * 0.006 for h in H]

diff = 10 ** 9
res = -1
for i, t in enumerate(temp):
    if abs(A - t) < diff:
        res = i
        diff = abs(A - t)

print(res + 1)

Submission status: Accepted

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

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

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

print(idx + 1)

Submission status: Accepted

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

ans = -1
d = float('inf')
for i in range(n):
    b = abs(a - (t - 0.006 * h[i]))
    if b < d:
        d = b
        ans = i + 1

print(ans)

Submission status: Accepted

Solution code:
def abc113_b():
    import numpy as np
    n = int(input())
    t, a = map(int, input().split())
    h = np.array(list(map(int, input().split())))
    temp = np.abs(a - (t - h * 0.006))
    return np.argmin(temp) + 1


print(abc113_b())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

mi = 0
for i in range(N):
    if H[mi] > H[i]:
        mi = i

print(mi + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = h.index(min(h))

print(k+1)

Submission status: Accepted

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

T *= 1000
A *= 1000

max_diff = float('inf')
ans = 0
for i, h in enumerate(map(int, input().split()), 1):
    t = T - h * 6
    d = abs(t - A)
    if d < max_diff:
        max_diff = d
        ans = i
print(ans)

Submission status: Accepted

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

temp = 10**6
index = 0
for i in range(n):
    if temp > abs(a - (t - h[i] * 0.006)):
        temp = abs(a - (t - h[i] * 0.006))
        index = i + 1

print(index)

Submission status: Accepted

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

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

ans = 0
tmp = float('inf')
for i, v in enumerate(map(a, H)):
    i += 1
    if abs(v - A) < tmp:
        tmp = abs(v-A)
        ans = i
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = -10000000000
ansi = -1
for i, h in enumerate(H):
    t = T - 0.006*h
    if abs(t - A) < abs(ans - A):
        ans = t
        ansi = i
print(ansi + 1)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,raw_input().split(' '))
arr = map(int,raw_input().split(' '))
e = [t-i*0.006 for i in arr]
print e.index(min(e, key=lambda x:abs(x-a)))+1

Submission status: Accepted

Solution code:
a = int(input())

x,y = map(int,input().split())

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

c = []

for i in range(a):
    c.append(abs((x - (0.006 * l[i])) - y))

k = min(c)
kk = 0
for i in range(a):
    if k == c[i]:
        kk = i+1



print(kk)

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()]
ans = -1
nearest = float('inf')
for k, h in enumerate(H, 1):
    tmp = abs(A - (T - 0.006 * h))
    if tmp < nearest:
        ans = k
        nearest = tmp
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
T, A = T * 1000, A * 1000
rec = float("inf")
H = list(map(int, input().split()))
ans = -1
for i in range(N):
    t = T - H[i] * 6
    if rec > abs(A - t):
        ans = i + 1
        rec = abs(A - t)

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

h = np.abs((t - a) - 0.006 * np.array(h))
print(np.argsort(h)[0]+1)

Submission status: Accepted

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

minv = 1000000
for i, x in enumerate(H):
    tmp = T - x * 0.006
    if minv > abs(A-tmp):
        minv = abs(A-tmp)
        ans = i+1
print(ans)