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())
hn = [int(num) for num in input().split()]

answers = []
for h in hn:
  answers.append(abs(a-t-h*0.006))
  
answer = answers[0]
for a in answers:
  if a < answer:
    answer = a
  
print(answers.index(answer)+1)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
l=list(map(int,input().split()))
m=math.inf
ans=0
for i in range(len(l)):
  res=t-(l[i]*0.006)
  if (a-res)<m:
    m=(a-res)
    ans=i+1 
if a>=0:
  print(i)
else:
  print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
mi = 1000000000
for i in range(n):
    if mi > a-(t-h[i]*0.006):
        mi = a-(t-h[i]*0.006)
        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(" ")))
avg_list = []
for i in range(0, n):
    avg_list.append(a - (t - h[i] * 0.006))
print(avg_list.index(min(avg_list)) + 1)

Submission status: Wrong Answer

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

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

for i in range(1, n):
    avg = abs(a - t - h[i] * 0.006)
    if avg < val:
        val = avg
        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()))
X=10000
Y=1
for i in range(N):
  H[i]=T-H[i]*6/1000
for i in range(N):
  if abs(H[i]-A)<X:
    X=abs(H[i]-X)
    Y+=i
print(Y)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
ans = 10**6
te = 0
I = int()
for i in range(N):
    te = T-H[i]*0.006
    if abs(A-te) < ans:
        ans = A-te
        I = 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()))
X=10000
for i in range(N):
  H[i]=T-H[i]*6/1000
for i in range(N):
  if abs(H[i]-A)<X:
    X=abs(H[i]-X)
print(X)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
ans = []
for i in range(n):
    average_tmp = t - H[i] * 0.006
    diff = (a - average_tmp)
    ans.append(diff)
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()))

ans = 100000
aa = 0
for i in range(n):
    if ans >= abs((T-0.006*H[i])-A):
        ans = abs((T-0.006*H[i])-A)
        aa = 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()))

ans = 100000
aa = 0
for i in range(n):
    if ans >= abs((T-0.006*H[i])-A):
        ans = abs((T-0.006*H[i])-A)
        aa = i
        
print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
t, a = rm()
ansv = 0
ansi = 0
for i, v in enumerate(rl()):
  if abs(a-t+v*0.006) < ansv:
    ansv = abs(a-t+v*0.006)
    ansi = i+1
print(ansi)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
m = 1 
mindis = abs(A-(T-H[0]*0.006))
for i in range(1,N):
  if mindis > abs(A-(T-H[i]*0.006)):
    m = i+1
    mindis = T-H[i]*0.006
print(m)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
m = 1 
mindis = T-H[0]*0.006
for i in range(1,N):
  if mindis > T-H[i]*0.006:
    m = i+1
    mindis = T-H[i]*0.006
print(m)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int, input().split()))
temp=[]
for i in range(n):
    x = t- h[i]*6//1000
    temp += [(i+1,abs(a-x))]
temp.sort(key=lambda x:x[1])
print(temp[0][0])

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = H[i]
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>t*(1000)-6*H[i]:
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
ans=0;m=100000000
A=A*1000
for i in range(N):
    if abs(A-((T-H[i])*6)) < m:m=abs(A-((T-H[i])*6));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()))
ans=0;m=100000000
for i in range(N):
    if abs(A-((T-H[i])*6)) < m:m=abs(A-((T-H[i])*6));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()))
idx=0
m=1000000000
for i in range(n):
    tmp=t-(h[i]*0.006)
    print(tmp)
    if abs(a-tmp)<m:
        idx=i
        m=abs(a-tmp)
print(idx+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

dic = []
for i in h:
  b = abs((i - t * 0.006) - a)
  dic.append(b)

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

Submission status: Wrong Answer

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

dic = []
for i in h:
  b = (i - t * 0.006) - a
  dic.append(b)

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

Submission status: Wrong Answer

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+i*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)

Submission status: Wrong Answer

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+i*0.006
    if m>abs(b):
        m=abs(b)
        k=i+1


