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()))
def avg_tmp(t, x):
  return t- x*0.006
ans, ans_index = 10000000, 0
for i in range(n):
  if abs(avg_tmp(t, h[i]) -a) < abs(ans-a):
         ans = abs(avg_tmp(t, h[i]))
         ans_index = i+1
print(ans_index)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 10**10
for i in range(N):
  tmp = T - 0.006*H[i]
  ans = min(ans, abs(A-tmp))
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()))
tmp=[0]*n

for i in range(n):
    tmp[i]=a-(t-h[i]*0.006)

print(np.argmin(tmp)+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(1,n):
  l.append(abs(a-(t-h[i]*0.006)))
print(l.index(min(l))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import decimal

def main():
    numbers=[]
    n = int(input())
    t,a = map(int,input().split())
    numbers=list(map(int,input().split()))
    dp=[]
    hensu=decimal.Decimal('0.006')
    for number in numbers:
        tmp=t-number*hensu
        dp.append(a-tmp)
    print(dp.index(min(dp))+1)

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import decimal

def main():
    numbers=[]
    n = int(input())
    t,a = map(int,input().split())
    numbers=list(map(int,input().split()))
    dp=[]
    hensu=decimal.Decimal('0.006')
    for number in numbers:
        tmp=t-number*hensu
        dp.append(a-tmp)
    print(dp)
    print(dp.index(min(dp))+1)

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    n = int(input())
    t,a = map(int,input().split())
    numbers=list(map(int,input().split()))
    dp=[]
    for number in numbers:
        tmp=abs(t-number*0.006)
        dp.append(abs(a-tmp))
    print(dp.index(min(dp))+1)

if __name__=="__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

dt = 10000000
ans = 0
for i in range(len(h)):
    print(i)
    tmp = float(t) - 0.006 * h[i]
    if dt > abs( a - tmp ):
        dt = abs( a - tmp )
        ans = i + 1

print(ans)

Submission status: Wrong Answer

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

dt = 10000000
ans = 0
for i in range(len(h)):
    print(i)
    tmp = float(t) - 0.006 * h[i]
    print(i, h[i], tmp, dt, abs( a - tmp ))
    if dt > abs( a - tmp ):
        dt = abs( a - tmp )
        ans = i + 1

print(ans)

Submission status: Wrong Answer

Solution code:
from decimal import Decimal
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 10**10
ans2 = 0
for i in range(n):
    if ans > a-(t-h[i]*Decimal('0.006')):
        ans = a-(t-h[i]*Decimal('0.006'))
        ans2 = i+1
    ans = min(a-(t- h[i] * 0.006), ans)
print(ans2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

diff = []
for i in H:
	diff.append(abs(A-T+i*0.006))

diffmin = diff[0]
ans = 0
for i in range(N):
	if diffmin > diff[i]:
		diffmin = diff[i]
		ans = i
print(ans)

Submission status: Wrong Answer

Solution code:
from unittest.mock import patch
import numpy as np

def palace():
    
    N = int(input())
    T, A = np.array(input().split(), dtype="int")[:2]
    H = [int(i) for i in input().split()]
    
    min_dif = 10000
    place = 0
    for i in range(N):
        temp = T - H[i] *0.006
        dif = abs(A-temp)
        
        #誤差の最小値(→候補地も更新)
        if min_dif >= dif:
            min_dif = dif
            place = i+1
    
    print(place)

Submission status: Wrong Answer

Solution code:
def calc(T, x):
  return T - x * 0.0006

N = int(input())
T, A = map(int, input().split())
L = list(map(int, input().split()))
l = []
for i in L:
  l.append(abs(A - calc(T, i)))

mi = min(l)
print(l.index(mi)+1)

Submission status: Wrong Answer

Solution code:
def calc(T, x):
  return T - x * 0.0006

N = int(input())
T, A = map(int, input().split())
L = list(map(int, input().split()))
l = []
for i in L:
  l.append(abs(i - calc(T, i)))

mi = min(l)
print(l.index(mi)+1)

Submission status: Wrong Answer

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

diff = []
for i in H:
	diff.append(abs(A-T+i*0.006))

diffmin = diff[0]
for i in diff:
	if diffmin > i:
		diffmin = i
print(diffmin)

Submission status: Wrong Answer

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

for i in H:
    temp.append(abs(A - (T - i * 0.006)))
min_ind = temp.index(min(temp))
print(min_ind)

Submission status: Wrong Answer

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

cnt = []
for h in H:
    a = T-(h*0.006)
    cnt.append(a)

ans = 0
for i in range(len(cnt)-1):
    x = abs(A-cnt[i])
    y = abs(A-cnt[i+1])
    if x <= y:
        ans = i
    else:
        ans = i+1
        
print(ans+1)

Submission status: Wrong Answer

Solution code:

url = "https://atcoder.jp//contests/abc113/tasks/abc113_b"

def main():
    input()
    t, a = list(map(int, input().split()))
    syuto = list(map(int, input().split()))
    tempture = []
    for s in syuto:
        tempture.append((a - (t - s * 0.006)))
    print(tempture.index(min(tempture))+1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    t, a = map(int, input().split())
    h = list(map(int, input().split()))
    ave_t = []
    for x in h:
        ht = abs(a - t - x * 0.006)
        ave_t.append(ht)
    print(ave_t.index(min(ave_t))+1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    ht= list(map(lambda x:abs(a - t - x * 0.006), h))
    print(ht.index(min(ht))+1)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

    ht= list(map(lambda x:abs(a - t - x * 0.006), h))
    print(ht)
    print(ht.index(min(ht))+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()))

counter = 0
diff = abs(a - (t - h[0] * 0.006))
poss = 1

for x in h:
    average_temple = t - x * 0.006
    counter += 1
    if diff > abs(a - average_temple):
        poss = counter

print(poss)

Submission status: Wrong Answer

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

counter = 0
diff = abs(a - (t - h[0] * 0.006))

for x in h:
    average_temple = t - x * 0.006
    counter += 1
    if diff >= abs(a - average_temple):
        poss = counter

print(poss)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

H = list(map(lambda h: int(math.copysign(T-h*0.006, h)), H))

tmp = float("inf")
ans = 0

for i in range(N):
  num = abs(A - H[i])
  if tmp > num:
    ans = i + 1
    tmp = num

print(ans)

Submission status: Wrong Answer

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

s = 10000

for i in range(N):
  x = T - X[i] * 0.006
  if abs(A - x) < s:
    ans = i
    s = abs(A - x)
print(i)

Submission status: Wrong Answer

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

ans = 0
temp = 1000000000000

for i in range(n):
  if temp > abs(a*1000-1000*t+h[i]*600):
    temp = abs(a*1000-1000*t+h[i]*600)
    ans = i+1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int, input().split()))
a = 10**9
for i in range(n):
    c = h[i]*0.006
    if c<a:
        a=c
        d=i
print(d+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[i]==abs(c-(b-l[0]*0.006))
for i in range(a):
  if l[i]==min(l):
    print(i+1)

Submission status: Wrong Answer

Solution code:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[0]==abs(c-(b-l[0]*0.006))
for i in range(a):
  if l[i]==min(l):
    print(i+1)

Submission status: Wrong Answer

Solution code:
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[0]==abs(c-(b-l[0]*0.006))
for i in range(a):
  if l[i]==min(l):
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

candidate_num = int(input())
temp, point_tmp = map(int, input().split())
ans = 0
aaa = 0
bbb = 10000
height = input().split(" ")
table = list(height)
for i in range(candidate_num):
	height2 = int(table[i])
	tmp = 12 - (height2 * 0.006)
	aaa = point_tmp - tmp
	if abs(aaa) < abs(bbb):
		ans = (i + 1)
		bbb = abs(aaa)
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

candidate_num = int(input())
temp, point_tmp = map(int, input().split())
ans = 0
aaa = 0
bbb = 10000
height = input().split(" ")
table = list(height)
for i in range(candidate_num):
	height2 = int(table[i])
	tmp = 12 - (height2 * 0.006)
	aaa = abs(point_tmp - tmp)
	if abs(aaa) < abs(bbb):
		ans = (i + 1)
		bbb = aaa
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

candidate_num = int(input())
temp, point_tmp = map(int, input().split())
ans = 0
aaa = 0
bbb = 10000
height = input().split(" ")
table = list(height)
for i in range(candidate_num):
	height2 = int(table[i])
	tmp = 12 - (height2 * 0.006)
	aaa = point_tmp - tmp
	if abs(aaa) < abs(bbb):
		ans = (i + 1)
		bbb = aaa
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ret, tmp_temp = 1, h[0]
for i, height in enumerate(h):
    x = t - height*0.006
    if abs(a-x) <= a-tmp_temp:
        tmp_temp = x
        ret = i+1
print(ret)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
Hls = list(map(int,input().split()))
mabs = 10**5+1
for i in range(N):
    if abs(T-Hls[i]) <= mabs:
        mabs = abs(T-Hls[i])
        ans = i
    else:
        pass
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()))
ans = 0
temp = 10 ** 6
for i in range(N):
    t = T - H_list[i] * 0.006
    if (A - t) < temp:
        ans = i + 1
        temp = A - t
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = 1
tmp = 2000000
A = T - A*0.006
for i in range(N):
  H[i] = T - H[i]*0.006
  if tmp > abs(H[i]-A):
    tmp = abs(H[i]-A)
    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()))
