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

Solution (Python):
N = int(input())
T, A = map(int, input().split())
Hs = input().split()
loss = []
for i in range(N):
    loss.append([abs(T-int(Hs[i])*0.006-A), i+1])
print(sorted(loss)[0][1])

Solution (Python):

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

anss = 99999
ans = 0
i = 1

for hi in H:
    if abs(anss) > abs(A - (T - hi *0.006)):
        anss = A - (T - (hi *0.006))
        ans = i
    i = i +1
    
print(ans)

Solution (Python):
def main():
    '''
    メイン関数
    '''
    
    N = int(input())
    T, A = map(int, input().split())
    H_list = map(int, input().split())

    delta = 99999
    n = 1
    good = 0

    for H in H_list :
        temp = T - H * 0.006
        temp_delta = abs(A-temp)
        
        if temp_delta < delta :
            delta = temp_delta
            good = n
        n += 1

    print(good)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

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

ans = 0
n = 0
for i, item in enumerate(H):
    if i == 0:
        ans = i + 1
        n = abs(T - item*0.006 - A)
    else:
        if abs(T - item*0.006 - A) < n:
            ans = i + 1
            n = abs(T - item*0.006 - A)

print(ans)

Solution (Python):
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)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
hs = list(map(int, input().split()))

min = 99999
ans = 99999

for i in range(n):
    tmp = t - hs[i] * 0.006
    d = abs(a-tmp)
    if d < min:
        ans = i
        min = d

print(ans+1)

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

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

Solution (Python):



def main():
    n = int(input())
    t, a = map(int, input().split())
    h = list(map(int, input().split()))
    tmp = [0 for _ in range(n)]
    diff = 10 ** 6

    for i, hi in enumerate(h):
        tmp[i] = abs(a - (t - hi * 0.006))

    ans = 0

    for index, j in enumerate(tmp, 1):
        if j < diff:
            diff = j
            ans = index

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())

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

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

min = 0
min_val = 0
for i in range(N):
    a = abs(T - H[i] * 0.006 - A)
    if min == 0 or min_val > a:
        min = i+1
        min_val = a

print(min)

Solution (Python):
N = int(input())
T, A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
h = [abs(A - (T - x * 0.006)) for x in H]

m = h[0]
ans = 1
for i in range(len(h)):
    if h[i] < m:
        m = h[i]
        ans = i + 1


print(ans)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
difmin = 10**5
imin = -1
for i, h in enumerate(H):
    dif = abs((T - h*0.006) - A)
    if difmin > dif:
        difmin = dif
        imin = i+1
print(imin)

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

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

t_list = list(map((lambda h: t-h*0.006), h_list))
diff_list = list(map((lambda t: abs(a-t)), t_list))

idx = 1
idx_diff_list = []
for diff in list(diff_list):
    idx_diff_list.append((idx, diff))
    idx += 1

print(min(idx_diff_list, key=(lambda t: t[1]))[0])

Solution (Python):
N = int(input())
T, A = map(int, input().split())
bestDiff = 1e99
bestIndex = 0
H = list(map(int, input().split()))
for i in range(N):
    diff = abs(A - (T - H[i] * 0.006))
    if(bestDiff > diff):
        bestDiff = diff
        bestIndex = i + 1
print(bestIndex)

Solution (Python):
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)

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

tmp = 10000
i = 0
for index, h in enumerate(H):
    ond = T - h * 0.006
    diff = abs(ond - A)
    if diff < tmp:
        tmp = diff
        i = index + 1

print(i)

Solution (Python):
N = int(input())
T,A = map(int,input().split(" "))
H = list(map(int,input().split(" ")))
j = 0
k = 0
flag = 0
s = []
while j < N:
  k = T - (0.006)*H[j]
  if k >= A:
    s.append(k - A)
  else:
    s.append(A - k)
  if s[j] <= s[flag]:
    flag = j
  j = j + 1
print(flag+1)

Solution (Python):
n = int(input())
T, A = map(int,input().split())
h = [int(i) for i in input().split()]
min_T = abs(T - h[0]*0.006 - A)
i_min = 0

for i,v in enumerate(h):
    if (min_T > abs(T - h[i]*0.006 - A)):
        min_T = abs(T - h[i]*0.006 - A);
        i_min = i
print(i_min+1)

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

min_diff = 9999999
min_cnt = 0
for c, h in enumerate(H):
    diff = abs(A - (T - h * 0.006))
    if min_diff >= diff:
        min_diff = diff
        min_cnt = c + 1

print(min_cnt)

