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
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    cand = -1
    diff = 1000000
    for i, h in enumerate(H):
        if abs(A - T - h * 0.06) < diff:
            cand = i + 1
            diff = abs(A - T - h * 0.06)
    print(cand)



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

diff_temp = [abs(x - (a - t) / 0.006) for x in h]
print(diff_temp.index(min(diff_temp)) + 1)

Submission status: Wrong Answer

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

diff_temp = [abs(x - (a - t) / 0.006) for x in h]
print(h[diff_temp.index(min(diff_temp))])

Submission status: Wrong Answer

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

min_diff_temp = 110
out_i = 0
for i, x in enumerate(h):
    diff_temp = abs(a - (t - x * 0.006))
    if diff_temp < min_diff_temp:
        min_diff_temp = diff_temp
        out_i = i + 1

print(out_i)

Submission status: Wrong Answer

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

min_temp = 50
out_i = 0
for i, x in enumerate(h):
    diff_temp = abs(a - (t - x * 0.006))
    if diff_temp < min_temp:
        min_temp = diff_temp
        out_i = i + 1

print(out_i)

Submission status: Wrong Answer

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

min_temp = 50
out_i = 0
for i, x in enumerate(h):
    diff_temp = a - (t - x * 0.006)
    if diff_temp < min_temp:
        min_temp = diff_temp
        out_i = i + 1

print(out_i)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    l = []
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    for  i in range(N):
      l.append(abs(A-abs(T-h[i]*6)))
    print(l.index(min(l))+1)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

def main():
    l = []
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    for  i in range(N):
      l.append(abs(A-(T-h[i]*6)))
    print(l.index(min(l))+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()))
at = [abs(t-i*0.006-5) for i in h ]
print(at.index(min(at))+1)

Submission status: Wrong Answer

Solution code:
n = input()
t, goal_temp = input().split()
high_list = [int(i) for i in input().split()]
best_score, best_index = float('inf'), float('inf')

for i,high in enumerate(high_list):
  temp = int(t) - high*0.006
  if abs(abs(int(goal_temp)) - abs(temp)) < best_score:
    best_score = abs(abs(int(goal_temp)) - abs(temp))
    best_index = i
print(best_index+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
ans=0
temp=-999999999
for i in range(0,n):
  temph=abs(t-int(h[i])*0.006-a)
  temp=min(temph,temp)
  if temp==temph:
    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 = 0
min_t = 10 ** 10
for i in range(n):
    hi = h[i]
    if abs(a - t - hi * 0.006) < min_t:
        ans = i
        min_t = abs(a - (t - hi * 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()))

ans = 0
min_t = 10 ** 10
for i in range(n):
    hi = h[i]
    if abs(a - t - hi * 0.006) < min_t:
        ans = i
        min_t = abs(a - t - hi * 0.006)
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()))
for i in range(n):
    h_list[i] = t - h_list[i]*0.006
print(h_list.index(max(h_list))+1)

Submission status: Wrong Answer

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


def solve(n, t, a, h):
    ans = 0
    abstemp = abs(a - (t - h[0] * 0.006))
    for i in range(1, n):
        temptmp = abs(a - (t - h[i] * 0.006))
        if temptmp < abstemp:
            ans = i
    return ans + 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = input()
T, A = map(int, input().split())
print(T)
temperatures = list(map(int, input().split()))
 
r = 50000000000000
results = ''
 
list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):
    ondo_sa = avg_temp - A

    if ondo_sa < 0:
        ondo_sa = - ondo_sa

    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

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):
  score = A - (T - H[i] * 0.006)
  L.append(score)
