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()))
d_degree = 1000000
ans = 0
for i in range(n):
    degree = t - h[i]*0.006
    if d_degree > a - degree:
        d_degree = a - degree
        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()))
d_degree = 1000
ans = 0
for i in range(n):
    degree = t - h[i]*0.006
    if d_degree > a - degree:
        d_degree = a - degree
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
temp = 10 ** 6
ans = 0
height = list(map(int, input().split()))
for i, h in enumerate(height):
    diff = abs(a - (t - h * 0.006))
    print(diff)
    if temp > diff:
        temp = 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()))
old_k =100000
for i in range(n):
    k = abs(a-h[i]*0.006)
    if old_k > k:
        old_k =k
        count =i+1
print(count)

Submission status: Wrong Answer

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

rT = T - (H[0]*0.006)
dif = A - rT
ans = 1

for i in range(1, N):
    rTi = T - (H[i]*0.006)
    e_dif = A - rTi
    if e_dif<dif:
        dif = e_dif
        ans = i+1

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    T, A = il()
    H = il()
    S = []

    for h in H:
        S.append(A-(T-(h*0.006)))
    print(S.index(min(S))+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()))
z=[A-T+i*0.006 for i 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()))
m=100100100100
for i in range(N):
  if abs(A-H[i])<m:
    m=abs(A-H[i])
    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()))
ans = -1.0
d = 1e100
for i,j in enumerate(h):
  if abs(t - j*0.006) < d:
    ans = i+1
    d = abs(t - j*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()))
ans = -1.0
d = 1e100
for i,j in enumerate(h):
  if abs(t - j*0.006) < 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_t = 10000
ans = 0
 
for i in range(N):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l <= ans_t:
    ans_t = l
    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_t = 10000
ans = 0
 
for i in range(N):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    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_t = 10000
ans = 0
 
for i in range(len(H)):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    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(" ")))
ans_t = 10000
ans = 0

for i in range(len(H)):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    ans = 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_t = 10000
ans = 0
for i in H:
  t = T - i * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    ans = i
print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
height = list(map(int, input().split()))
temperature = list(abs(T - i * 0.006) for i in height)
print(temperature.index(min(temperature)) + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
height = list(map(int, input().split()))
temperature = list(abs(T - i * 0.006) for i in height)
print(temperature.index(min(temperature)))

Submission status: Wrong Answer

Solution code:
#ABC-113-B
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = -1
ans_diff = 10**19

for i in range(N):
    tempe = (T-H[i]*0.006)
    if ans_diff > A - tempe:
        ans_diff = A - tempe
        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()))

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
li = list(map(int,input().split()))	
temp = 50
ans = 0
mean_temp=[]
for j in range(N):
    mean_temp.append(T-li[j]*0.006)
for k in range(N):
    if abs(temp-A)>abs(mean_temp[k]-A):
        ans = k+1
        temp = mean_temp[k]
    else:
        pass
    

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
li = list(map(int,input().split()))	
temp = 50
ans = 1
mean_temp=[]
for j in range(N):
    mean_temp.append(T-li[j]*0.006)
for k in range(N):
    if abs(temp-A)>abs(mean_temp[k]-A):
        ans = k+1
        temp = mean_temp[k]
    else:
        pass
    

print(ans)

Submission status: Wrong Answer

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

ans = 10**9
c = 0
for i in range(n):
    temp = abs(a - (t * h[i] - 0.006))
    if min(ans,temp) == temp:
        ans = temp
        c = h[i]
a = h.index(c)
print(a+1)

Submission status: Wrong Answer

Solution code:
N = input()
T, A = map(int, input().split())
H = list(map(int, input().split()))
T_H = [T - h*0.006 for h in H]
diff = [abs(A-t) for t in T_H]
print(diff.index(min(diff)))

Submission status: Wrong Answer

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

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A * 1000 - T*1000 - H[i] * 0.006 * 1000)
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i
        minTmep = compare

print(place + 1)

Submission status: Wrong Answer

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

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A * 1000 - T - H[i] * 0.006 * 1000)
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i
        minTmep = compare

print(place + 1)

Submission status: Wrong Answer

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

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A - T - H[i] * 0.006)
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i
        minTmep = compare