Solution (Python):
N, = map(int, raw_input().split())
T, A = map(int, raw_input().split())
H = map(int, raw_input().split())
mi = 0
md = abs(T-0.006*H[0]-A)
for i in range(1, N):
  d = abs(T-0.006*H[i]-A)
  if d<md:
    md=d
    mi=i
print mi+1

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

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

res = 0
cc = float('inf')
for i in range(n):
    d = (1000 * t - 6 * h[i]) - 1000 * a
    if d < 0: d = -d
    if cc > d:
        cc = d
        res = i + 1
print(res)

Solution (Python):
import numpy as np
n = int(input())
t , a = map(int, input().split())
h = np.array([i for i in map(int, input().split())])
x = (t - a)/0.006
l = np.abs(h - x)
print(np.argmin(l)+1)

Solution (Python):
n=int(input())
t,a=map(int,input().split())
i=0;
s=1e9;
d=0;
for h in map(int,input().split()):
    i+=1
    now=abs((t-a)*1000-h*6)
    if now<s:
        s=now
        d=i
print(d)

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

    temp = []
    for h_i in h:
        temp.append(abs(a - (t - h_i * 0.006)))

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


if __name__ == "__main__":
    main()

Solution (Python):

N = int(input())
T, A = list(map(int,input().strip().split()))
H_list = list(map(int,input().strip().split()))
trueH = (T - A)/0.006
sa = float("inf")

for i in range(0,N):
    num = trueH - H_list[i]
    if abs(num) < sa:
        sa = abs(num)
        ans = i

print(ans+1)

Solution (Python):
import math

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

delta_temp_min = 100000000000
ans = 0

for i in range(N):
    temp_i = T-int(lst[i])*0.006
    delta_temp = math.sqrt((A-temp_i)**2)
    if delta_temp_min > delta_temp:
        ans = i
        delta_temp_min = delta_temp

print(str(ans+1))

Solution (Python):



 
import sys
import math



 

fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile


mod=1000000007
 

def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 

t=1
for tt in range(t):
    n=int(input())
    t,a= map(int, sys.stdin.readline().split(' '))
    b=list(map(int,sys.stdin.readline().split(' ')))
    v=(t-a)//(0.006)

    diff=mod
    ans=0

    for i in range(n):
        te=v-b[i]
        if(abs(te)<diff):
            diff=abs(te)
            ans=i

    print(ans+1)

    
    

if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    t,a = LI()
    h = LI()
    mi = -1
    ms = inf
    for i in range(n):
        s = abs(a-(t - h[i] * 0.006))
        if ms > s:
            ms = s
            mi = i

    return mi + 1


print(main())

Solution (Python):
import sys
 
def solve(N, T, A, ls_H):
    temperature = []
    difference = []
    near = []
    ti = 10**5//1
    for x in ls_H :
        air = T - x * 0.006
        temperature.append(air)
    
    
    for y in temperature :
        til = A - y
        difference.append(til)
    
    
    for z in difference :
        near.append(abs(z))
    
    
    for i in near :
        if ti > i :
            ti = i
    
    return near.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
main()

Solution (Python):
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)

Solution (Python):


def diff_A_temperature(T, A, x):
    H_T = T - (x * 0.006)
    diff_A = abs(H_T - A)

    return diff_A

def main():
    N = input()
    T, A = map(int, input().split())
    H_list = [int(i) for i in input().split()]
    H_diff_list = [diff_A_temperature(T, A, H) for H in H_list]
    print(H_diff_list.index(min(H_diff_list)) + 1)

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input().strip())
T,A = map(int,input().strip().split())
Hs = [int(x) for x in input().strip().split()]
posTemp = 10000000
posId = 0
for i in range(N):
    if posTemp > abs(A - (T - Hs[i] * 0.006)):
        posTemp = abs(A - (T - Hs[i] * 0.006))
        posId = i + 1
print(posId)

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

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

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

Solution (Python):
import numpy as np
import copy
import sys

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

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

near=np.inf; arg_near=-1
for i in range(N):
	if (near > abs(A-temp(T, H[i]))):
		near = abs(A-temp(T, H[i]))
		arg_max = i+1
print(arg_max)

Solution (Python):
a = int(input())
b,c = list(map(int,input().split()))
d = list(map(int,input().split()))
ans = []

for i in range(a):
  ans.append(abs(c - (b - d[i] * 0.006)))
  
print(ans.index(min(ans))+1)

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

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

cand = -1
cand_at = 10**10

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

Solution (Python):
import sys
 