l = [T - h*0.006 for h in H]
print(l.index(max(l)) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min_t = T
min_i = 0

for i in range(N):
    t = abs(A - (T - H[i]*0.006))
    if t <= min_t:
        min_t = t
        min_i = i


print(min_i)

Submission status: Wrong Answer

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

ans = []

for H in H:
    ans.append(abs(T - H * 0.006 - 5))
    
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 = 1

if n > 1:
  d = abs(a - (t - h[0]*0.006))
  for i in range(1,n):
    if d > abs(a - (t - h[i]*0.006)):
      ans = i + 1
    else:
      continue
print(ans)

Submission status: Wrong Answer

Solution code:
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
t, a = inintm()
H = inintl()

diff = 10**6
ans = 0

for i in range(n):
    if abs(a-(t + -0.006*H[i])) < diff:
        abs(a-(t + -0.006*H[i]))
        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()))

z = [abs(T-h*0.06-A) for h in H]
print(z.index(min(z))+1)

Submission status: Wrong Answer

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

z = [abs(T-h*0.06) for h in H]
print(z.index(min(z))+1)

Submission status: Wrong Answer

Solution code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

dis = INF
ans = None
for i, h in enumerate(H):
    avg = (T - h) * 0.006
    if abs(avg - A) < dis:
        dis = abs(avg - A)
        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()))
