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:
import sys
input = sys.stdin.readline

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

tmp = 111

for i in range(N):
  tmp = min(tmp, abs(A - (T - int(H[i])*0.06)))
  ans = i
  
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
l = input().split(' ')
H = input().split( )

T=int(l[0])
A = int(l[1])
H = [int(x) for x in H]

tem_gap = [abs((T-h*0.006)-A) for h in H]
print(tem_gap)

min = min(tem_gap)
print(tem_gap.index(min) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import fabs

def main():
  n = int(input())
  T, A = list(map(int, input().split()))
  H = list(map(int, input().split()))
  
  place = 0
  m = 1000000000
  for i, h in enumerate(H):
    t_h = T - h * 0.006
    dif = fabs(A - t_h)
    print(dif)
    if dif < m:
      m = min(m, dif)
      place = i+1
  print(place)
main()

Submission status: Wrong Answer

Solution code:
from math import fabs

def main():
  n = int(input())
  T, A = list(map(int, input().split()))
  H = list(map(int, input().split()))
  
  place = 0
  m = 1000000000
  for i, h in enumerate(H):
    t_h = T - h * 0.006
    dif = fabs(A - t_h)
    print(dif)
    if dif < m:
      m = min(m, dif)
      place = i+1

main()

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
T, A = map(int, input().split())
H = [0]*N
H = list(map(int, input().split()))

TL = [0]*N
for i in range(N):
    TL[i] = T - H[i]*0.006

TLsort = sorted(TL)
idx = bisect.bisect_left(TLsort, A)
ansVal = 0
if idx == N:
    ansVal = TLsort[idx-1]
else:
    L = A - TLsort[idx-1]
    R = TLsort[idx] - A
    if L > R:
        ansVal = TLsort[idx-1]
    else:
        ansVal = TLsort[idx]

ans = TL.index(ansVal) + 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

import numpy as np

input = sys.stdin.readline
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = [0] * N
for i, h in enumerate(H):
    ans[i] = abs(A - T - h * 0.006)
print(np.argmin(ans) + 1)

Submission status: Wrong Answer

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

mini = 0
min = float('inf')

for i in range(len(H)):
    if min > abs(A - (T - 0.006 * H[i])):
        mini = i + 1

print(mini)

Submission status: Wrong Answer

Solution code:
n = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans_num = 0
ans_val = T - H[ans_num] * 0.006 - 6
if ans_val < 0:
    ans_val *= -1
for i in range(1,len(H)):
    tmp = T - H[i] * 0.006 - 6
    if tmp < 0:
        tmp *= -1
    if tmp < ans_val:
        ans_val = tmp
        ans_num = i
print(ans_num + 1)

Submission status: Wrong Answer

Solution code:
_ = int(input())
T, A = map(int, input().split())
ret = float('inf')
ret_idx = 0
for idx, x in enumerate(map(int, input().split()), 1):
    if abs(A - (T - int(x) * 0.006)) < (A - (T - ret * 0.006)):
        ret = x
        ret_idx = idx

print(ret_idx)

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

mini = 10000
for i, hi in enumerate(h):
    temp = t - hi * 0.006
    if abs(temp - t) < mini:
        mini = abs(temp - t)
        result = i+1

print(result)

Submission status: Wrong Answer

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

Ave = [0]*N
gosa = [0]*N

H = input().split()
print(H[0])
for i in range(N):
    H[i] = int(H[i])
    gosa[i] = abs(float(A) - float(T) + 0.006*H[i])

print(int(np.argmin(np.array(gosa)))+1)

Submission status: Wrong Answer

Solution code:
#encoding:utf-8

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

diff = 10000
for i in range(N):
    tem_diff = abs(t-h[i]*0.006-5)
    if tem_diff < diff:
        diff = tem_diff
        place = i+1


print(place)

Submission status: Wrong Answer

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

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

x = T - (A*0.006)
out = 10000000

for i in range(len(H)):
    now = abs( x - (T-(H[i]*0.006)))
    if out > now:
        out = now
        O = i+1

print(O)

Submission status: Wrong Answer

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

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

x = (T - A)/6*1000
out = 10000000

for i in range(len(H)):
    if out > abs( x - H[i]):
        out = H[i]
        O = i+1

print(O)

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-1):
    if(abs(a-(t-h[i]*0.006))>abs(a-(t-h[i+1]*0.006))):
        min=abs(a-(t-h[i+1]*0.006))
    else :
        min=abs(a-(t-h[i]*0.006))

print(int(min))

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-1):
    if(abs(a-(t-h[i]*0.006))>abs(a-(t-h[i+1]*0.006))):
        min=abs(a-(t-h[i+1]*0.006))
    else :
        min=abs(a-(t-h[i]*0.006))

