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()))
num=[]
ans=float("inf")
for i in range(n):
    num.append(t-0.06*h[i])
for i in range(n):
    temp=h[i]-a
    if temp<ans:
        ans=temp
        cnt=i+1
print(cnt)

Submission status: Wrong Answer

Solution code:
# -*- utf-8 -*-
n = int(input())
z = raw_input().split(" ")
t = float(z[0])
a = float(z[1])

q = raw_input().split(" ")

h = []
for i in range(n):
	h.append(float(q[i]))

num = 0
av = 10000.0

for j in range(n):
	ave = t - h[j] * 0.006
	if ave < 0:
		ave = ave * -1
	if (ave <= av):
		num = j
		av = ave
	
print num

Submission status: Wrong Answer

Solution code:
N = input()
TandA = raw_input().split(" ")
High = raw_input().split(" ")
T = TandA[0]
A = int(TandA[1])
length = []

for x in High:
    length.append(A - (int(T) - int(x) * 0.006))
    
print length.index(min(length)) + 1

Submission status: Wrong Answer

Solution code:
# -*- utf-8 -*-
n = int(input())
z = raw_input().split(" ")
t = float(z[0])
a = float(z[1])

q = raw_input().split(" ")

h = []
for i in range(n):
	h.append(float(q[i]))

num = 0
av = 10000.0

for j in range(n):
	ave = t - h[j] * 0.006
	if (ave <= av):
		num = j
		av = ave
	
print num

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
tt=0
tt_1=0
tt_2=0
a=0
b=0

t_list=[]
t_list_2=[]
for val in h:
	tt=t-(val*0.006)
	t_list.append(tt)

for val in t_list:
	tt=abs(t-val)
	t_list_2.append(tt)

t_list_2=sorted(t_list_2)
tt=t_list_2[0]
tt_1=t+tt
tt_2=t-tt

def my_index(t_list,x,default=False):
	if x in t_list:
		return t_list.index(x)
	else:
		return -1
a=my_index(t_list,tt_1)
b=my_index(t_list,tt_2)
if my_index(t_list,tt_1) == -1:
	print(b+1)
else :
	print(a+1)

Submission status: Wrong Answer

Solution code:
n=input()
t,a=input().split()
b=input().split()
n=int(n)
t=int(t)
a=int(a)
min=1000
for i in range(n):
     diff=abs(a-t+0.006*int(b[i]))
     id=i+1 if min>diff else id
print(id)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = input().split()
differ = [0]*N
for i in range(N):
 differ[i] = A - (T - int(H[i])*0.006)
differ = np.array(differ)
print(differ.argmin()+1)

Submission status: Wrong Answer

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

result = 0
min = 0

for i, target in enumerate(targets):
  temp = int(int(T) - int(int(target) * 0.006))
  temp2 = abs(int(A) - int(temp))
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2

print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(float,input().split())
list = input().split()
list = map(float,list)
alist = []
count = 0
for h in list:
	count += 1
	temp = abs(a) - (abs(t) - abs((h*0.006)))
	#print(temp)
	alist.append(abs(temp))

x = min(alist)
#print(x)
answer = alist.index(x)

print(answer + 1,end='')

Submission status: Wrong Answer

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

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(map(lambda h: t - h*0.006, H))
#print(H2)
min_ = 100000000
min_i = -1
for i, h in enumerate(H):
    diff = abs(t-(t-h*0.006))
    if diff < min_:
        min_ = diff
        min_i = i + 1
print(min_i)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(float,input().split())
list = input().split()
list = map(float,list)
alist = []
count = 0
for h in list:
	count += 1
	temp = abs(a) - (abs(t) - abs((h*0.006)))
	#print(temp)
	alist.append(abs(temp))

x = min(alist)
print(x)
answer = alist.index(x)

print(answer + 1,end='')

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(x) for x in input().split(" ")]
H_list = [int(x) for x in input().split(" ")]

ave_list = [T - (H * 0.006) for H in H_list]

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] = [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.006*h[i])+1))] = i

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
tem = 1000
z = 0
for i in h:
  c = t-0.006*i
  d = c - a
  e = tem - a
  if d**2 < e**2:
    tem = c
    z = i 
print(z+1)

Submission status: Wrong Answer

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

result = 0
min = 0