minn = 10**5
min_num=0

for i in range(len(H)):
    if abs(A-(12-H[i]*0.006))<=minn:
        minn = abs(A-(12-H[i]*0.006))
        min_num = i+1
print(min_num)

Submission status: Wrong Answer

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

t = 10 ** 9
r = 0

for i in range(N):
    x = T - H[i] * 1000 / 6
    tt = abs(A - x)
    if t > tt:
        t = tt
        r = i + 1
        
print(r)

Submission status: Wrong Answer

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

h_temp = h * 0.006 + t
ans = np.abs(h_temp - a).argmin()
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_meter = (12-A*1000)//6

ans = -1
diff = 10**9
for i in range(N):
    d = abs(1000*T-6*H[i]-1000*A)
    if d < diff:
        d = diff
        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()))

a_meter = (12-A*1000)//6

ans = -1
diff = 10**6
for i in range(N):
    d = abs(1000*T-6*H[i]-1000*A)
    if d < diff:
        d = diff
        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()))

a_meter = (12-A*1000)//6

ans = -1
diff = 10**6
for i in range(N):
    temp = abs(a_meter - H[i])
    # print("temp:" + str(temp))
    # print("diff:" + str(diff))
    if diff > temp:
        diff = temp
        ans = i+1

print(ans)

Submission status: Wrong Answer

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

a_meter = (12-A)/0.006

ans = -1
diff = 10**6
for i in range(N):
    temp = abs(a_meter - H[i])
    # print("temp:" + str(temp))
    # print("diff:" + str(diff))
    if diff > temp:
        diff = temp
        ans = i+1

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
T, A = mi()
H = li()

ans = float('inf')
min_d = float('inf')

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

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
T, A = mi()
H = li()

ans = float('inf')
min_d = float('inf')

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# abc113_b.py
# https://atcoder.jp/contests/abc113/tasks/abc113_b

# B - Palace /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点: 200点

# 問題文
# ある国で、宮殿を作ることになりました。
# この国では、標高が xメートルの地点での平均気温は T−x×0.006度です。
# 宮殿を建設する地点の候補は N個あり、地点 i の標高は Hiメートルです。
# joisinoお姫様は、これらの中から平均気温が A度に最も近い地点を選んで宮殿を建設するようにあなたに命じました。
# 宮殿を建設すべき地点の番号を出力してください。
# ただし、解は一意に定まることが保証されます。

# 制約
#     1≤N≤1000
#     0≤T≤50
#     −60≤A≤T
#     0≤Hi≤105
#     入力は全て整数
#     解は一意に定まる

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# T A
# H1 H2 ... HN

# 出力
# 宮殿を建設すべき地点の番号を出力せよ。

# 入力例 1
# 2
# 12 5
# 1000 2000

# 出力例 1
# 1

#     地点 1の平均気温は 12−1000×0.006=6度です。
#     地点 2の平均気温は 12−2000×0.006=0度です。

# よって、宮殿を建設すべき地点は地点 1となります。

# 入力例 2
# 3
# 21 -11
# 81234 94124 52141

# 出力例 2
# 3


def calculation(lines):
    N = int(lines[0])
    T, A = list(map(int, lines[1].split()))
    values = list(map(int, lines[2].split()))
    # n = lines[0]

    result = None
    id = None

    for i, value in enumerate(values):
        t = T - value * 0.006
        print(t)
        dif = abs(A-t)
        if result is None:
            result = dif
            id = i
        elif result > dif:
            result = dif
            id = i

    return [id+1]



# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2', '12 5', '1000 2000']
        lines_export = [1]
    if pattern == 2:
        lines_input = ['3', '21 -11', '81234 94124 52141']
        lines_export = [3]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(3)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
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()))

temp = []
for i in h:
    temp.append(abs(a-(t-int(i*0.006))))
print(temp.index(min(temp))+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A=map(int,input().split())
List = list(map(int, input().split()))
t = 0
mid = 0
MID = 100000000000
res = 100000000000
for i in range(N):
  t = T - 0.006*List[i]
  mid = abs(A-t)
  if mid < MID:
    MID = mid
    res = i+1
print(i+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

t = x[0]
a = x[1]
cnt = 1000000000000000000000
ans = 0
for i in range(n):
  tmp = a - t-h[i]*0.006
  if cnt > tmp:
    cnt = tmp
    ans = i+1
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

t = x[0]
a = x[1]
cnt = 1000000000000000000000
ans = 0
for i in range(n):
  tmp = abs(t*h[i] - a)
  if cnt > tmp:
    cnt = tmp
    ans = i+1
print(ans)