print(min)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = list(map(int, input().split()))
c = list(map(int, input().split()))

min = 1000
minn = 1000

for i in range(a):
    if min > b[0] - i*c[i]:
        min =b[0] - i*c[i]
        minn = i
print(minn)

Submission status: Wrong Answer

Solution code:


if __name__ == '__main__':
    num = int(input())
    T, A = list(map(int, input().split()))
    location = list(map(int, input().split()))
    ans_num = 1
    ans_temp = T - location[0] * 0.006
    
    for i in range(1, num):
        temp = T - location[i] * 0.006
        if abs(A - ans_temp) > abs(T - temp):
            ans_temp = temp
            ans_num = i + 1
    print(ans_num)

Submission status: Wrong Answer

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

tmp = 1e6
for i, j in enumerate(h):
    if tmp > abs(j*0.006):
        ans = i
        tmp = abs(j*0.006)
print(ans+1)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

t_2 = (t-a)/0.006
print(t_2)
res = 1000000

for m in range(n):
  num_ = abs(t_2 - h[m])
  if res > num_:
    res = num_
    res_2 = m + 1
print(res_2)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

t_2 = (t-a)/0.006
print(t_2)
res = 1000

for m in range(n):
  num_ = abs(t_2 - h[m])
  if m == 0:
    res = num_
    res_2 = m + 1
  elif res > num_:
    res = num_
    res_2 = m + 1
print(int(res_2))

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

t_2 = (t-a)/0.006

res = 1000

for m in range(n):
  num_ = abs(t_2 - h[m])
  if m == 0:
    res = num_
    res_2 = m + 1
  elif res > num_:
    res_2 = m + 1
print(res_2)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

print(n,t,a,h)
t_2 = (t-a)/0.006

res = -1000

for m in range(n):
  num_ = abs(t_2 - h[m])
  if m == 0:
    res = num_
    res_2 = m + 1
  elif res > num_:
    res_2 = m + 1
print(res_2)

Submission status: Wrong Answer

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

f = lambda x:t-x*0.006

tmp = list(map(f,h))

MIN = 500000000000000000000
idx = 0

for i in range(len(tmp)):
    if abs(tmp[i]-a)<MIN:
        print(i, tmp[i])
        MIN = abs(tmp[i]-a)
        idx = i+1

print(idx)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
T,A = map(int,input().split())
H = [int(i) for i in range(N)]
b = []
for x in range(N):
  b.append(T - 0.006 * x - A)