print(k)

Submission status: Wrong Answer

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

k=0
m=100000000000000
for i in range(n):
    b=a-t+h[n-1]*0.006
    if m>=abs(b):
        m=abs(b)
        k=i


print(k)

Submission status: Wrong Answer

Solution code:
#n = 候補の数
n = int(input())
#t - h[i] * 0.006
#a = 基準温度
t,a = map(int,input().split())
h = list(map(int,input().split()))
#o = 計算結果格納
o = []

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

#p = 基準温度に最も近い場所の差
p = abs(a - h[0])
#q = 基準地点の番号
q = 0
for i in range(n)[1:]:
    if abs(a - o[i]) < p:
        p = abs(a - o[i])
        q = i

print(q + 1)

Submission status: Wrong Answer

Solution code:
#n = 候補の数
n = int(input())
#t - h[i] * 0.006
#a = 基準温度
t,a = map(int,input().split())
h = list(map(int,input().split()))
#o = 計算結果格納
o = []

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

#p = 基準温度に最も近い場所の差
p = abs(a - h[0])
#q = 基準地点の番号
q = 0
for i in range(n)[1:]:
    if abs(a - h[i]) < p:
        p = abs(a - h[i])
        q = i

print(q + 1)

Submission status: Wrong Answer

Solution code:
#n = 候補の数
n = int(input())
#t - h[i] * 0.006
#a = 基準温度
t,a = map(int,input().split())
h = list(map(int,input().split()))
#o = 計算結果格納
o = []

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

#p = 基準温度に最も近い場所の差
p = abs(h[0] - a)
#q = 基準地点の番号
q = 0
for i in range(n)[1:]:
    if abs(h[i] - a) < p:
        p = abs(h[i] - a)
        q = i