for i, target in enumerate(targets):
  temp = int(int(T) - int(target) * 0.006)
  temp2 = abs(int(A) - int(temp))
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
  
print(result)

Submission status: Wrong Answer

Solution code:
def m():
    n = int(input())
    t, a = map(int, input().split())
    h = list(map(int, input().split()))
    b = []
    diff = 10 ** 6
    ans = 0
    for i in range(n):
        tmp = t - int(h[i] * 0.006)
        d = abs(tmp - a)
        b.append((d, i+1))
    b.sort(key=lambda x: x[0])
    return b[0][1]
print(m())

Submission status: Wrong Answer

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

test = False

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

def main():
    d = {}
    for i in range(N):
        ave_T = T - (H[i] * 0.06)
        d['{}'.format(i+1)] = abs(A - ave_T)
    if test:
        print(d)

    min_k = min(d, key=d.get)
    print(min_k)


if __name__ == '__main__':
    main()


"""
https://note.nkmk.me/python-dict-value-max-min/
"""

Submission status: Wrong Answer

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

for i in range(n):
    k = int(abs(a - (t - h[i] * 0.006)))
    if i == 0:
        g = k
        p = 0
    else:
        if g > k:
            g = k
            p = i

print(p+1)

Submission status: Wrong Answer

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

result = 0
min = 0

for i, target in enumerate(targets):
  temp = int(int(T) - int(target) * 0.006)
  temp2 = abs(int(A) - int(temp))
  print(int(A))
  print(temp)
  print(temp2)
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
  
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(float,input().split())
list = input().split()
list = map(float,list)
alist = []
count = 0
for h in list:
	count += 1
	temp = abs(a) - (abs(t) - (h*0.006))
	#print(temp)
	alist.append(temp)

x = min(alist)
answer = alist.index(x)

print(answer + 1,end='')

Submission status: Wrong Answer

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

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(map(lambda h: t - h*0.006, H))
#print(H2)
near = 100000000
near_i = -1
for i, t2 in enumerate(H2):
    diff = abs(t-t2)
    if diff < near:
        near = diff
        near_i = i + 1
print(near_i)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
i=0
min_w=1000000
p=0
h=input().split()
while i<n:
    w=a-(t-int(h[i])*0.006)
    if abs(w)<min_w:
        min_w=w
        p=i
    i+=1
print(p+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
T, A = map(float, input().split())
h = list(map(float, input().split()))
ans = 1

temp = abs(T-h[0]*0.006-A)
for i in range(1,n):
    temp0 = temp
    temp = abs(T-h[i]*0.006-A)
    if(temp<temp0):
        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()))
k = []

for i in range(n):
    k = int(abs(a - t - h[i] * 0.006))
    if i == 0:
        g = k
        p = 0
    else:
        if g > k:
            g = k
            p = i

print(p+1)

Submission status: Wrong Answer

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

result =0

temp = abs((T - H[0]*0.006) - A)
temp2 = temp

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

print(result)

Submission status: Wrong Answer

Solution code:
# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

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

s = 0
mn = 1 << 25
for i in range(N):
    t = abs(A - abs(T - H[i] * 0.006))
    if (mn >= t):
        s = i + 1
        mn = t
print(s)

Submission status: Wrong Answer

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

best_point=0
best=float('inf')
i=0
for hi in h:
    tmp = t - (hi * 0.006)
    dif = abs(a - tmp)
    if abs(dif) < abs(best):
        best = dif
        best_point = i + 1
        print(best_point)
    i += 1
print(best_point)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = input().split()
differ = [0]*N
for i in range(N):
 differ[i] = abs(A - (T - int(H[i])*0.006))
differ = np.array(differ)
print(differ.argmax())

Submission status: Wrong Answer

Solution code:
n = int(input())
T, A = map(float, input().split())
h = list(map(float, input().split()))
ans = 1

temp = abs(T-h[0]*0.006-A)
for i in range(1,n):
    temp0 = temp
    temp = abs(T-h[i]*0.006-A)
    if(temp<=temp0):
        ans = i+1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(float,input().split())
list = input().split()
list = map(float,list)
alist = []
count = 0
for h in list:
	count += 1
	temp = abs(a) - (abs(t) - (h*0.006))
	#print(temp)
	alist.append(int(temp))

