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

min = max(h)
ans = []

for i, j in enumerate(h):
    ans.append([abs(int(t - (j * 0.006)) - a),i+1])

print(sorted(ans)[0][1])

Submission status: Wrong Answer

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

ans = []

for i, j in enumerate(h):
    ans.append([abs(int(12 - (j * 0.006)) - a),i+1])

print(sorted(ans)[0][1])

Submission status: Wrong Answer

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

dt = 10**9
num = 0
for i in range(n):
  ti = t = hl[i]*0.006
  if abs(a - ti) <= dt:
    dt = abs(a -ti)
    num = i
    
    
print(num + 1)

Submission status: Wrong Answer

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

dt = 10**9
num = 0
for i in range(n):
  ti = t = hl[i]*0.006
  if abs(a - ti) <= dt:
    dt = abs(a -ti)
    num = i
    
    
print(num + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
[T, A] = list(map(int, input().split()))
H = list(map(int, input().split()))
c = 0.006
H_tem = [T - c*H[_] for _ in range(N)]
min_ans = float("inf")

for i in range(len(H)):
  ans = abs(A - H[i])
  if ans < min_ans:
    min_ans = ans
    point = i+1

print(point)

Submission status: Wrong Answer

Solution code:
N = int(input())
[T, A] = list(map(int, input().split()))
H = list(map(int, input().split()))
c = 0.006
H_tem = [T - c*H[_] for _ in range(N)]

min_ans = float("inf")
for i in range(len(H)):
  ans = abs(A - H[i])
  if ans < min_ans:
    min_ans = ans
    point = i+1

print(point)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 1
tmpans = t - (h[0] * 0.006)
for i in range(1,n):
    tmp = t - (h[i] * 0.006)
    if abs(a - tmp) < abs(a - tmpans):
        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()))
tmpl = 50-10**5*0.006
lst = list()
for i in range(N):
    tmp = T-H[i]*0.006 
    tmpl= abs(T-tmp)
    lst.append((tmpl,i+1))
lst.sort()
for k,j in lst:
    print(j)
    break

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006)) - abs(A)] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006))] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = [[i+1, abs((T - h) * 0.006) - abs(A)] for i, h in enumerate(H)]
avg.sort(key=itemgetter(1))
print(avg[0][0])

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = [[i+1, abs((T - h) * 0.006) - A] for i, h in enumerate(H)]
avg.sort(key=itemgetter(1))
print(avg[0][0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
M=list(map(int,input().split()))
S=[]
for i in range(N):
  S.append(abs(T-M[i]*0.06-A))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 0
diff_min = abs(temp[0]-A)

for cnt, t in enumerate(temp,1):
  if abs(A-t) < diff_min:
    diff_min = abs(A-t)
    place = cnt

print(place)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 0
diff_min = abs(temp[0]-A)

for cnt, t in enumerate(temp):
  if abs(A-t) < diff_min:
    diff_min = abs(A-t)
    place = cnt

print(place)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 0
diff_min = 60

for cnt, t in enumerate(temp):
  if abs(A-t) < diff_min:
    diff_min = abs(A-t)
    place = cnt

print(place)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split(" ")]
temp = [T-0.006*int(h) for h in input().split(" ")]

place = 0
diff_min = T

for cnt, t in enumerate(temp):
  if abs(T-t) < diff_min:
    diff_min = abs(T-t)
    place = cnt

print(place)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from fractions import gcd

def main():
    N = int(input())

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

    delta_val = 10000000000
    delta_idx = -1
    for i in range(N):
        temp = temps[i]
        eval_val = t - temp * 0.006
        if abs(t - eval_val) < delta_val:
            delta_val = abs(t - eval_val)
            delta_idx = i

    print(delta_idx + 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()))
ans = 0
m = abs(A - T + H[0] * 0.006)
for i in range(N):
  d = T - H[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = 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()))
dif = [float(A-i) for i in [float(T-h*0.006) for h in H]]
dif_min = dif.index(min(dif))
print(dif_min+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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):
    ans.append(abs(a-(t-h[i]*0.006)))

print(min(ans))

Submission status: Wrong Answer

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

h = list(map(int, (input().split())))
min = abs(a - (t - h[0]*0.006))
ans = 1

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

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

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))
#print(ans)
#print(A_raw)
#print(built)
index = 0