m = min(L)
print(L.index(m)+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

r = 50000000000000
results = ''

list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - avg_temp
    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Wrong Answer

Solution code:
N = input()
T, A = map(int, input().split())
temperatures = list(map(int, input().split()))
 
r = 50000000
results = ''
 
list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - abs(avg_temp)
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Wrong Answer

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

r = 50000000
results = ''

list = [T - abs(t * 0.006) for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - avg_temp
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Wrong Answer

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

r = 50000000
results = ''

list = [12 - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - avg_temp
    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Wrong Answer

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

r = 50000000
results = ''

list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - avg_temp
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Wrong Answer

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

r = 50000000
results = ''
temperatures = list(map(int, input().split()))
list = [12 - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):
    ondo_sa = A - avg_temp
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)

Submission status: Wrong Answer

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

for i in range(n):
    tmp = abs((t-int(H[i])*0.006)-a)
    A.append(tmp)

print(i)

Submission status: Wrong Answer

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

diff = []

for each_h in h:
  diff.append(abs(a - (t - each_h*0.06)))

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

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [(T - i * 0.006)-A for i in H]

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

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [(T - i * 0.006) for i in H]

if any(i <= 0 for i in list) :
    print(list.index(max(list)) + 1)
else :
    print(list.index(min(list)) + 1)

print(list)

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [A-(T - i * 0.006) for i in H]

if any(i < 0 for i in list) :
    print(list.index(max(list)) + 1)
else :
    print(list.index(min(list)) + 1)

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [A-(T - i * 0.006) for i in H]

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

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [A-(T - i * 0.006) for i in H]

print(list.index(min(list)))

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [12-(T - i * 0.006) for i in H]

print(list.index(min(list)))

Submission status: Wrong Answer

Solution code:

N = int(input()) # 地点の候補数
T, A = map(int, input().split()) # T:平均気温 A:温度
H = list(map(int, input().split())) #標高(x)

list = [12-(T - i * 0.006) for i in H]

print(list.index(max(list)))

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    t,a=map(int, input().split())
    h=list(map(int,input().split()))
    ans=n+1
    minabs=10**18
    for i in range(n):
        tempabs=abs(a-(t-h[i]*0.006))
        if tempabs<minabs:
            minabs=tempabs
            ans=i+1
    print(ans)
#resolve()

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    t,a=map(int, input().split())
    h=list(map(int,input().split()))
    l=[]
    ans='a'
    minabs=10**18
    for i in range(n):
        tempabs=abs(a-t-h[i]*0.006)
        if tempabs<minabs:
            minabs=tempabs
            ans=i+1
    print(ans)
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
T , A = (map(int , input().split()))
H = list(map(int , input().split()))
hh = {i:H[i] for i in range(N)}
for i in range(N):
    hh[i] = int(abs((T - hh[i] * 0.006) - A))
ans = 0
hhh = min([i for i in hh.values()])
for k,v in hh.items():
    if v == hhh:
        ans = k+1
print(ans)

Submission status: Wrong Answer

Solution code:
# 4問目類題3
N = int(input())
T,A = map(int, input().split())
H = [int(i) for i in input().split()]
HH = [abs(T-k*0.006-A) for k in H]
print(min(HH))

Submission status: Wrong Answer

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

lt = list()
for i in range(N):
    lt.append(abs(A - (T - lh[i]*0.006)))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    T, A = list(map(int,_in[1].split(' ')))  # type:list(int)
    H_arr = list(map(int,_in[2].split(' ')))  # type:list(int)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    x = (T-A)/0.006
    diff = [h-x for h in H_arr]
    cnt = diff.index(min(diff))+1
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
*h, = map(int, input().split())
temp = a - (t - h[0] * 0.006)
ans = 0
for i in range(n):
    if abs(a - (t - h[i] * 0.006)) < temp:
        ans = i
print(ans + 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()))
b = []
for h in h_:
    b.append(a - (t - 0.006 * h)) 

print(np.argmin(b)+1)

Submission status: Wrong Answer

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

avg = [(T - H[i]) * 0.006 for i in range(N)]
diff = [abs(avg[i] - A) for i in range(N)]
idx = diff.index(min(diff))
print(idx + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
judge = abs(A - (T - 0.006*H[0]))
k = 0

for i in range(N):
  a = abs(A - (T - 0.006*H[i]))
  if judge > a:
    judge = a
    k = i
    
print(k)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
t,a=map(int,input().split())
h=[abs(a-t-int(i)*0.006) for i in input().split()]
print(np.argsort(h)[0]+1)

Submission status: Wrong Answer

Solution code:
#複数の整数入力を受け付ける関数
def datain(num):

    data = []
    iscnt = True

    while iscnt:
        for val in map(int,input().split()):
            data.append(val)
            if len(data) == num:
                iscnt = False
                break
        
    return data

data = datain(int(input())+2)

ans = 0
temp = [abs(data[1]-(data[0]-0.006*temp)) for temp in data[2:]]
print(temp)

for i,val in enumerate(temp):
    if temp[ans] > val:
        ans = i

print(ans+1)

Submission status: Wrong Answer

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

tmp=10**10
num=0
for i in range(n):
    if abs(abs(a)-abs(t-l[i]*0.006)) < tmp:
        num=i+1
        tmp=abs(abs(a)-abs(t-l[i]*0.006))
    else:
        continue

print(num)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
minitemp = 10*100
for i in range(len(H)):
  H[i] = abs(t-H[i]*0.006)
  minitemp = min(minitemp,H[i])
for j in range(len(H)):
  if H[j] == minitemp:
    print(j+1)
    break

Submission status: Wrong Answer

Solution code:
option = int(input())
ref_t, tmp_id = (int(n) for n in input().split())
height = list((int(n) for n in input().split()))

ave_t = []
for i in range(option):
  ave_t.append(abs(tmp_id - (ref_t - height[i] * 0.06)))

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

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int, input().split())
list=list(map(int, input().split()))
l_b=[]
d=0
c=0
for i in range(N):
  d=A-(T-list[i]*0.006)
  if d<0:
    d=-d
  l_b.append(d)
print(l_b.index(min(l_b)))

Submission status: Wrong Answer

Solution code:
N=int(input())
T,A=map(int, input().split())
list=list(map(int, input().split()))
l_b=[]
d=0
c=0
for i in range(N):
  d=A-(T-list[i]*0.006)
  if d<0:
    d=-d
  l_b.append(d)
for i in range(N-1):
  if l_b[i]<l_b[i+1]:
    c=i
print(c+1)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = np.array([int(i) for i in input().split()])
Height = np.array([int(i) for i in input().split()])
Ave =np.array([T - i*0.006 for i in Height])
purpose = [abs(i) for i in (Height - Ave)]
print(purpose.index(min(purpose)) + 1)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = np.array([int(i) for i in input().split()])
Hi = np.array([int(i) for i in input().split()])
Ave =np.array([T - i*0.006 for i in Hi])
purpose = [abs(i) for i in (Hi - Ave)]
print(purpose.index(min(purpose)) + 1)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
T,A = np.array([int(i) for i in input().split()])
Hi = np.array([int(i) for i in input().split()])
Ave =np.array([T - i*0.006 for i in Hi])
purpose = [abs(i) for i in (Hi - Ave)]
print(purpose.index(min(purpose)) + 1)

Submission status: Wrong Answer

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

for i in range(1, n):
    num = abs(a-(t-h[i]*0.006))
    if num < m:
        ans = i
        m = num

print(ans+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
average_tmp = list(map(lambda x, t=T: int(t - x * 0.006), h))

count  = 0
for q in range(n):
    if T < (A - average_tmp[q]):
        count, T = q, T
print(count + 1)

Submission status: Wrong Answer

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


# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = T - (abs(H[i]) * 0.006)
# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs(H[k] - abs(A))
# 差が最も小さいもののリスト番号に1を足して出力
print((H.index(min(H)))+1)

Submission status: Wrong Answer

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


# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = (T*1000) - ((H[i]*1000) * 6)
# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs((H[k]*1000) - abs(A*1000))
# 差が最も小さいもののリスト番号に1を足して出力
print((H.index(min(H)))+1)

Submission status: Wrong Answer

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


# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = T - (H[i] * 0.006)
# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs(H[k] - abs(A))
# 差が最も小さいもののリスト番号に1を足して出力
print(H.index(min(H))+1)

Submission status: Wrong Answer

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

print(H)
# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = T - (H[i] * 0.006)
print(H)
# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs(H[k] - abs(A))
print(H)
# 差が最も小さいもののリスト番号に1を足して出力
print(H.index(min(H))+1)

Submission status: Wrong Answer

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

# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = int(T - (H[i] * 0.006))

# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs(H[k] - abs(A))

# 差が最も小さいもののリスト番号に1を足して出力
print(H.index(min(H))+1)

Submission status: Wrong Answer

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

# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = int(T - (H[i] * 0.006))

# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs(H[k] - A)

# 差が最も小さいもののリスト番号に1を足して出力
print(H.index(min(H))+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
min_num=0
for i in range(len(a)):
    d = abs(T-0.006*a[i]-A)
    if d < min_val:
        min_val = d
        min_num = i
print(min_num+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
min_num=0
for i in range(len(a)):
    if abs(T-0.006*a[i]-A) <= min_val:
        min_val = abs(T-0.006*a[i]-A)
        min_num = i
print(min_num+1)

Submission status: Wrong Answer

Solution code:
input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
n = 1
for i in range(len(a)):
    if abs(T-0.006*i-A) <= min_val:
        min_val = abs(T-0.006*i-A)
        min_num = n
    n += 1
print(min_num)

Submission status: Wrong Answer

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

temperture_li = [a-(t-h_inputs[i]*0.006) for i in range(n)]
ans = temperture_li.index(min(temperture_li))

print(ans+1)

Submission status: Wrong Answer

Solution code:
n = int(input()) # 入力が1つ
t, a = map(int, input().split()) # 入力が複数
h = [int(i) for i in input().split()] # 配列で数字

ans = 0
nearest = abs(h[0] * 0.006 - a)
for i in range(n):
    temp = abs(h[i] * 0.006 - a)
    if temp < nearest:
        nearest = temp
        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()))
minv = abs(A - H[0] * 0.006)
ans = 1
for i in range(N):
    if minv > abs(A - T-H[i]*0.006):
        minv = 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())
H = list(map(int, input().split()))
minv = abs(T - H[0] * 0.006)
ans = 1
for i in range(N):
    if minv > abs(A - T-H[i]*0.006):
        minv = 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())