x = min(alist)
answer = alist.index(x)

print(answer + 1,end='')

Submission status: Wrong Answer

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

for i in range(N):
    ans = int(T - H[i]*0.006)
    compare.append(int(abs(ans - A)))
    Min = min(compare)
    #print('ans{}'.format(ans))
    #print('差：{}'.format(int(abs(ans - A))))
print(compare.index(Min)+1)
#print(T,A)
#print(H)
#print('compare:{}'.format(compare))

Submission status: Wrong Answer

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

result = 0
min = 0

for i, target in enumerate(targets):
  temp = int(T) - int(target) * 0.006
  temp2 = abs(int(A) - int(temp))
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
  
print(result)

Submission status: Wrong Answer

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

result =0

temp = abs((T - H[0]*0.006) - A)
temp2 = temp

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

print(result)

Submission status: Wrong Answer

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

temp_list = [abs((t-h*0.006)-a) for h in h_list]
print(temp_list)
ans = temp_list.index(min(temp_list))+1

print(ans)

Submission status: Wrong Answer

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

def average_temperature(x):
    global T
    return T - x*0.006

r = list(map(average_temperature,H))
print(r)
a = []
for i in range(len(H)):
    c = A - r[i]
    a.append((i,abs(c),))

b = sorted(a,key=lambda x:x[1])
print(b[0][0]+1)

Submission status: Wrong Answer

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

result = 0
min = 0

for i, target in enumerate(targets):
  temp = int(T) - int(target) * 0.006
  temp2 = int(A) - int(temp)
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
  
print(result)

Submission status: Wrong Answer

Solution code:
def solve(N, T, A, H):
  best = (T - A) / 0.006
  index = -1
  diff = -1
  for i in range(N):
    d = abs(best - H[i])
    if diff == -1 or 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:
N = int(raw_input())
T, A = map(int, raw_input().split(" "))

H = map(int, raw_input().split(" "))
index = 0
closet = abs(T - 0.006*H[0] - A)
for i in range(1, N):
    diff = abs(T - 0.006*(H[i]) - A)
    print diff
    if diff == 0:
        index = i
        break
    elif diff < closet:
        closet, index = diff, i
print index + 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input()) # 宮殿の候補数
t,a = map(int,input().split())
x_li = list(map(int,input().split())) #標高のリスト

x_temp_li = []
x_a_li = []
for i in x_li:
    temp = t - i * 0.006
    x_temp_li.append(temp)

print(x_temp_li)

for i in x_temp_li:
    temp_a = i - a
    x_a_li.append(abs(temp_a))
    print(abs(temp_a))
print(x_a_li.index(min(x_a_li)) + 1)

Submission status: Wrong Answer

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

for i in range(n):
    k.append(int(t - h[i] * 0.006))
    if i == 0:
        g = abs(a - k[i])
        p = i
    else:
        if g > abs(a-k[i]):
            g = abs(a-k[i])
            p = i

print(p+1)

Submission status: Wrong Answer

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

temp_list = [abs(((t-h)*0.006)-a) for h in h_list]
ans = temp_list.index(min(temp_list))+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=int(0)
c1 = int(0)
c2 = int(1000000000)
for i in range(n):
    c1 = a-(t-(h[i]*0.0006))
    c1 = abs(c1)
    print("c1",c1)
    if c1 <= c2:
        ans = i+1
    c2 = c1
print(ans)

Submission status: Wrong Answer