print(place + 1)

Submission status: Wrong Answer

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

first = True
place = 0
minTmep = 0

H = list(map(int, input().split()))
for i in range(0,len(H)):
    compare = abs(A - T - H[i] * 0.006)
    if first == True:
        place = i
        minTmep = compare
        first = False
    
    if minTmep > compare:
        place = i

print(place + 1)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int, input().split())
p=0
cc=10**6
A*=1000
for i, T in enumerate(map(lambda h:12000-int(h)*6,input().split())):
    d=abs(T - A)
    if cc > d:
        cc=d
        p=i+1
print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(int(abs(min(list))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

A = list(map(lambda x: abs(t-x*0.006), h))
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx+1)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

A = list(map(lambda x: t-x*0.006, h))
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#print(h)
l =[]
for i in range(n):
  a = T - h[i]*0.006
  print(a)
  b = abs(a-A)
  l.append(b)
  print(l)
c = l.index(min(l))
print(c+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):
  a = T - h[i]*0.006
  b = int(abs(a-A))
  l.append(b)
c = l.index(min(l))
print(c+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 1
p = abs(a - t - (h[0] * 0.006))
for i in range(1,n):
    if p > abs(a - t - (h[i] * 0.006)):
        p = min(p, abs(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())
list_oA = [51]
list_lA = [10*5-6/1000]
o_kome = []
l_kome = []
H = list(map(int,input().split()))
kome = 0
for i in H:
    T = t -i*6/1000
    kome += 1
    if T == a:
        print(kome)
    elif T > a:
        list_oA.append(T)
        o_kome.append(kome)
    else:
        list_lA.append(T)
        l_kome.append(kome)
sa_o = min(list_oA)- a
sa_l = a - max(list_lA)
if sa_o > sa_l:
    print(max(l_kome))
else:
    print(min(o_kome))

Submission status: Wrong Answer

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

temp = abs(a - (t - h_list[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(i)

Submission status: Wrong Answer

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

for i in range(N):
	list.append(abs(T - H[i] * 0.0006 - A))

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

Submission status: Wrong Answer

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

for i in range(N):
	list.append(abs(T - H[i] * 0.0006 - A))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
index = 0
degree = 0
for i in range(len(l)):
  diff = (t-l[i]*0.006)-a
  if degree > diff:
    degree = diff
    index = i
print(i+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
ansl = []
add = ansl.append
for i in l:
  av = t-i*0.006
  if av < 0:
    add(a+av)
  else:
    add(a-av)
print(ansl.index(min(ansl))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
numberOfPlace = int(input())
standardTemparature, bestTemparature = tuple(input().split(" "))
placeList = input().split(" ")

temparetureDifferencesList = list(map(lambda evelation: int(standardTemparature) - ( int(evelation) * 0.006 ), placeList))
theBestPlaces = sorted(temparetureDifferencesList)
theBestPlace = temparetureDifferencesList.index(theBestPlaces[0])

print(theBestPlace)

Submission status: Wrong Answer

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

L = [int(abs(A-(T-i*0.006))) for i in H]
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()))

L = [abs(int(A-(T-i*0.006))) for i in H]
print(L.index(min(L))+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
p_list = []
for i in h:
    i = (t * 1000 - i * 1000 * 6) - (a * 1000)
    if i < 0:
        i = -i
    p_list.append(i)
min_p_list = p_list.index(min(p_list))
print(min_p_list + 1)

Submission status: Wrong Answer

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

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()))
h=np.array(H)
a=np.zeros(N)
t=np.zeros(N)
res=0
for i in range(N):
  t[i]=T
for j in range(N):
  a[j]=A
s=(t-(a-0.006*h))**2
c=sorted(s)
for k in range(N):
  if s[k]==c[0]:
    res=k+1
print(res)

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()))
h=np.array(H)
a=np.zeros(N)
t=np.zeros(N)
for i in range(N):
  t[i]=T
for j in range(N):
  a[j]=A
s=(t-(a-0.006*h))**2
c=sorted(s)
for k in range(N):
  if s[k]==c[0]:
    res=k+1
print(res)

Submission status: Wrong Answer

Solution code:
import math
import itertools
import statistics
#n = int(input())
n = int(input())
t, a = list(map(int, input().split()))
h =  list(map(int, input().split()))

m = 100000
min_index = -1
for i in range(n):
    tem = t-h[i]*0.006
    if abs(t-tem) < m:
        m = abs(t-tem)
        min_index = i

print(min_index+1)

Submission status: Wrong Answer

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

ans_num = 1
ans_para = h[0]
for i, r in enumerate(h):
    deg = t - (r * 0.006)
    ans_para_deg = t - (ans_para * 0.006)
    if (a - ans_para_deg) >= (a - deg):
        ans_para = r
        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()))

ans_para = 0
ans_num = 0
for i, r in enumerate(h):
    if abs(a - ans_para) >= abs(a - (t - r * 0.006)):
        ans_num = i+1
        ans_para = r
print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
def high(h):
  return T - h*0.006
hs = [high(x) for x in H]
ans = 0
for h in hs:
  if ans < abs(A-h):
    ans = h
print(hs.index(ans)+1)

Submission status: Wrong Answer

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
m = dlist[0]

for i in range(1,n):
    if dlist[i-1] <= dlist[i]:
        if dlist[i-1] <= m:
            m = dlist[i-1]
        else:
            pass
    else:
        pass

        
print(dlist.index(m) + 1)

Submission status: Wrong Answer

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
m = 0
for j in range(1,n):
    if dlist[j-1] <= dlist[j]:
        m = dlist[j-1]
    else:
        m = dlist[j]
        
        
print(dlist.index(m) + 1)

Submission status: Wrong Answer

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
        
m = 0
for j in range(n):
    if dlist[j-1] <= dlist[j]:
        m = dlist[j-1]
    else:
        m = dlist[j]
        
print(dlist.index(m) + 1)

Submission status: Wrong Answer

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
        
m = 0
for j in range(n):
    if dlist[j-1] <= dlist[j]:
        m = dlist[i-1]
    else:
        m = dlist[j]
        
print(dlist.index(m) + 1)

Submission status: Wrong Answer

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
        
m = 0
for j in range(n):
    if dlist[j-1] <= dlist[j]:
        m = dlist[i-1]
        print('1')
    else:
        m = dlist[j]
        print('2')
print(dlist.index(m) + 1)

Submission status: Wrong Answer

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

for i in range(n):
    d = t - h[i] * 0.006 - a
    
    if d >= 0:
        dlist.append(d)
    else:
        d = -d
        dlist.append(d)
        
        
m = 0
for j in range(n):
    if dlist[i-1] <= dlist[i]:
        m = dlist[i-1]
    else:
        m = dlist[i]
        
print(dlist.index(m) + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())
x = (A-T)/0.006
diff = float("inf")
ret = 0
for i,h in enumerate(H):
  if abs(h - x) < diff:
    diff = abs(h-x)
    ret = i
print(ret+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
H = map(int,input().split())
x = (A-T)/0.006
diff = float("inf")
ret = 0
for i,h in enumerate(H):
  if abs(h - x) < diff:
    diff = abs(h-x)
    ret = i
print(ret)

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
minval=10**5
ans=0
for i in range(N):
    val=abs(A-(T-H[i]*0.006))
    if val<minval:
        val=minval
        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()))
