Problem:


Score: 200 points

Problem Statement

A country decides to build a palace.

In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.

There are N places proposed for the place. The elevation of Place i is H_i meters.

Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.

Print the index of the place where the palace should be built.

It is guaranteed that the solution is unique.

Constraints

1 \leq N \leq 1000

0 \leq T \leq 50

-60 \leq A \leq T

0 \leq H_i \leq 10^5

All values in input are integers.

The solution is unique.

Input

Input is given from Standard Input in the following format:

N
T A
H_1 H_2 ... H_N

Output

Print the index of the place where the palace should be built.

Sample Input 1

2
12 5
1000 2000

Sample Output 1

1

The average temperature of Place 1 is 12-1000 \times 0.006=6 degrees Celsius.

The average temperature of Place 2 is 12-2000 \times 0.006=0 degrees Celsius.

Thus, the palace should be built at Place 1.

Sample Input 2

3
21 -11
81234 94124 52141

Sample Output 2

3



Sample input:
2
12 5
1000 2000


Sample output:
1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
T, A = [int(x) for x in input().split(" ")]
H_list = np.array([int(x) for x in input().split(" ")])

ave_list = T - (H_list * 0.006)

res_point = 0
res_ave = 99999

print(ave_list)
for enu, ave in enumerate(ave_list):
    if abs(res_ave - A) > abs(ave - A):
        res_ave = ave
        res_point = enu + 1
print(res_point)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int,input().split())
li = list(map(int,input().split()))
n_temp = 1000
answer = -1
for idx, temp in enumerate(li):
    i_temp = int(t - temp * 0.006)
    if (abs(a - n_temp) > abs(a -i_temp)):
        n_temp = i_temp
        answer = idx