Solution code:
#B - Palace
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*0.006) for h in H])[0]
print(temp+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
i=0
min_w=100000
p=0
h=input().split()
while i<n:
    w=a-(t-int(h[i])*0.006)
    if abs(w)<min_w:
        min_w=w
        p=i
    i+=1
print(p+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:
import math
N = int(input())
T,A = map(int,input().split(" "))
H = list(map(int,input().split(" ")))

def average_temperature(x):
    global T
    return math.ceil(T - x*0.006)

r = list(map(average_temperature,H))

a = []
for i in range(len(H)):
    c = A - r[i]
    a.append((i,abs(c),))

b = sorted(a,key=lambda x:x[1])
print(b[0][0]+1)

Submission status: Wrong Answer

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

# print(N)
# print(T)
# print(A)
# print(targets)

result = 0
min = 10000000

for i, target in enumerate(targets):
  temp = int(T) - int(target) * 0.006
  temp2 = int(A) - temp
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
  
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
ta = list(map(int,input().split()))
h = list(map(int,input().split()))
temp = []
for i in h:
  temp = temp + [ta[0] - i * 0.006]
jaj = ta[1]-temp[0]
if (jaj < 0):
  jaj *= -1
sa = jaj
loop = 1
ans = 1
for i in temp:
  j = ta[1]-i
  if (j<0):
    j *= -1
  if (j < sa):
    ans = loop
  loop += 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=int(0)
c1 = int(0)
c2 = int(1000000000)
for i in range(n):
    c1 = a-(t-(h[i]*0.0006))
    if c1 <= c2:
        ans = i+1
    c2 = c1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

t, a = map(int, input().split())

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

diff = []

for h in list_h:
  diff.append(abs(a - h * 0.006))
  
print(diff.index(min(diff)) + 1)

Submission status: Wrong Answer

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

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

import numpy as np
H = list(map(int, input().split()))

X = np.zeros(N)
Y = np.zeros(N)
for i in range(N):
    X[i] = T - H[i] * 0.006
    Y[i] = abs(X[i] - A)

a = 0

for i in range(N-1):
    if Y[i] < Y[i+1]:
        continue
    else:
        a = i+1
    
print(a+1)

Submission status: Wrong Answer

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

temp_list = [abs(a-((t-h)*0.006)) for h in h_list]
ans = temp_list.index(min(temp_list))+1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(float,input().split())
list = input().split()
list = map(float,list)
alist = []
count = 0
for h in list:
	count += 1
	temp = a - (t - (h*0.006))
	alist.append(abs(int(temp)))

x = min(alist)
answer = alist.index(x)

print(answer + 1,end='')

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

H_T = [0 for i in range(len(H))]
for i in range(len(H)):
    H_T[i] = float(T) - float(H[i])*0.006

min = 50
index = 0
for i in range(len(H_T)):
    if(abs(H_T[i] - A) < min):
        index = i
        min = abs(H_T[i] - A)
print(index+1)

Submission status: Wrong Answer

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

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

print(compare.index(Min)+1)

Submission status: Wrong Answer

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

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

t = []
for i in range(N):
    t.append(int(T - H[i] * 0.006))

idx = np.abs(np.asarray(t) - A).argmin()
print(idx + 1)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = input()
T, A = map(int, input().split())
H_list = []
H_list = list(map(int, input().split()))
T_list = np.array(list(map(lambda x :T - (x * 0.006), H_list)))
index = np.argmax(T_list)
print(index + 1)

Submission status: Wrong Answer

Solution code:
#coding : UTF-8

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

flag = 1
num = 0
for i,h in enumerate(H):
    t = float(T) -(float(h)*0.006)
    a = abs(t-A) 
    if flag == 1 :
        ans = a
        num = i
        flag = 0
    else :
        if ans > a:
            ans = a
            num = i

print (i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int,input().split())
li = list(map(int,input().split()))
n_temp = li[0]
answer = 0
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()))
mini=100000000
ans=0
for i in range(n):
    if abs(t-h[i]*0.006-a)<mini:
        mini=abs(t-h[i]*0.006-1)
        ans=i
print(ans+1)

Submission status: Wrong Answer

Solution code:
import numpy as np

def getNearValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

for i in range(len(H)):
    H[i] = 12-H[i]*0.006