print(q + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
T, A = mapint()
Hs = list(mapint())
ths = [(abs(A-T*(x*0.006)), i+1) for i, x in enumerate(Hs)]
ths.sort()

print(ths[0][1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 0
for i in range(1, n):
    if abs(a - t - hh[ans] * 0.006) > abs(a - t - hh[i] * 0.006):
        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()))
a =[]
def cal(n):
  ans = T-n*6
  return ans
  
for i in H:
  a.append(int((A-cal(i))))
  
print(a.index(min(a))+1)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
mymin=10**6
index=0

for i in range(N):
  if(mymin>abs(A-(T-0.006*mylist[i]))):
    mymin=abs(A-(T-0.006*mylist[i]))
    index=i
print(index)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
mymin=10**6
index=0

for i in range(N):
  if(mymin>abs(A-(T-0.006*mylist[i]))):
    mymin=mylist[i]
    index=i
print(index)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
mymin=10**3
index=0

for i in range(N):
  if(mymin>abs(A-(T-0.006*mylist[i]))):
    mymin=mylist[i]
    index=i
print(index)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
min=10**3
index=0

for i in range(N):
  if(min>abs(A-(T-0.006*mylist[i]))):
    min=mylist[i]
    index=i
print(index)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
min=T
index=0

for i in range(N):
  if(min>abs(A-(T-0.006*mylist[i]))):
    min=mylist[i]
    index=i
print(index)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
mylist=list(map(int,input().split()))
min=T
index=0

for i in range(N):
  if(min>abs(T-0.006*mylist[i])):
    min=mylist[i]
    index=i
print(index)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
a =[]
def cal(n):
  ans = T-n*0.006
  return ans
  
for i in H:
  a.append(int((A-cal(i))))
  
print(a.index(min(a))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
a =[]
def cal(n):
  ans = T-n*0.006
  return ans
  
for i in H:
  a.append(int(abs(A-cal(i))))
  
print(min(a))

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
import bisect

N = i()
T,A = I()
H = l()
h = H
H.sort()
B = (T-A)/0.006
i = bisect.bisect_left(H,B)
if  (T-H[i-1]*0.006)-A > A-(T-H[i]*0.006):
    print(h.index(H[i])+1)
else:
    print(h.index(H[i-1])+1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list = []
    min = 10000000000
    d = [int(i) for i in input().split()]

    for i in d:
        c = c*1000
        a = b *1000 - i * 6 *1000
        diff = 0
        if (a > 0 and c > 0) or (a < 0 and c < 0):
            diff = abs(c - a)
        else:
            diff = abs(c + a)
        list.append(diff)
        if min > diff:
            min = diff
    print(list.index(min) + 1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        c = Decimal(c)
        a =Decimal(b)-Decimal(i)*Decimal(0.006)
        diff=0
        if (a > 0 and c >0 )or (a<0 and c<0):
            diff =abs(c-a)
        else:
            diff =abs(c+a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        c = Decimal(c)
        a =Decimal(b)-Decimal(i)*Decimal(0.006)
        diff=0
        if a > 0:
            diff =abs(c-a)
        else:
            diff =abs(c+a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =b-i*0.006
        diff=0
        if a > 0:
            diff =abs(c-a)
        else:
            diff =abs(c+a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =b-Decimal(i)*Decimal(0.006)
        diff=0
        if a > c:
            diff =abs(c+a)
        else:
            diff =abs(c-a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        diff=0
        if a < c:
            diff =abs(c+a)
        else:
            diff =abs(c-a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        diff=0
        if a > c:
            diff =abs(c+a)
        else:
            diff =abs(c-a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        if a > c:
            diff =abs(c+a)
        else:
            diff =abs(c-a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        diff =abs(c-a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)

Submission status: Wrong Answer

Solution code:
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 1000
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        list.append(abs(c-a))
        if min > abs(c-a):
            min=abs(c-a)
    print(list.index(min)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

def getNearestValue(list, num):


    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]
a = int(input())
x  = 0
lists = []
#bが気温c、standardが平均気温の基準
b,standard = map(int,input().split())
#標高
elev = list(map(int,input().split()))

for i in range(a):
    lists.append(int(b - elev[i] * 0.006))
print(getNearestValue(lists, standard)) # →0

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#ABC 113 B - Palace
import numpy as np
def getNearestIndex(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = [0] * N
resultNum = 0
Max = float("inf")
for i in range(N):
    result[i] = int(T - H[i] * 0.006)

resultNum = getNearestIndex(result, A)
print(resultNum + 1)

Submission status: Wrong Answer

Solution code:
#ABC 113 B - Palace
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = [0] * N
resultNum = 0
Max = float("inf")
for i in range(N):
    result[i] = int(T - H[i] * 0.006)

for i in range(N):
    if(A - abs(result[i]) <= Max):
        resultNum = i
        Max = A-abs(result[i])
print(resultNum + 1)

Submission status: Wrong Answer

Solution code:
#ABC 113 B - Palace
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = [0] * N
resultNum = 0
Max = float("inf")
for i in range(N):
    result[i] = int(T - H[i] * 0.006)

for i in range(N):
    if(abs(abs(A) - abs(result[i])) <= Max):
        resultNum = i
        Max = abs(A-result[i])
print(resultNum + 1)

Submission status: Wrong Answer

Solution code:
#ABC 113 B - Palace
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = [0] * N
resultNum = 0
Max = float("inf")
for i in range(N):
    result[i] = int(T - H[i] * 0.006)

for i in range(N):
    if(abs(A - result[i]) <= Max):
        resultNum = i
        Max = abs(A-result[i])
print(resultNum + 1)

Submission status: Wrong Answer

Solution code:
#ABC 113 B - Palace
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = [float("inf")] * len(H) 
Max = float("inf")
for i in range(len(H)):
    result[i] = int(T - H[i] * 0.006)
for i in range(len(result)):
    if(abs(A - result[i]) <= Max):
        resultNum = i
        Max = abs(A-result[i])
print(resultNum + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
hl = list(map(int, input().split()))
count = 1
ss = 1000000000
ans = 0
for h in hl:
    if t-h*0.006-a >= 0:
        if float(t-h*0.006-a) < ss:
            ans = count
            count+=1
        else:
            count+=1
    else:
        if float(-t+h*0.006+a) > -ss:
            ans = count
            count+=1
        else:
            count+=1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
kion=float('inf')
ans=1
for i in range(n):
    tmp=t-h[i]*0.006
    if tmp<=kion:
        ans=i
print(ans)

Submission status: Wrong Answer

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

near_i = -1
min_diff = 2*10**5 * 0.006
for i, h in enumerate(H):
    diff = abs(A - h * 0.006)
    if diff < min_diff:
        min_diff = diff
        near_i = i
print(near_i+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int, input().split())
h=list(map(int, input().split()))
m = 10**10
ans = []
for i in range(n):
    T = t-h[i]*0.006
    if m > abs(a-T):
        m = a-T
        ans.append(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()))
m = 10**10
for i in range(n):
    T = t-h[i]*0.006
    if m > abs(a-T):
        m = a-T
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
def solve():
    N = int(input())
    T, A = map(int, input().split())
    H = map(int, input().split())
    ans = float('inf')
    ans_i = 0
    for i, v in enumerate(H):
        tmp = abs(A - (T - 0.006 * v))
        print(A, T, v, T-v*0.006)
        if ans > tmp:
            ans_i = i
            ans = tmp
    print(ans_i+1)

if __name__ == '__main__':
    solve()

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

gap = 1000000000000000000000

H = np.asarray(H)

Tem = T-H*0.006

for i in range(N):
    if abs(H[i]-A)<gap:
        palace = i+1

print(palace)

Submission status: Wrong Answer

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

mn = None
for i in range(N):
    x = abs(A - abs(T - H[i] * 0.006))
    if mn is None or x < mn[1]:
        mn = (i, x)
print(mn[0] + 1)

Submission status: Wrong Answer

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

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

print(mn[0] + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

diff = abs( A - T - places[-1]*0.006)
num = N

for i in range(N-1):
  if diff > abs( A - T - places[i]*0.006):
    diff = abs( A - T - places[i]*0.006)
    num=int(i+1)

print(num)

Submission status: Wrong Answer

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

diff = abs( A - T - places[-1]*0.006)
num = N

for i in range(N-1):
  if diff > abs( A - T - places[i]*0.006):
    diff = abs( A - T - places[i]*0.006)
    num=i+1

print(num)

Submission status: Wrong Answer

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

diff = abs( A - T - places[-1]*0.006)
num = len(places)

for i in range(N-1):
  if diff > abs( A - T - places[i]*0.006):
    diff = abs( A - T - places[i]*0.006)
    num=i+1

print(num)

Submission status: Wrong Answer

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

diff = abs( A - T - places[-1]*0.006)
num = len(places)

for i in range(N-1):
  if diff > abs( A - T - places[i]*0.006):
    num=i+1

print(num)

Submission status: Wrong Answer

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

diff = abs( A - T - places[-1]*0.006)
num = len(places)

for i in range(N):
  if diff > abs( A - T - places[i]*0.006):
    num=i+1

print(num)

Submission status: Wrong Answer

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

check = []
append = check.append
for i, h in enumerate(H):
    append(
        {
            "index": i + 1,
            "temp": T - h * 0.006
        }
    )
check.sort(key=lambda x: A - x["temp"])

print(check[0]["index"])

Submission status: Wrong Answer

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

num=0.006

for i,j in enumerate(H):
    H[i]=int(((T-int(j)*num-A)**2)**0.5)

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

Submission status: Wrong Answer

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

min_d = 1000
ans = 0
for i in range(N):
    t = T - H[i] * 0.006
    d = abs(t - A)
    if d < min_d:
        min_d = d
        ans = i
        
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    cand = -1
    diff = 1000000
    for i, h in enumerate(H):
        if abs(A - (T - h * 0.006)) < diff:
            cand = i + 1
            diff = abs(A - (T - h * 0.06))
    print(cand)



if __name__ == "__main__":
    main()