for k in range(1, N):
	built_num = 0
	if built[built_num] > built[built_num + k]:
		built_num = index
		#print(built_num)
		index += 1
	else:
		index += 1

print(str(built_num + 1))

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(abs(ans[i]) - abs(A_raw[i])))

print(built)

for k in range(0, N):
	built_num = 0
	if built[built_num] > built[built_num + k]:
		built_num = k

print(str(built_num + 1))

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))

for k in range(0, N):
	built_num = 0
	if built[built_num] > built[built_num + k]:
		built_num = k

print(str(built_num + 1))

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))

for k in range(0, N - 1):
	if built[k] > built[k + 1]:
		built_num = k + 1
	else:
		built_num = k

print(str(built_num + 1))

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))

for k in range(0, N - 1):
	if built[k] > built[k + 1]:
		built_num = k + 1
	else:
		built_num = k

print(str(built_num))

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []

for i in range(0, N):
	ans.append(ave_temp(T, H[i]))

for k in range(0, N-1):
	if abs(H[k] - A) > abs(H[k+1] - A):
		built = k + 1
	else:
		built = k

print(str(built + 1))

Submission status: Wrong Answer

Solution code:
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []

for i in range(0, N):
	ans.append(ave_temp(T, H[i]))

built = 0

for k in range(0, N-1):
	if abs(H[k] - A) > abs(H[k+1] - A):
		built = k + 1

print(str(built + 1))

Submission status: Wrong Answer

Solution code:
n=int(input()),
t,a=map(int,input().split())
h=list(map(int,input().split()))
print(h.index(min(h))+1)

Submission status: Wrong Answer

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

nearest = 100000000
ans = 0

for idx, i in enumerate(h):
    temp = abs(a - i * 0.006)
    if nearest > temp:
        nearest = temp
        ans = idx + 1

print(ans)

Submission status: Wrong Answer

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

nearest = 100000000
ans = 0

for idx, i in enumerate(h):
    temp = abs(t - i * 0.006)
    if nearest > temp:
        nearest = temp
        ans = idx + 1

print(ans)

Submission status: Wrong Answer

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

print(int(index+1))

Submission status: Wrong Answer

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

print(int(index+1))

Submission status: Wrong Answer

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

print(int(index+1))

Submission status: Wrong Answer

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

print(index+1)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
min=10000
index=0
for i in range(N):
    #print(abs(A-(T-H[i]*0.006)))
    if int(abs(A-(T-H[i]*0.006)))<min:
        index = i
        #print(i)
        min=int(abs(A-(T-H[i]*0.006)))
        #print(int(abs(A-(T-H[i]*0.006))))

print(index+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from bisect import bisect_left

N = int(input())
T, A = map(int, input().split())
H = sorted([T-(int(a)*0.006) for a in input().split()])
ans = bisect_left(H, A)
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools

n=int(input())
x,y=list(map(int,input().split()))
h=list(map(int,input().split()))
num=min(h)
for i in range(n):
	if num==h[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()))
for i in range(n):
  temp = 12 - h[i]*0.006
  k = abs(a-temp)
  if i == 0:
    ans = i+1
  else:
    if k>temp:
      ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,x = map(int,input().split())
h = list(map(int,input().split()))
T = t - x * 6 / 1000
ans = []
for i in range(n):
     ans.append(abs(T-h[i]))
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()))
diff = [0]*n

for i in range(n):
  diff[i] = abs(a - t + h[i]*0.006)
  print(diff[i])
  
print(diff.index(min(diff))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def temp(H):
  ans = - H *0.006
  return ans
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
TE = list(map(temp,H))
TLA = list(map(lambda x: abs(T + x -A) , TE))
ans=TLA.index(max(TLA))
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
h=float("INF")
pos=0
for i in range(N):
    temp=T-H[i]*0.06
    if abs(temp-A)<h:
        h=abs(temp-A)
        pos=i+1
print(pos)

Submission status: Wrong Answer

Solution code:
n, (T, A), *D,  = [list(map(int, s.split())) for s in open(0)]
n = n[0]
D = D[0]
di = {}
for i in range(len(D)):
    di[i] = abs(A - D[i] * 0.006)
    
di = sorted(di.items(), key = lambda x:x[1])
print(di[0][0] + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = [(T - H[i] * 0.006) for i in range(N)]
cur = 100000
for i in range(N):
    if (abs(t[i] - A) < cur): 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()))