def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 10**5//1
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    
    
    for y in dosi :
        til = A - y
        titen.append(til)
    
    
    for z in titen :
        titen1.append(abs(z))
    
    
    for i in titen1 :
        if ti > i :
            ti = i
    
    return titen1.index(ti) + 1
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
main()

Solution (Python):
N = int(input())
Data = list(map(int, input().split()))
T = Data[0]
A = Data[1]
H = list(map(int, input().split()))

X = T-A
Min = abs(X - H[0] * 0.006)
Num = 0
for i in range(1,N):
  temp = abs(X - H[i] * 0.006)
  if Min > temp:
    Min = temp
    Num = i
print(Num+1)

Solution (Python):
candidate_num = int(input())
temperature_str = input()
temperature_list = temperature_str.split()
temperature_base = int( temperature_list[0] )
temperature_ideal = int( temperature_list[1] )
candidate_list_str = input() 
candidate_list = candidate_list_str.split()
 
candidate = int(candidate_list[0])
candidate_temperature = temperature_base - candidate*0.006
answer = 1
diff = abs(temperature_ideal - candidate_temperature)
for i in range( 1, len( candidate_list) ):
    candidate = int(candidate_list[i])
    candidate_temperature = temperature_base - candidate*0.006
    if  abs(temperature_ideal -  candidate_temperature) < diff:
        diff = abs(temperature_ideal - candidate_temperature)
        answer = i+1
    
 
 
print(answer)

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

place = 1
closest = abs(A - (T - H[0]*0.006))

for i in range(1,N):
    temperature = abs(A - (T - H[i]*0.006))
    if temperature < closest:
        place = i + 1
        closest = temperature

print(place)

Solution (Python):
N = int(raw_input())
T, A = map(int, raw_input().split())
H = list(map(int, raw_input().split()))
difH = 10**5
ai = 0
for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    if d < difH:
        difH = d
        ai = i+1
print(ai)

Solution (Python):
_,t,a,*h=map(int,open(0).read().split());m=[abs(t-0.006*x-a)for x in h];print(m.index(min(m))+1)

Solution (Python):
input();i=lambda:map(int,input().split());t,a=i();h=[abs(t-0.006*x-a)for x in i()];print(h.index(min(h))+1)

Solution (Python):
n,t,a,*h=map(int,open(0).read().split());d,i=9**9,0
for j,v in enumerate(h):
 w=abs(a-t+v*0.006)
 if w<d:d=w;i=j
print(i+1)

Solution (Python):
n,t,a,*h=map(int,open(0).read().split());d,i=9**9,0
for j,v in enumerate(h):
 w=abs(a-t+v*0.006)
 if w<d:d=w;i=j
print(i+1)

Solution (Python):
n,t,a,*h=map(int,open(0).read().split())
d,i=10**18,0
for j in range(n):
  if abs(a-t+h[j]*0.006)<d:
    d=abs(a-t+h[j]*0.006)
    i=j
print(i+1)

Solution (Python):
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f, a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
kouho = list(map(int, input().split()))
kouho = list(map(lambda x: abs( (T - 0.006 * x) - A), kouho))
target = min(kouho)
print(kouho.index(target) + 1)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
kouho = list(map(int, input().split()))
dragon = 100000
for i in range(N):
    ondo = T - 0.006 * kouho[i]
    if abs(ondo - A) < abs(dragon - A):
        ans = i
        dragon = ondo
print(ans + 1)

Solution (Python):
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
l=[]
m=1000000
index=1001
for i in range(n):
  candidate=abs((t-h[i]*0.006)-a)
  if m > candidate:
  	index=i
  	m=candidate
  else:
    pass
print(index+1)

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

min=100000000000000
min_index=n+1
for i in range(len(h)):
  v = abs(t - h[i]*0.006-a)
  if v < min:
    min=v
    min_index=i
print(min_index+1)

Solution (Python):
import sys
 
def solve(N, T, A, ls_H):
    return min([(abs(A - (T - h * 0.006)), i) for (i, h) in enumerate(ls_H, start=1)])[1]
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 

main()

Solution (Python):
n = int(input())
t,a = map(int,input().rsplit())
h = list(map(int,input().rsplit()))
r = []

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

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

Solution (Python):
import sys

def solve(N, T, A, ls_H):
    li = [abs(A-(T-(i*0.006))) for i in ls_H]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return answer

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

main()

Solution (Python):
import io
import sys

import sys
def solve(T,A,listH):
    sa = 1000
    for x in range(len(listH)):
        if sa >= abs(A - (T - (int(listH[x]) * 0.006))):
            sa = abs(A - (T - (int(listH[x]) * 0.006)))
            a = x+1
    return a