minval=10**5
ans=0
for i in range(N):
    val=abs(T-(12-H[i]*0.006))
    if val<minval:
        val=minval
        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()))

print(int(min(abs(A-(12-H[i]*0.006)) for i in range(N))))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

n = int(input())
(t, a) = [int(i) for i in input().rstrip().split(" ")]

point_list = [int(i) for i in input().rstrip().split(" ")]

ans = -1
nearest = 100000

for i in range(n):
    kion = abs(t - (point_list[i] * 0.006) - a)
    if a < nearest:
        ans = i + 1
        nearest = kion

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))
min_err = 10000
num = -1
for i in range(N):
    temperture = T-H_list[i]*0.006
    err = abs(A - temperture)
    print(err)
    if err < min_err:
        min_err = err
        num = i
print(num+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = [int(i) for i in input().split()]
mn = 10**9
for i in range(n):
    mn_kouho = a-(t-h[i]*0.006)
    if mn > mn_kouho:
        mn = mn_kouho
        ans = i+1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_li = list(map(int, input().split()))
min_abs = 10 ** 9
num = 2000
for i in range(N) :
    mean_t = T - H_li[i] * 0.006
    abs_ha = abs(H_li[i] - mean_t)
    if abs_ha < min_abs :
        min_abs = abs_ha
        num = i + 1
print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H_li = list(map(int, input().split()))
min_abs = [-1, 10 ** 9]
for i in range(N) :
    mean_t = T - H_li[i] * 0.006
    abs_ha = abs(H_li[i] - mean_t)
    if abs_ha < min_abs[1] :
        min_abs = [i + 1, abs_ha]
print(min_abs[0])

Submission status: Wrong Answer

Solution code:
n=int(input())

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
Temp, A = list(map(int, input().split()))
H = list(map(float, input().split()))
k = 0
target = float("inf")
n = []
for i, v in enumerate(H, start=1):
    k = Temp - v * float(0.006)
    if target > abs(k - A):
        target == abs(k - A)
        n.append(i)

print(n[-1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
T, A=map(int, input().split())
H=input().split()
V=[abs(T-0.06*int(h)-A) for h in H]

minv = V[0]
index=0

for i,v in list(enumerate(V)):
    if v<minv:
        minv=v
        index=i

print(index+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
Temperature, A_target = map(int, input().split())
Height = list(map(int, input().split()))

l = [abs(A_target - Temperature - 0.006 * i) for i in Height]
print(l.index(min(l)) + 1)

Submission status: Wrong Answer

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

H_index=[]
for i in range(N):
    H_index.append((H[i],i+1))
H_index=sorted(H_index,key=lambda x:x[0])

H_real=(T-A)/0.006

index=0
for i in range(N):
    if H_real>H_index[i][0]:
        index+=1
if 0<index<N:
    if abs(H_index[index-1][0])<abs(H_index[index][0]):
        index-=1
print(H_index[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()]

l = [a-(t-i*0.006) for i in h]
print(l.index(min(l))+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()]

l = [a-(12-i*0.006) for i in h]
print(l.index(min(l))+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()]

l = [abs(a-(12-i*0.006)) for i in h]
print(l.index(min(l))+1)

Submission status: Wrong Answer

Solution code:
# Problem https://atcoder.jp/contests/abc113/tasks/abc113_b
# Python 3rd Try


class Problem:
    def __init__(self, allnumber, maxthermo, avepoint, highs):
        self.allnumber = allnumber
        self.maxthermo = maxthermo
        self.avepoint = avepoint
        self.highs = highs

    def problemprint(self):
        print(self.allnumber)
        print(self.maxthermo)
        print(self.avepoint)
        print(self.highs)

    def solve(self):
        maxdiff = 100000.0
        result = 1
        for j in range(0, self.allnumber):
            difftemp = abs(self.avepoint-(self.maxthermo-self.highs[0]*0.006))
            if difftemp < maxdiff:
                maxdiff = maxdiff
                result = j+1
        return result


if __name__ == "__main__":
    N = int(input())
    T, A = map(float, input().split(' '))
    HI = list(map(float, input().split(' ')))
    print(Problem(N, T, A, HI).solve())

Submission status: Wrong Answer

Solution code:
# Problem https://atcoder.jp/contests/abc113/tasks/abc113_b
# Python 3rd Try


class Problem:
    def __init__(self, allnumber, maxthermo, avepoint, highs):
        self.allnumber = allnumber
        self.maxthermo = maxthermo
        self.avepoint = avepoint
        self.highs = highs

    def problemprint(self):
        print(self.allnumber)
        print(self.maxthermo)
        print(self.avepoint)
        print(self.highs)

    def solve(self):
        maxdiff = 10**9+7
        result = 1
        for j in range(0, self.allnumber):
            difftemp = abs(self.avepoint-(self.maxthermo-self.highs[0]*0.006))
            if difftemp < maxdiff:
                maxdiff = maxdiff
                result = j+1
        return result


if __name__ == "__main__":
    N = int(input())
    T, A = map(float, input().split(' '))
    HI = list(map(float, input().split(' ')))
    print(Problem(N, T, A, HI).solve())

Submission status: Wrong Answer

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