print(min(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
T , A = (int(i) for i in input().split())
H_list = [int(h) for h in input().split()]
 
A_list = [abs((T-0.006*H_list[n])-A) for n in range(N)]

number = 0
for n ,x in enumerate(A_list):
  if x == min(A_list):
    number = n
print(number)

Submission status: Wrong Answer

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

number = min([abs((T-0.006*H_list[n])-A) for n in range(N)])
print(number)

Submission status: Wrong Answer

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

out = None
num = None

for i in range(N):
    avg = T - H[i]*0.006
    if num == None:
        out = i
        num = abs(avg)
        continue

    if num > abs(avg):
        out = i
        num = abs(avg)

print(out+1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import sys


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

    nearest = [0, sys.maxsize]
    for i, x in enumerate(h, 1):
        tmp = abs((t - x * 0.006) - a)
        if tmp < abs(nearest[1] - a):
            nearest = [i, tmp]

    print(nearest[0])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8


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

    nearest = [0, 9999]
    for i, x in enumerate(h, 1):
        tmp = abs((t - x * 0.006) - a)
        if tmp < abs(nearest[1] - a):
            nearest = [i, tmp]

    print(nearest[0])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = list(map(int,input().split(" ")))
H = list(map(int,input().split(" ")))
res = 0
c = 0
r = [(abs((int((T*1000-i*6)/1000)-A)),i,) for i in H]
r = sorted(r,key=lambda x:x[0])
print(H.index(r[0][1])+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range (N):
  C=12-H[i]*0.006
  D=A-C
  mylist.append(D)
E=mylist.index(max(mylist))
F=E+1
print(F)

Submission status: Wrong Answer

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

for i in range (N):
  C=12-H[i]*0.006
  mylist.append(C)
D=mylist.index(max(mylist))
E=D+1
print(E)

Submission status: Wrong Answer

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

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


def calcTemp(x, y):
    return x - y * 0.006


min = 1000000
counter = 1
numPlace=0
for height in H:
    tmp = abs(A - calcTemp(T, height))
    if min > tmp:
        min = tmp
        numPlace = counter
    counter += 1
print(numPlace)

Submission status: Wrong Answer

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

ans = 0
best = int(1e9)

for i in range(1, N+1):
    now =  abs(A - H[i] * 0.006)
    if now < best:
        ans = i
        best = now
print(ans)

Submission status: Wrong Answer

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

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()]
l = [(i, abs(a - (t - x * 0.0006))) for i, x in enumerate(h)]
target = min(l, key = lambda x: x[1])
print(target[0]+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(n + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
input2 = input()
t,a = input2.split(' ')
T = int(t)
A = int(a)
input3 = input()
H = list(map(int,input3.split(' ')))

answer = 0
min = 0
for i in range(N):
    heikin = T - H[i] * 0.0006
    if i != 0:
        if min > abs(A - heikin):
            min = abs(A - heikin)
            answer = i + 1
    else:
        min = abs(A - heikin)
        answer = 1
print(answer)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
   # N , M , A , B = list(map(int,input().split()))
    T,A = list(map(int,input().split()))
    H = list(map(int,input().split()))
    diff = []
    for i in H:
        diff.append(abs(A - abs(T - i*0.006)))
    print(diff.index(min(diff)) + 1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
   # N , M , A , B = list(map(int,input().split()))
    T,A = list(map(int,input().split()))
    H = list(map(int,input().split()))
    diff = []
    for i in H:
        diff.append(abs(A - T - i*0.006))
    print(diff.index(min(diff)) + 1)
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

temps = []
for i in highs:
    diff = int(abs(A - (T - i*0.006)))
    temps.append(diff)
    
print(temps.index(min(temps))+1)

Submission status: Wrong Answer

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

diff = 100
point = 10000

for x in range(n):
    temp = t - int(h[x]) * 0.006
    tmp = abs(a - temp)

    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

Submission status: Wrong Answer

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

diff = 100
point = 10000

for x in range(n-1):
    tmp = t - int(h[x]) * 0.006 
    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

Submission status: Wrong Answer

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

diff = 100
point = 10000

for x in range(n):
    tmp = t - int(h[x]) * 0.006 
    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

Submission status: Wrong Answer

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

besth = None
besti = None
for i, h in enumerate(hs):
  ind = i + 1
  if besth is None:
    besth = h
    besti = ind
  elif abs(besth-a) > abs(h-a):
    besth = h
    besti = ind

print(besti)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
diff=float('INF')
ans=-1
for i in range(n):
    ave=t-(h[i]*0.06)
    tmp=a-ave
    if tmp < 0:
        tmp*=-1
    if diff > tmp:
        diff=tmp
        ans=i+1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = input()
TA = input()
T, A = TA.split()
Hinp = input()
H = Hinp.split()
ansnum = None
ans = 0
for i, x in enumerate(H):
    _ans = int(T) - int(x) * 0.006
    if _ans == ans:
        break
    if not ans or abs(int(A) - _ans) < abs(int(A) - ans):
        ans, ansnum = i+1, _ans
print(ans)

Submission status: Wrong Answer

Solution code:

N=int(input())
TA=input().split(" ")
T = int(TA[0])
A = int(TA[1])
H=input().split(" ")
ans = 1
diff = abs(T - int(H[0]) * 0.006 - A)
for i in range(N):
    # print(i)
    if( diff > abs(T - int(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()))
H_temp = [int(x) for x in range(N)]
H_temp_ave = [int(x) for x in range(N)]

for i in range(N):
  H_temp[i] = float(A) - float(T - H[i] * 0.006)

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

Submission status: Wrong Answer

Solution code:
N=int(input())
TA=input().split(" ")
T = int(TA[0])
A = int(TA[1])
H=input().split(" ")
ans = 1
diff = abs(T - int(H[0]) * 0.006 - A)
for i in range(N):
    # print(i)
    if( diff > abs(T - int(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 = [int(i) for i in input().split()]
avg_tmp = []
for i in h_list:
    avg = int(t - i * 0.006)
    avg_tmp.append(avg)
min = abs(avg_tmp[0] - a)
l = 0
for i in range(1, n):
    min_diff = abs(t - avg_tmp[i] - a)
    if(min > min_diff):
        min = min_diff
        l = i
print(l+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h_list = [int(i) for i in input().split()]
avg_tmp = []
for i in h_list:
    avg = int(t - i * 0.006)
    avg_tmp.append(avg)
min = abs(avg_tmp[0] - a)
print("min:", min)
l = 0
for i in range(1, n):
    min_diff = abs(t - avg_tmp[i] - a)
    print(min_diff)
    if(min > min_diff):
        min = min_diff
        l = i
print(l+1)

Submission status: Wrong Answer

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

kion = list(map(int, list(map(lambda x: t-x*0.006, h))))
sub = list(map(int, list(map(lambda x: abs(a-x), kion))))

temp = sub.copy()
temp.sort()
index = sub.index(temp[0])

print(index+1)

Submission status: Wrong Answer

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

kion = list(map(int, list(map(lambda x: t-x*0.006, h))))
sub = list(map(int, list(map(lambda x: abs(a-x), kion))))

print(kion)

temp = sub.copy()
temp.sort()
index = sub.index(temp[0])

print(index+1)

Submission status: Wrong Answer

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

def ond(hi):
    g = abs(t - hi*0.006)
    return g

for i in range(len(h)):
    s = ond(h[i])
    if abs(h[d] - a) > abs(h[i] - a):
        d = i
print(d+1)

Submission status: Wrong Answer

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

def ond(hi):
    g = t - hi*0.006
    return g

for i in range(len(h)):
    s = ond(h[i])
    if abs(h[d] - a) > abs(h[i] - a):
        d = i
print(d+1)

Submission status: Wrong Answer

Solution code:
s = int(input())
w = input().split()
hight = input().split()
m =[]
for i in hight:
	m.append(abs(float(w[0]) - float(i)*0.006 -float(w[1])))
print(min(m))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

li = abs(t-lis[0]*0.006)-5
l = 0
for i in range(1,n):
    if abs((t-lis[i]*0.006)-5) < li:
        li=abs((t-lis[i]*0.006)-5)
        l=i
print(l+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 n in range(N):
    ave_temperature = T - H[n] * 0.006
    diff[n] = abs(T - ave_temperature)

print(diff.index(min(diff)) + 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 = (A-T-0.006*H[0])**2
ans = 0

for i in range(1,N):
    if min > (A-T-0.006*H[i])**2:
        min = (A-T-0.006*H[i])**2
        ans = i

print(i)

Submission status: Wrong Answer

Solution code:
ans = 0
dis = float("inf")
n = int(input()) + 1
t, a = map(int, input().split())
for ind, h in enumerate(map(int, input().split()), 1):
    if abs(a - h * 0.006) < dis:
        dis = abs(a - h * 0.006)
        ans = ind
print(ans)

Submission status: Wrong Answer

Solution code:
ans = 0
dis = float("inf")
n = int(input())+1
t, a = map(int, input().split())
for i in range(1, n):
  if abs(t - a*0.006) < dis:
    dis = abs(t - a*0.006)
  ans = i
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#候補数を取得
N = int(input())
#TとAの値を取得
T, A = map(int, input().split())
#N個の国のHを配列に格納
H = input().split()
#各標高とAとの差を計算し、配列に格納
list = [abs(abs(T - (int(H[i])*0.006)) - abs(A)) for i  in range(N)]
#Aの値に近いところを出す
for i in range(N):
        if min(list) == list[i]:
                print(i+1)

Submission status: Wrong Answer

Solution code:
#候補数を取得
N = int(input())
#TとAの値を取得
T, A = map(int, input().split())
#N個の国のHを配列に格納
H = input().split()
#各標高とAとの差を計算し、配列に格納
list = [(T - int(H[i])*0.006) - A for i  in range(N)]
#Aの値に近いところを出す
for i in range(N):
    if min(list) == list[i]:
        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
diff = 1e100
for i in range(N):
    d = abs(A - (T - H[i]) * 0.006)
    if d < diff:
        ans = i
        diff = d
print(ans + 1)

Submission status: Wrong Answer

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

H_temp = [int(abs(A-(T-0.006*i))) for i in H]

temp = 999999
best_spot = None

for i in range(len(H_temp)):
    if H_temp[i] < temp:
        temp = H_temp[i]
        best_spot = i+1

print(best_spot)

Submission status: Wrong Answer

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

H_temp = [int(abs(A-(T-0.006*i))) for i in H]

for i in range(len(H_temp)):
    if H_temp[i] == min(H_temp):
        print(i+1)

Submission status: Wrong Answer

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

minAH, mini = 10000000, None
for i in range(N):
    AH = (A - (T - Hs[i] * 0.006))
    if minAH > AH:
        minAH = AH
        mini = i + 1
print(mini)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
height = input().split()
H = [int(h) for h in height]
result_h = 0
diff = T * 1000
for idx in range(N):
    tmp = abs(A - abs(T - H[idx] * 0.006)) * 1000
    if idx == 0:
        diff = tmp
        result_h = 1
    elif tmp < diff:
        diff = tmp
        result_h = idx + 1
print(result_h)

Submission status: Wrong Answer

Solution code:
n = int(input())
T, A = list(map(int, input().split())) # 定数Tと平均気温
places = list(map(int, input().split())) # 山の地点
# Aとの差が最も小さいplaceを出力する
ans = places[0]
place = 0 # ここにplaceを突っ込む　これで参照
for p in places:
    cnt = abs(T - p * 0.006) # [6.0, 0.0]
    t  = abs(A-cnt)
    if t < ans:
        ans = t
        place = p

print(places.index(place) + 1) # => placeに-11が入っているといっている

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
height = input().split()
H = [int(h) for h in height]
result_h = 0
diff = T
for idx in range(N):
    if idx == 0:
        diff = abs(A - abs(T - H[idx] * 0.006))
        result_h = 1
    elif abs(A - abs(T - H[idx] * 0.006)) < diff:
        diff = abs(A - abs(T - H[idx] * 0.006))
        result_h = idx + 1
print(result_h)

Submission status: Wrong Answer

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

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

num=0
minnum=1000000000
for i in range(n):
    if minnum>abs((t-h[i]*0.006)):
        num=i
print(num+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()]

diff = 1000000
index = 0
for i in range(n):
    tmpDiff = abs(a - t-h[i]*0.006)
    if tmpDiff < diff:
        diff = tmpDiff
        index = i
print(index+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()]

diff = 10000
index = 0
for i in range(n):
    tmpDiff = abs(a - t-h[i]*0.006)
    if tmpDiff < diff:
        diff = tmpDiff
        index = i
print(index+1)

Submission status: Wrong Answer

Solution code:
import math

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
minv=1e9

for i in range(n):
    memo=abs(a-h[i]*0.006)
    if min(minv,memo) == memo:
        minv=memo

print(int(minv))

Submission status: Wrong Answer

Solution code:
N = input()
TA = input().split(' ')
H = input().split(' ')

sa = 100000000
for i in range(int(N)):
    deg = int(TA[0]) - int(H[i]) * 0.006
    if sa > int(TA[1]) - deg:
        sa = int(TA[1]) - deg
        j = i + 1

print(j)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
res = 0
diff = 100
Hlist = input().split()
Hlist = [int(i) for i in Hlist]
for i in range(N):
    H = Hlist[i]
    average = T - H * 0.006
    print(average,diff)
    a = abs(A-average)
    if diff >= a:
        res = i
    diff = min(diff,a)
print(res+1)

Submission status: Wrong Answer

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

tem_list = []
for h in H:
    tem = abs(A*1000 - T*1000 - h*6)
    tem_list.append(tem)

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

Submission status: Wrong Answer

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

tem_list = []
for h in H:
    tem = abs (A*1000 - T*1000 - h*6)
    tem_list.append(tem)

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

Submission status: Wrong Answer

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

tem_list = []
for h in H:
    tem = abs (A - T - h*0.006)
    tem_list.append(tem)

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

Submission status: Wrong Answer

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

tem_list = []
for h in H:
    tem = abs (A - T-h*0.006)
    tem_list.append(tem)


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

Submission status: Wrong Answer

Solution code:
N = int(input())
TA = input().split()
T = int(TA[0])
A = int(TA[1])
hs = input().split()
hs = [int(h) for h in hs]

dic = {}
for i in range(len(hs)):
	dic[i+1] = T - hs[i]*0.006

dif = int()
ind = -1
for i,j in dic.items():
	if dif <= abs(j-A):
		dif = abs(j-A)
		ind = i

print(ind)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

near = 10001
ans = 0
for i, v in enumerate(temp):
    sub = a - v
    print(sub)
    if abs(near) > abs(sub):
        near = sub
        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()))
h = 0
D = 100000
for x in H:
    d = abs(A - x * 0.006)
    if D > d:
        D = d
        h = x
print(H.index(h) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cs = [(index,T-h*0.006) for index,h in enumerate(Hs)]
cs = max(cs, key=lambda x:x[1])
print(cs[0]+1)

Submission status: Wrong Answer

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

res, height = 0, 100001
for i in range(N) :
    tmp = T - H[i] * 0.006
    if height > abs(T - tmp) :
        height = abs(T - tmp)
        res = i + 1

print(res)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

h = np.array(h, dtype = float)
h = t - 0.006 * h
h = abs(a-h)
print(np.argmin(h))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())

anss = 99999
ans = 0
i = 1

for hi in H:
    if abs(A-anss) > abs(T - hi *0.006):
        anss = T - hi *0.006
        ans = i
    i = i
    
print(ans)