t = [(T - H[i] * 0.006) for i in range(N)]
print(t)
cur = 100000
for i in range(N):
    if (abs(t[i] - A) < cur): 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()))
t = [(T - H[i] * 0.006) for i in range(N)]
cur = 100000
for i in range(N):
    if(abs(t[i] - A) < cur): ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
def p_b():
    n = int(input())
    t, a = map(int, input().split())
    *H, = map(int, input().split())
    ans = 10**9
    idx = -1
    for i, h in enumerate(H):
        if ans > abs(a - (t - h * 0.006)):
            ans = abs(t - h * 0.006)
            idx = i + 1
    print(idx)
    
p_b()

Submission status: Wrong Answer

Solution code:
def p_b():
    n = int(input())
    t, a = map(int, input().split())
    *H, = map(int, input().split())
    ans = 10**9
    idx = -1
    for i, h in enumerate(H):
        if ans > abs(a - t - h * 0.006):
            ans = abs(t - h * 0.006)
            idx = i + 1
    print(idx)
    
p_b()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    T,A=map(int,input().split())
    H=list(map(int,input().split()))
    tmp=INF
    for i,h in enumerate(H):
        t=T-0.006*h
        if abs(tmp-T) > abs(t-T):
            ans=i
            tmp=t
    print(ans+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()))
ans=[]
for i in range(n):
	ans.append(a-(t-h[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()))
ans=[]
for i in range(n):
	ans.append(abs(abs(a)-abs(t-h[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()))
ans=[]
for i in range(n):
	ans.append(abs(int(abs(a)-abs(t-h[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()))
min_=999
num=0
ans=[]
for i in range(N):
  tmp=T-(H[i]*0.006)
  if abs(A-tmp)<min_:
    min_=A-tmp
    num=i+1
print(num)

Submission status: Wrong Answer

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

pointID = -1
min_diff = 9999999999

for i in range (N):
    #地点i の温度 と 平均気温の差(絶対値)
    diff = abs(T - H[i] * 0.006 - A)

    print(diff)
    if diff < min_diff:
        pointID = i+1
        min_diff = diff

print(pointID)

Submission status: Wrong Answer

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

pointID = -1
min_diff = 9999999999

for i in range (N):
    #地点i の温度 と 平均気温の差(絶対値)
    diff = abs(T - 1000 * H[i] - A)

    if diff < min_diff:
        pointID = i+1
        min_diff = diff

print(pointID)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, H = map(int, input().split())
A = list(map(lambda x: abs(T - (12 - int(x) * 0.006)), input().split()))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# 地点iでの平均気温T_ave = T - Hi * 0.006
# abs(A - T_ave)が最小になるような地点の番号iを求める

# 平均気温T_aveを求めるループ
T_ave = []
diffArray = []
minDiff = 120
j_min = 0
for j in range(len(H)):
    T_ave.append(T - H[j]*0.006)
    diffArray.append(abs(A - T_ave[j]))
    if diffArray[j] < minDiff:
        minDiff = diffArray[j]
        j_min = j

print(j_min + 1)

Submission status: Wrong Answer

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

Palace = []

for i in range(len(H)):
    Palace.append(abs(abs(t - H[i] * 0.006) - abs(a)))

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

Submission status: Wrong Answer

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

l = list(map(int,input().split()))
    
for i in l:
    ans.append(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())
l = []
ans = []

l = list(map(int,input().split()))
    
for i in range(n):
    ans.append(a - t - (l[i] * 0.006))

print(ans.index(min(ans,key=abs))+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_diff = abs(T- max(H)*0.006)
for i in range(N):
  temp = T - H[i]*0.006
  if abs(A-temp) < min_diff:
    ans = i+1
    min_diff = abs(A-temp)
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
min_diff = abs(T- max(H)*0.006)
for i in range(N):
  temp = T - H[i]*0.006
  if abs(A-temp) < min_diff:
    ans = i+1
    min_diff = A-temp
print(ans)

Submission status: Wrong Answer

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

H=list(map(int,input().split()))
diff=[abs(T-(T-h*0.006)) for h in H]
print(diff.index(min(diff))+1)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#113 b-palce
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
mini=10**6
ans=0
for i in range(len(h)):
    kion=t-0.006*h[i]
    sa=abs(a-kion)
    print(i,sa)
    if sa<mini:
        mini=sa
        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=[]

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

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

Submission status: Wrong Answer

Solution code:
a = input()
A = map(int,input().split())
B=  list(map(int, input().split()))

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

Submission status: Wrong Answer

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

h_list = list(map(int, input().split()))
a_list = []
for h in h_list:
    candi = T - h * 0.006
    ac = int(abs(candi - A))
    a_list.append(ac)
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()))

memo = 10**5
for i in range(n):
    if (t-h[i]*0.006) < memo:
        ans = i+1
print(ans)

Submission status: Wrong Answer

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

h_list = list(map(int, input().split()))
a_list = []
for h in h_list:
    candi = T - h * 0.006
    ac = int(abs(candi - A))
    a_list.append(ac)
print(a_list.index(min(a_list)) + 1)

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
tem=[abs(t-0.006*int(m)-a) for m in input().split()]
print(tem.index(min(tem)))

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
tem=[abs(t-0.006*int(m)-a) for m in input().split()]
print(min(tem))

Submission status: Wrong Answer

Solution code:
N = int(input())
num = list(map(int,input().split()))
temp = list(map(int,input().split()))
ans=0
distance=1000000
for i in range(len(temp)):
	if(abs(num[1]-num[0]-temp[i]*0.006)<distance):
		ans=i+1
		distance=abs(num[1]-num[0]-temp[i]*0.006)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
hl=list(map(int,input().split()))
gap=abs(a-(t-hl[0]*0.006))
print(gap)
city=1
for i in range(2,n+1):
    temp_gap=abs(a-(t-hl[i-1]*0.006))
    print(i,temp_gap)
    if temp_gap<gap:
        gap=temp_gap
        city=i
print(city)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
ln=[t-0.006*int(a) for a in input().split()]
lm=[]
for x in ln:
    lm.append(abs(a-x))
print(lm.index(min(lm)))

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H = list(map(int,input().split()))
ind = -1
dis = 10**5
for i in range(len(H)):
  dx = abs(A - (T-H[i]*0.006))
  if dis > dx:
    dis = dx
    ind = 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()))
Hans = (T-A)/6*1000
ind = -1
dis = 10**5
for i in range(len(H)):
  if dis > abs(Hans - H[i]):
    dis = abs(Hans - H[i])
    ind = 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()))
W = H[:]
H.sort()
H.append(10**5)
Hans = (T-A)/6*1000
l = 0
h = len(H)
while l <= h:
  m = (l + h) // 2
  if H[m]<=Hans<H[m+1]: #condition
    l = m + 1
  else:
    h = m -1
if Hans-H[m]>H[m+1]-Hans:
  ans = m+1
else:
  ans = m
print(W.index(H[m])+1)

Submission status: Wrong Answer

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

tmp = 10000000
for i in range(N):
  if tmp >= abs(T - (H[i] * 0.006)):
    tmp = abs(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()))