H = list(map(int, input().split()))
minv = abs(T - H[0] * 0.006)
ans = 1
for i in range(N):
    if minv > abs(T - T-H[i]*0.006):
        minv = abs(T - T-H[i]*0.006)
        ans = i+1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = t-h[0]*0.006
j = abs(a-s)
ans = 1

for i,k in enumerate(range(len(h))):
    s = t - h[i]*0.006
    if abs(a-s) < j:
        j = a-s
        ans = k + 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

h = [  abs(a - (t - i*.006)) for i in h]

mins = h[0]
index = 0
print(h)
for i in range(1, n):
  if h[i] < mins:
    mins = h[i]
    index = i
    
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()))
h = [abs(a - (t - i*.006)) for i in h]

mins = h[0]
index = 0
for i in range(1, n):
  if h[i] < mins:
    mins = h[i]
    index = i
    
print((i+1))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# abc113_b.py
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
lowest = 10**9
ans = 0
for i in range(N):
    tmperture = abs(A-(T-H[i]*0.006))
    print(tmperture)
    if abs(tmperture) < lowest:
        ans = i + 1
        lowest = tmperture
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a=int(input())
ave,risou= map(int, input().split())
h=[0]*a
h=list(map(int, input().split()))
for i in range(a):
    h[i]=risou-abs(ave-(h[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=[0]*n
h=list(map(int,input().split()))
for i in range(n):
  h[i]=abs(12.0-0.006*float(h[i])-5.0)

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
temp = []
for i in range(n):
  temp.append(a-(t-H[i]*0.006))
temp_abs = [abs(j) for j in temp]
print(min(temp_abs))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

min_diff = 10**9
for i in range(n):
    diff = abs(a - t - h[i]*0.006)
    if min_diff > diff:
        min_diff = diff
        min_suffix = i
print(min_suffix+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
y = 0
z = 0
# aに近い値を調べる
h = list(map(int, input().split()))
for i in range(1,n+1):
  x = t - (h[i-1] * 0.006)
  print(x)
  if y ==0:
    y=x
    z=i
  else:
    if abs(x-a) <= abs(y-a):
      y = x
      z = i
print(z)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
y = 0
# aに近い値を調べる
h = list(map(int, input().split()))
def comp(a,b,c):
  if abs(a-c) >= abs(b-c):
    return a
  else:
    return b
for i in range(n):
  x = t - (h[i] * 0.006)
  #print(x)
  if y ==0:
    y=x
  else:
    y=comp(x,y,a)
    z=i+1
print(z)