ans = getNearValue(H, A)
print(H.index(ans)+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = map(int,input().split())
tem = 1000
for i in h:
  c = t-0.006*i
  d = c - a
  if d**2 < tem:
    tem = c
print(int(tem))

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
i=0
min_w=t+1
p=0
h=input().split()
while i<n:
    w=a-(t-int(h[i])*0.006)
    
    if abs(w)<min_w:
        min_w=w
        p=i
    i+=1
print(p+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding : UTF-8

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

flag = 1
num = 0
for i,h in enumerate(H):
    t = float(T) -(float(h)*0.006)
    if flag == 1 :
        ans = abs(t - A)
        num = i
    else :
        if ans > abs(t-A) :
            ans = abs(t-A)
            num = i

print (i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def htemp(t, x):
    return float(t - 0.006 * x)

input()
lt, la = [int(x) for x in input().split()]
h_ary = [int(x) for x in input().split()]

maxdiff = float('inf')
goodpoint = 0
for i, h in enumerate(h_ary):
    diff = la - htemp(lt, h)
    if diff < maxdiff:
        maxdiff = diff
        goodpoint = i
print(goodpoint+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()]

H_T = [0 for i in range(len(H))]
for i in range(len(H)):
    H_T[i] = float(T) - float(H[i])*0.006

min = 50
index = 0
for i in range(len(H_T)):
    if(abs(H_T[i] - A) < min):
        index = i
        min = abs(H_T[i] - A)
print(H_T)
print(index+1)

Submission status: Wrong Answer

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

sHs = []
for idx,h in enumerate(Hs):
  sHs.append((h, idx))

sHs = sorted(sHs)

last = 99999999999999
lastidx = -1
for sh in sHs:
  dif = abs(A - (T - 0.006 * sh[0]))
  if last > dif:
    last = dif
    lastidx = sh[1]


print(lastidx)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
temp = list(map(int,input().split()))
tmp = 10**9
index= 1

for i in temp:
  if abs(a- (t - tmp)) > abs(a- (t - i * 0.006)):
    tmp = t - i * 0.006
    index = temp.index(i)+1


print(index)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
High=[int(x) for x in input().split()]
D=[]
for i in range(N):
	D.append(T-int(High[i])*0.006-A)
	if D[i]-A<=0:
		D[i]=-D[i]
	
for i in range(N):
	if D[i]==min(D):
		print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int,input().split())
li = list(map(int,input().split()))
n_temp = 10000000
answer = 10000000
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(raw_input())
T, A = map(int, raw_input().split(" "))

H = map(int, raw_input().split(" "))
index = 0
closet = abs(T - 0.06*H[0] - A)
for i in range(1, N):
    diff = abs(T - 0.06*(H[i]) - A)
    if diff == 0:
        index = i
        break
    elif diff < closet:
        closet, index = diff, i
print index + 1

Submission status: Wrong Answer

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

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(float, input().split(' '))
h = list(map(float, 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 = [int(s) for s in input().rstrip().split()]
H = [int(s) for s in input().rstrip().split()]

temp = [T - x * 0.006 for x in H]
diff = []
for n in range(N):
    if diff:
        if abs(A - temp[n]) <= diff[-1]:
            ans = n
    else:
        ans = n
    diff.append(abs(A - temp[n]))

print(ans + 1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
k=[]
for i in range(0,n):
    k.append([h[i],i+1])
k.sort()
print(k)
s=(t-a)/(6*(10**(-3)))
for i in range(1,n):
    if s-k[i][0]<0:
        if abs(s-k[i][0])>abs(s-k[i-1][0]):
            print(k[i-1][1])
            break
        else:
            print(k[i][1])
            break

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
temp = list(map(int,input().split()))
tmp = 10**9
index= 0

for i in temp:
  if abs(a- (t - tmp)) > abs(a- (t - i * 0.006)):
    tmp = t - i * 0.006
    index = temp.index(i)+1


print(index)

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)
	#print(H[i]*0.006 - A)
	if abs(H[_min]*0.006 - A)   >= abs(H[i]*0.006 - A):

		_min = i
	
print(_min+1)

Submission status: Wrong Answer

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

p2=list(map(lambda x: x*(-0.006)+T, p1))
A=min(p2)
for i in range(N):
    if p2[i]==A:
        print(i)
        break

Submission status: Wrong Answer

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

minPos = 0
minDiff = abs( A- ( T - pos[0] * 0.006) )

for i in range(1,len(pos)):
  if (minDiff > abs( A- ( T - pos[i] * 0.006) )):
    minPos = i 

print(minPos+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
h_list = list(map(int, input().split()))
d_list = [ abs(T - int(0.006 * x) - A) for x in h_list ]
ans_d = max(d_list)
for i,x in enumerate(d_list):
    if ans_d >= x:
        ans_d = x
        ans = i
print(ans+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h_list = list(map(int,input().split()))
min_value = float('inf')
ans = float('inf')

for i,h in enumerate(h_list):
    temp = a-((t-h)*0.006)
    if min_value > temp:
        min_value = temp
        ans = i+1

print(ans)