tmin = 10000000
for i in range(N):
  if tmin < (T - H[i] * 0.006):
    ans = i
    tmin = T - H[i] * 0.006
print(i+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
ln=[abs(a-(t-0.006*int(x))) for x in input().split()]
print(ln.index(min(ln)))

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
ln=[t-0.006*int(x) for x in input().split()]
print(ln.index(min(ln)))

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
ln=[t-0.006*int(x) for x in input().split()]
print(min(ln))

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int, input().split())
h=list(map(int, input().split()))
avg=[]
h = ([abs(a - t - (i * 0.006)) for i in h])
print(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()))
temp_list = [T - h * 0.006 for h in H]

min_diff = float('inf')
for idx, temp in enumerate(temp_list):
    if min_diff > abs(temp-T):
        min_diff = abs(temp-T)
        min_idx = idx + 1
print(min_idx)

Submission status: Wrong Answer

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

min_diff =  float('inf')
min_idx = 0
for idx, temp in enumerate(temp_list):
    if min_diff > abs(temp-T):
        min_diff = abs(temp-T)
        min_idx = idx
print(min_idx + 1)

Submission status: Wrong Answer

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

best_diff = None
best_height = None
for h in H:
    avg_tmp = T - h * 0.006
    diff = abs(A - avg_tmp)

    print(diff)

    if best_diff is None:
        best_diff = diff
        best_height = h
    elif diff < best_diff:
        best_diff = diff
        best_height = h
    else:
        pass

print([i for i, val in enumerate(H, 1)
       if val == best_height][0])

Submission status: Wrong Answer

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