def readQuestion():

    line1 = sys.stdin.readline().rstrip()
    line2 = sys.stdin.readline().rstrip()
    list1 = line2.split(" ")
    line3 = sys.stdin.readline().rstrip()
    list2 = line3.split(" ")
    return int(list1[0]),int(list1[1]),list2

def main():
    t,a,h = readQuestion()
    answer = solve(t,a,h)
    print(answer)
    
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
li = []
s = 1000*(T-A)
for h in H:
    li.append(abs(s-6*h))
print(li.index(min(li))+1)

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

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

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

func = lambda x: abs(1000 * T - 6 * x - 1000 * A)
H = [func(val) for val in H]

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

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


if __name__ == '__main__':
    main()

Solution (Python):
from operator import itemgetter

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

a=[]
for i in range(N):
    temp = abs(T-h[i]*0.006 - A)
    a.append([i+1,temp])

a = sorted(a,key=itemgetter(1))

print(a[0][0])

Solution (Python):
n=int(input())
t,a=[int(i) for i in input().split()]
H=[int(i) for i in input().split()]
T=[]
for i in H:
  ti=abs(t-i*0.006-a)
  T.append(ti)
m=min(T)
i=T.index(m)
print(i+1)

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

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

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

Solution (Python):


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

avg_tmp = t - h[0] * 0.006
if a < avg_tmp:
    dif = avg_tmp - a
else:
    dif = a - avg_tmp
ans = 1
for i in range(1, n):
    avg_tmp = t - h[i] * 0.006
    if a < avg_tmp:
        sub_dif = avg_tmp - a
    else:
        sub_dif = a - avg_tmp
    if dif > sub_dif:
        dif = sub_dif
        ans = i + 1

print(ans)

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

X = (T-A)/0.006

for i in range(1, len(Hs)):
  if Hs[i] > X:
    xm = Hs[i] if abs(X - Hs[i-1]) > abs(X - Hs[i]) else Hs[i-1]
    print(H.index(xm)+1)
    exit()

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

place = 1
closest = abs(A - (T - H[0]*0.006))

for i in range(1,N):
    temperature = abs(A - (T - H[i]*0.006))
    if temperature < closest:
        place = i + 1
        closest = temperature

print(place)

Solution (Python):
import math
n = int(input())
s = input().split()
t = int(s[0])
a = int(s[1])
s = input().split()
ans = 0
dis = float('inf')
for i in range(n):
	h = int(s[i])
	d = abs(a - t + 0.006 * h)
	if (d < dis):
		dis = d
		ans = i + 1
print(ans)

Solution (Python):
n=int(input())
t,a=(int(i) for i in input().split(' '))
h=[int(i) for i in input().split(' ')]
T=[]
for i in range(n):
  T=T+[t-0.006*h[i]]
index=0
for i in range(n):
  if abs(T[i]-a)<abs(T[index]-a):
    index=i
print(index+1)

Solution (Python):
import math

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

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = math.fabs(A - (T - 0.006*n))
    if diff < diff_min:
        diff_min = diff
        diff_i = i + 1

print(diff_i)

Solution (Python):
n = input()
x = input().split()
y = input().split()

h = (int(x[0])-int(x[1]))/0.006

lag = 1000000
rec = 0
for i in y:
    if lag > abs(int(i)-h):
        lag = abs(int(i)-h)
        rec = i

num = y.index(rec)
print(int(num)+1)

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

Solution (Python):
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(t - 0.006*h[i]-a)
m = min(b)
print(b.index(m)+1)

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

dif = float("inf")

for i in range(N):
    temp = T - H[i] * 0.006
    dif2 = abs(A-temp)
    if dif2 < dif:
        dif = dif2
        ans = i

print(ans+1)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = float("inf")
answer = None

for i, h in enumerate(H):
    if abs(A - (T - h*0.006)) < result:
        result = abs(A - (T - h*0.006))
        answer = i + 1

print(answer)

Solution (Python):
n = int(input())
temp = list(map(int, input().split()))
palace = list(map(int, input().split()))

tmin = float("inf")
for i in range(n):
    t = temp[0] - palace[i] * 0.006
    a = abs(temp[1] - t)
    if a < tmin:
        tmin = a
        k = i + 1
    else:
        pass

print(k)

Solution (Python):
n = int(input())
t, a = (float(_) for _ in input().split())
h = [float(_) for _ in input().split()]
 
p = 0
ans = 9999999999
for i in range(n):
    at = t - h[i]*0.006
    if(abs(at-a) < ans):
        ans = abs(at-a)
        p = i+1
 