print(answer+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
kouho=list(map(int,input().split()))
answer=1
ansc=abs(m[0]-(m[1]-kouho[0]*0.006))
for i in range(n):
    if abs(m[0]-(m[1]-kouho[i]*0.006))<ansc:
        ansc=abs(m[0]-(m[1]-kouho[i]*0.006))
        answer=i+1
print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
dif = abs(T - H[0] * 0.006 - A)
result = 1

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

print(result)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(float,input().split())
Areal=(A-T)//0.0006*(-1)
x=list(map(float,input().split()))
point=0
for i in range(N):
    if x[point]-Areal > x[i]-Areal:
        point=i
print(point+1)

Submission status: Wrong Answer

Solution code:
def solve(N, T, A, H):
  best = (T - A) * 500 / 3
  index = -1
  diff = 10001
  for i in range(N):
    d = abs(best - H[i])
    if d < diff:
      diff = d
      index = i
  return i + 1

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

# print outputs
print(solve(N, T, A, H))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
T,A = map(int,input().split())
ans = 0
a = ''
c = 0
for i in input().split():
    c += 1
    x = T - int(i) * 0.006
    b = abs(abs(x) - abs(A))
    if a == '' or a > b:
        ans = c
        a = b
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=input().split()
t=int(s[0])
a=int(s[1])
s=input().split()
best=100000000000000000
res=-1
for i in range(n):
    h=int(s[i])
    if best>abs(t-h*0.006):
        best=abs(a-t+h*0.006)
        res=i+1
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

d=[]
l={}
for i in range(n):
  x=h[i]
  avg_t= t - int(x * 0.006)
  d.append(abs(avg_t - a))
  l[d[i]]=i+1

min=min(d)
print (l[min])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
Y = []
for i in range(n):
    tmp = t - H[i]*0.006
    Y.append(abs(tmp-a))
miny = Y[0]
for item in Y:
    miny = min(miny, item)
print(Y)
res = Y.index(miny)
print(res+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
heights = input().split()
heights = [int(x) for x in heights]
best_H = (T - A) / 0.006
s_heights = sorted(heights)
diff_l, diff_h = 100000,100000
n_l,n_h = 0,N-1
for i in range(N):
  if s_heights[i] < best_H:
    if (best_H - s_heights[i]) < diff_l:
      diff_l = (best_H - s_heights[i])
      n_l = i
    else:
      if (best_H - s_heights[i]) < diff_h:
        diff_h = (s_heights[i] - best_H)
        n_h = i
if diff_l < diff_h:
  print(n_l+1)
else:
  print(n_h+1)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
n=int(input())
t,a=map(int,input().split())
h=[int(i) for i in input().split()]
ans=[0,abs(a-t-h[0]*0.006)]
for i in range(1,n):
    tmp=abs(a-t-h[i]*0.006)
    if tmp<ans[1]: ans=[i,tmp]
print(ans[0]+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

d=[]
l={}
for i in range(n):
  x=h[i]
  avg_t= int(t - x * 0.006)
  d.append(abs(avg_t - a))
  l[d[i]]=i+1

min=min(d)
print (l[min])

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
count = 0
_min = 0
for i in range(N):
	count +=1
	#print(count)
	#print(i*0.006)
	if H[_min]*0.006 >= H[i]*0.006:
		_min = i
	
print(_min+1)

Submission status: Wrong Answer

Solution code:
# your code goes here
n=int(input())
a,b=map(int,input().split())
c=list(map(int,input().split()))
mi=(10000000000,-1)
for i in range(len(c)):
	mi=min(mi,(abs(a-c[i]*0.006),i))
print(mi[1]+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    t, a = list(map(float, input().split(' ')))

    min_diff = 100000000000000000000000000
    min_index = -1
    hs = list(map(float, input().split(' ')))
    for i in range(n):
        h = hs[i]
        cu_diff = abs(a - (t - h * 0.006))
        print(cu_diff)
        if cu_diff < min_diff:
            min_diff = cu_diff
            min_index = i

    print(min_index+1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# your code goes here
n=int(input())
a,b=map(int,input().split())
c=list(map(int,input().split()))
mi=(10000000000,-1)
for i in range(len(c)):
	mi=min(mi,(abs(c[i]-a),i))
print(mi[1]+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())
[t,a] = [int(i) for i in input().split()]
h =[int(i) for i in input().split()]
c = {}
for i in range(len(h)):
    c[int(abs(a - t-0.06*h[i]))] = i

print(c[min(c.keys())]+1)

Submission status: Wrong Answer

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

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

tmp_dif = [a- (t - h[i]*0.006) for i in range(len(h))]
#print(tmp_dif)

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

Submission status: Wrong Answer

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

for i in range(n):
    li_2.append(abs(a - t +li[i]))
    
x = li_2.index(min(li_2)) + 1
print(x)

Submission status: Wrong Answer

Solution code:
n=int(input())

[t, a]=[int(i) for i in input().split()]

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

ans=[]
for i in h:
    temp=t-a-0.006*i
    if temp <0:
        ans.append(temp*-1)
    else:
        ans.append(temp)

mi=ans[0]
num=-1
for j, i in enumerate(ans):
#    print(j,i)
    #print(mi, i)
    if mi > i:
        mi=i
        num=j

print(num+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
kouho=list(map(int,input().split()))
answer=1
ansc=abs(m[1]-kouho[0]*0.006)
for i in range(n):
    if abs(m[1]-kouho[i]*0.006)<ansc:
        ansc=abs(m[1]-kouho[i]*0.006)
        answer=i+1
print(answer)

Submission status: Wrong Answer

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

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(float,input().split())
Areal=(A-T)//0.0006
x=list(map(float,input().split()))
point=0
for i in range(N):
    if x[point]-Areal > x[i]-Areal:
        point=i
print(point+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = tmp
        tmpa = i
print(tmpa + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

l = [A - t(h) for h in H]

a = min(l)

cnt = 1
for x in l:
    if a == x:
        print(cnt)
    else:
        cnt += 1

Submission status: Wrong Answer

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

d=[]
l={}
for i in range(n):
  x=h[i]
  avg_t= t - x * 0.006
  d.append(int(abs(avg_t - a)))
  l[d[i]]=i+1

min=min(d)
print (l[min])

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    t, a = list(map(float, input().split(' ')))

    min_diff = 100000000000000000000000000
    min_index = -1
    hs = list(map(float, input().split(' ')))
    for i in range(n):
        h = hs[i]
        cu_diff = abs(a - t - h * 0.006)
        if cu_diff < min_diff:
            min_diff = cu_diff
            min_index = i

    print(min_index+1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
data = input().split(' ')
data[0], data[1] = int(data[0]), int(data[1])

H = input().split(' ')

m = 100
j = 0
for i in range(len(H)):
  t = data[0] - (int(H[i]) * 0.006)
  if m > abs(data[1] - t):
    m = abs(data[1] - t)
    j = i
    
print(j + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
kouho=list(map(int,input().split()))
answer=1
ansc=abs(kouho[0]-m[1])
for i in range(n):
    if abs(kouho[i]-m[1])<ansc:
        ansc=abs(kouho[i]-m[1])
        answer=i+1
print(answer)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
iN = int(input())
iT,iA = [int(_) for _ in input().split()]
aH = list(map(lambda x: abs(iT-x*0.006 -iA) , [int(_) for _ in input().split()]))
print(aH)
iMin = min(aH)
for i in range(iN):
    if aH[i] == iMin :
        print(i+1)
        exit()

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A,=map(float,input().split())
Areal=(A-T)//0.0006
x=list(map(float,input().split()))
point=0
for i in range(N):
    if x[point]-Areal > x[i]-Areal:
        point=i
print(point+1)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    t, a = list(map(float, input().split(' ')))

    min_diff = 1000000000
    min_index = -1
    hs = list(map(float, input().split(' ')))
    for i in range(n):
        h = hs[i]
        cu_diff = abs(a - t - h * 0.006)
        if cu_diff < min_diff:
            min_diff = cu_diff
            min_index = i

    print(min_index+1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
t=l[0]
a=l[1]
ll=list(map(int,input().split()))

q=0
d=abs(ll[0]-a)
for i in range(1,n):
    if abs(ll[i]-a)<d:
        q=i
        d=abs(ll[i]-a)
print(q+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

res = - 1
res_val = 100000
for i in range(N):
    av_temp = T - H[i] * 0.006
    if res_val > abs(av_temp - A):
        res = i
        res_val = int(abs(av_temp - A))

print(res+1)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().strip())
t, A = list(map(int, stdin.readline().split()))
h = list(map(int, stdin.readline().split()))

temp = []
for i in range(n):
    temp.append(int(t - h[i]*0.006))

dist = float('inf')
index = 0
for i, num in enumerate(temp):
    boo = abs(A - num)
    if boo < dist:
        dist = boo
        index = i

print(index+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
B = input().split(' ')
T = int(B[0])
A = int(B[1])
H = [int(x) for x in input().split(' ')]

ave = [abs(x-A) for x in H]
idx = ave.index(min(ave)) + 1
print(idx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
m=list(map(int,input().split()))
kouho=list(map(int,input().split()))
answer=1
ansc=abs(kouho[0]-m[1])
for i in range(n):
    if kouho[i]-m[1]<ansc:
        ansc=kouho[i]-m[1]
        answer=i+1
print(answer)

Submission status: Wrong Answer

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] = t - 0.06*h[i]
m = float('inf')
for i in range(n):
    if abs(a-b[i]) < m:
        ans = i+1
        m = abs(a-b[i])
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a *= 1000
t *= 1000

d = abs(a - t - h[0]*6)
ans = 0
for i in range(n):
    td = abs(a - t - h[i]*6)
    if td < d:
        d = td
        ans = i

print(ans + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
Y = []
res = 1
for i in range(n):
    tmp = int(t - H[i]*0.006)
    Y.append(abs(tmp-a))
miny = Y[0]
for item in Y:
    miny = min(miny, item)

res = Y.index(miny)
print(res+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
X = list(map(int,input().split()))
res = 100000000
j = 1
for i in X:
    a = abs(A - T-i*0.006)
    if(res > a):
        res = a
        res1=j        
    j+=1
print(res1)

Submission status: Wrong Answer

Solution code:
n = int(input())
[t,a] = [int(i) for i in input().split()]
h =[int(i) for i in input().split()]
c = {}
for i in range(len(h)):
    c[abs(a - h[i])] = i

print(c[min(c.keys())]+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
best = float("inf")
bestidx = 1

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

index = 1
for i in H:
    cantidate = abs(A - T - i * 0.006)
    if cantidate < best:
        bestidx = index
        best = cantidate
    index += 1
print(bestidx)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T, A = map(int,input().split())
H = [int(x) for x in input().split()]
h = [int(T - (x * 0.006)) for x in H]

def getNearestValue(list, num):

    # 昇順に挿入する際のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]

print(h.index(getNearestValue(h, A)) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
data = input().split(' ')
data[0], data[1] = int(data[0]), int(data[1])

H = input().split(' ')

m = 100
j = 0
for i in range(len(H)):
  t = data[0] - int(H[i]) * 0.006
  if m > abs(data[1] - t):
    m = abs(data[1] - t)
    j = i
    
print(j + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

D = 99999999
R = 0

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

print(R)

Submission status: Wrong Answer

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

#print(H)
H2 = list(enumerate(H))
H2.sort(key=lambda x: x[1])
print(H2[0][0]+1)

Submission status: Wrong Answer

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

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

print(ans+1)

Submission status: Wrong Answer

Solution code:
from sys import stdin

N = int(stdin.readline().rstrip())
T, A = [int(a) for a in stdin.readline().rstrip().split()]
H = [int(a) for a in stdin.readline().rstrip().split()]

ans = 0
min_sub = 100000
for i in range(len(H)):
    tmp = T + 0.006 * H[i]
    sub = abs(A - tmp)
    if (sub < min_sub):
        ans = i
        min_sub = sub

print(ans + 1)

Submission status: Wrong Answer

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

h = 9999999
index = -1
for i, Hi in enumerate(H):
    if a - (t - 0.006*Hi) <= a - (t - 0.006*h):
        h = Hi
        index = i + 1
print(index)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
X = list(map(int,input().split()))
res = 10000
j = 1
for i in X:
    a = abs(A - T-i*0.006)
    if(res > a):
        res = a
        res1=j        
    j+=1
print(res1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
dif = abs(H[0] - A)
result = 1

for i in range(1, N):
    if abs(H[i] - A) < dif:
        result = i + 1

print(result)

Submission status: Wrong Answer

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

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

print(ans + 1)

Submission status: Wrong Answer

Solution code:
T=int(input())
a,b=map(int,input().split())
ll=list(map(int,input().split()))
mins=0
for i in range(len(ll)):
    ans=a-0.006*ll[i]
    if abs(ans-b)<abs(b-ll[mins]):
        mins=i

print(mins+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
T=int(input())
a,b=map(int,input().split())
ll=list(map(int,input().split()))
mins=0
for i in range(len(ll)):
    ans=a-0.006*ll[i]
    if abs(ans-b)<abs(ans-ll[mins]):
        mins=i

print(mins+1)

Submission status: Wrong Answer

Solution code:
import sys

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

ans_a = sys.maxsize

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

print(ans)

Submission status: Wrong Answer

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 - t)
    if diff < ans:
        ans = diff
        pans = i

print pans + 1

Submission status: Wrong Answer

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] = t - 0.06*h[i]
m = float('inf')
for i in range(n):
    if abs(a-b[i]) <= m:
        ans = i+1
        m = abs(a-b[i])
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

temp = np.argsort([abs(T-h) for h in H])[0]
print(temp+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

best_d = float('inf')
best_i = -1

for i,x in enumerate(H):
    t = T - x * 0.006
    d = abs(T - t)
    if d < best_d:
        best_d = d
        best_i = i
print(best_i + 1)

Submission status: Wrong Answer

Solution code:
num = input()
a = input().split()
a = [int(i) for i in a]
b = input().split()
b = [abs(a[0] * int(i) - a[1]) for i in b]
print(1 + b.index(min(b)))

Submission status: Wrong Answer

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
t,a=map(int,input().split())
ln=[int(h) for h in input().split()]
ln = sorted(ln)
i=0
for h in ln:
    while (t-h*0.006)<=a:
        i+=1
print(min(ln[i],ln[i+1]).index())

Submission status: Accepted

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

Submission status: Accepted

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

x = t - l[0] * 0.006
ans = []
for x in l:
    x = t - x * 0.006
    y = a - x
    ans.append(abs(y))

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

Submission status: Accepted

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

x = t - l[0] * 0.006
tmp = []
for x in l:
    x = t - x * 0.006
    tmp.append(x)

ans = []

for z in tmp:
    y = a - z
    ans.append(abs(y))

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

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

Submission status: Accepted

Solution code:
from typing import List


def answer(n: int, t: int, a: int, hs: List[int]) -> int:
    import sys
    
    result = 0
    temperature_difference = sys.maxsize
    
    for i, h in enumerate(hs, start=1):
        temp = abs(a - (t - h * 0.006))
        if temp < temperature_difference:
            temperature_difference = temp
            result = i

    return result


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

index = 0
ans = 10**10
for i in range(N):
  tmp = T - 0.006*H[i]
  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()))
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(float,input().split())
h = list(map(float,input().split()))
best = 10 ** 5
ans = -1
for i in range(n):
    tt = t - h[i] * 0.006
    best = min(best,abs(tt - a))
    if abs(a - tt) == best:
        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=[]
for i in range(n):
    temp=t-h[i]*0.006
    s=abs(temp-a)
    ans.append(s)
print(ans.index(min(ans))+1)

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
t, a = map(int,input().split())
li = list(map(int, input().split())) #数値

t = t*1000
a = a*1000
npli = np.array(li)
npli = t-npli*6

res = npli[0]
res_num = 1
for i in range(n):
    # print(abs(res),abs(npli[i]),res_num)
    if abs(a-res) > abs(a-npli[i]):
        res = npli[i]
        res_num = i+1
print(res_num)

Submission status: Accepted

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

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

minimum = min(diff)
ans = diff.index(minimum) + 1

print(ans)