print(p)

Solution (Python):
n = int(input())
t, a = map(int, input().split())
ans = []
for i, x in enumerate(map(int, input().split())):
    ans.append((abs(t - x * 0.006 - a), i))
print(min(ans)[1] + 1)

Solution (Python):
n = int(input())
t, a = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
b = list()

for i in range(n):
  c = abs(a-(t-h[i]*0.006))
  b.append([c, i+1])
b.sort()
print(b[0][1])

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

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

Solution (Python):
n = int(input())
t, a = map(int, input().split())
listH = list(map(int, input().split()))

nearA=10000000
number=0
index=0
while index < len(listH):
    h = listH[index]
    if index ==0:
        nearA = max(t-h*0.006, a)-min(t-h*0.006, a)
        number = index+1
    elif max(t-h*0.006, a)-min(t-h*0.006, a)< nearA:
        nearA = max(t-h*0.006, a)-min(t-h*0.006, a)
        number = index+1
    index+=1

print(number)

Solution (Python):






N=int(input())





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





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





BestPoint = 0
SaishoSabun=100000000

for i in range(N):
    aaa = T - HList[i] * 0.006
    Sabun = abs(A - aaa)
    
    if SaishoSabun > Sabun:
        BestPoint = i
        SaishoSabun = Sabun

print(BestPoint+1)

Solution (Python):
import sys
n=int(input())
t,b=map(int,input().split())
h= [int(x) for x in input().split()]
temp=sys.maxsize
i=0
for a in h:
    val=t-(a*0.006)
    if (abs)(val-b) <temp :
        temp=(abs)(val-b)
        ans=i+1
    i+=1
print(ans)

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

Solution (Python):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
no=0
noabs=100000.0
for i in range(N):
    NT=T-H[i]*0.006
    if noabs>=abs(NT-A):
        no=i+1
        noabs=abs(NT-A)
print(no)

Solution (Python):
N = int(input())
T, A = map(int, input().split())
list_H = list(map(int, input().split()))
best = float('inf')
for i, H in enumerate(list_H):
    cost = abs(A - (T - H * 0.006))
    if cost < best:
        best = cost
        ind = i + 1
print(ind)

Solution (Python):
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)

Solution (Python):



















import math

def my_abs(x):
    if(x < 0):
        return (-x)
    else:
        return x


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

res = []
j = 0

for j in range(N):
    res.append(my_abs(A - (T - H[j]*0.006)))

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

Solution (Python):
import numpy as np

N = int(input())
T, A = input().split(" ")
y = int(T) - int(A)

H = input().split()
H = [abs((int(x) * 0.006) - y) for x in H]

T = np.array(H)
res = T.argmin()+1
print(res)

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

    z = []
    for x in h:
        t_x = abs(a - (t - x * 0.006))
        z.append(t_x)

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

if __name__ == "__main__":
    main()

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

    min = abs(a - h[0])
    i = 0

    for x in h:
        i += 1
        t_x = t - x * 0.006
        if abs(a - t_x) < min:
            min = abs(a - t_x)
            ans = i

    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
def ABC113B():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    for i in range(N):
        H[i] = T - H[i] * 0.006
    ansT = 1000000000
    ansN = 0
    for i in range(N):
        if abs(H[i] - A) <= ansT:
            ansT = abs(H[i] - A)
            ansN = i
    print(ansN + 1)
ABC113B()

Solution (Python):
n = int(input())
t, a = map(int, input().split())
k = (t-a)/0.006
li = list(map(int, input().split()))
ans = float("inf")
wer = 0
for i in range(n):
    if abs(k - li[i]) < ans:
        ans = abs(k - li[i])
        wer = i
print(wer+1)

Solution (Python):
import numpy as np

n = int(input())
listn = [i+1 for i in range(n)]
t,a= (int(i) for i in input().split())  
listx = [int(i) for i in input().split()]
b=np.array(listx)
b= abs(a-(t-0.006*b))

dictz=dict(zip(listn,b))

print( min(dictz, key=(lambda x: dictz[x])))

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

min_diff = 10 ** 10
ret = -1

for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    if min_diff > d:
        min_diff = d
        ret = i + 1

print(ret)

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

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

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

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

print(ans+1)

Solution (Python):
import numpy as np
def main():
    ttt = []
    n = int(input())
    N, M = map(int, input().split())
    e = list(map(int, input().split()))
    
    
    
    for j in range(n):
        t = N - e[j]*0.006
        tt = abs(M - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()