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: Runtime Error

Solution code:
N = int(input())
T,A  =[int(i) for i in input().split()]
H = [int(i) for i in input.split()]
diff = (abs(A-(T-H[0]*0.006)))
palace = 0
for i in range(H):
    if(abs(A-(T-H[i]*0.006)) < diff):
        palace = i
        diff = abs(A-(T-H[i]*0.006))
print(palace)

Submission status: Runtime Error

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

ans = 0
min_diff = 10*5
for i in range(N):
  if abs((T - H*0.006) - A) < min_diff:
    ans = i+1
    min_diff = abs((T - H*0.006) - A)
print(ans)

Submission status: Runtime Error

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

ans = 0
min_diff = 10*5
for i in range(N):
  if abs((T - H*0.006) - A) < min_diff:
    ans = i+1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_diff_list = list(map(lambda x: abs(t - x * 0.006 - a), t_mean_list))

print(t_diff_list.index(min(t_val_list)))

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_val_list = list(map(lambda x: t - x * 0.006, t_mean_list)

diff_min = math.abs(t_val_list[0] - a)
a_min = 1
for i in range(1, n):
  diff = math.abs(t_val_list[i] - a)
  if diff < diff_min:
    diff_min = diff
    a_min = i
  else:
    continue

print(a_min)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

min = float('inf')
idx = None
for i in range(len(H)):
    if min > abs(A - T + H[i] * 0.006):
        idx = i + 1å

print(i)

Submission status: Runtime Error

Solution code:
N=int(input())
T, A=map(int, input().split())
N=list(map(int,input().split()))
temp=list(map(lambda x: abs(A-(T-0.006*x)),N))
temp.index(min(temp)+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int,input())
H = list(map(int,input()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	int n, t, a, h[1050], cnt;
	float ave[1050], min;
	cin >> n >> t >> a;
	rep(i, n){
		cin >> h[i];
		ave[i] = t-h[i]*0.006f;
		if(i == 0){
			min = fabs(ave[i]-h[i]);
			cnt = i;
		}else{
			if(min > fabs(ave[i]-h[i])){
				min = fabs(ave[i]-h[i]);
				cnt = i;
			}
		}
	}
	cout << cnt+1 << endl;
}

Submission status: Runtime Error

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

diff=1000000
ans = 0

for i in H_list:
	 
    if abs(A-(T−i*0.006)) < diff
    	diff = abs(A-(T−i*0.006))
        ans=i
        
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
N=int(input())
T,A=(int(i) for i in input().split())
H=[int(i) for i in input().split()]
H=np.array([1000,2000])
T=np.array([T for i in range(N)])
print(abs(A-(T-H*0.006)).argmin())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = 0
for i in li:
    if abs(nearest - a) > abs((t - i * 0.006) - a):
        nearest = i
print(li.index(nearest))

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = 0
for i in li:
    if abs(nearest - a) > abs((t - i * 0.006) - a):
        nearest = i
print(l.index(nearest) + 1)

Submission status: Runtime Error

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

result = 0
min_dif = 10000
for i in range(N):
  dif = abs(A, T - HS[i] * 0.0060 )
  if dif < min_dif:
    min_dif = dif
    result = i
print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
    n = int(input())
    t, a = [ int(v) for v in input().split() ]
    height_list = [ abs(t-a-int(V)*0.006) for v in input().split() ]
    print(height_list.index(min(height_list))+1)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = [ int(v) for v in input().split() ]
height_list = [ abs(t-a-int(V)*0.006) forfor v in input().split() ]
print(height_list.index(min(height_list))+1)

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    ondo = 0
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, i+1])
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main(

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
t,a = map(int,input().split())
height = [int(input()) for i in range(N)]
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
print(min(subduction))

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
height = [int(input()) for i in range(N)]
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
print(min(subduction))

Submission status: Runtime Error

Solution code:
N=int(input())
T,A = map(int,input().split())
H=list(map(float,input().split()))
tm=0
tem=0
TEM = []
TM = []
for h in H:
    tm=T-h*0.006
    TM.append(tm)
for tm in TM:
    tem=abs(tm-A)
    TEM.append(tem)
num = TEM.index(min(1))
print(num+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

ans = 10000
ans_ind

for i in range(N):
  temp = T - 0.006 * hight_list[i]
  diff = abs(temp - A)
  if  diff < ans:
    ans = diff
    ans_ind = i
    
print(i+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
imin=100000
suf=0
for i in range(n):
  h[i]=t- h[i]＊0.006
  if imin > abs(a- h[i]):
    imin=abs(a- h[i])
    suf=i
print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,inout().split())
h=list(map(int,input().split()))
def abs(k,l):
  if k>l:
    return k-l
  else:
    return l-k  
b=20000313
cnt=0
for i in range(n):
  if b>abs(a,t-0.006*h[i]):
    b=t-0.006*h[i]
    cnt=i
  else:
    b=b
    cnt=cnt
print(cnt+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
ta=list(input().split())
T=int(ta[0])
A=int(ta[1])
Hi=int(list(input().split()))
print(min(abs(A-t))for i in t=T-Hi[i]*0.006)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
dif = list(map(lambda x: abs(T - int(x) * 0.006 - A), input().split()))
print(dif.index(min(x_list)) + 1)

Submission status: Runtime Error

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

Ts = list(map(lambda x: T-x * 0.006), Hs)

i = 0
v = 0
for _i, _T in enumerate(Ts):
    if abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)

Submission status: Runtime Error

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

Ts = list(map(lambda x: T-x * 0.006), Hs)

i = 0
v = 0
for _i, _T in enumerate(Ts):
    if abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)

Submission status: Runtime Error

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

Ts = list(map(lambda x: T-x * 0.006), Hs)

i = 0
v = 0
for _i, _T in enumerate(Ts):
    if abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i)

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
 
m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H[i]
 
print(arg)

Submission status: Runtime Error

Solution code:
N = int("2")
T,A = map(int,"12 5".split(" "))
h = "1000 2000".split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]

m = float("inf")
arg = 0
for i in range(N):
  if H_[i] < m:
    arg = i+1
    m = H[i]

print(arg)

Submission status: Runtime Error

Solution code:
N = input()
T,A = map(int,input().split(" "))
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
print(argmin(H_)+1)

Submission status: Runtime Error

Solution code:
N = input()
T,A = map(int,input().split(" ")
h = input().split(" ")
H_ = [abs(T-0.006*int(k)-A) for k in h]
print(argmin(H_)+1)

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))
meanx = (T - A)/0.006
H = H - meanx
print(index(min(H)))

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
if a>=0:
    h=list(map(lambda x:abs(t-x*0.006-a),h))
else:
    h=list(map(lambda x:t-x*0.006-a),h)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in H:
    temp = T-i*0.006-A
print(min(temp))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

listT=[0]*n
for i in range(n):
  listT[i]=t-0.006*li[i]
#print(listT)
min=abs(listT[0]-a)
#print(listT[0]-a)
#print(min)
ans=1
for i in range(n):
  if min>abs(a-listT[i]):
    min=abs(listT[i])
    ans=i+1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools


sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]


def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


N = I()
T, A = LI()
H = LI()

new_H = sorted(H)
new_H = [T - i*0.006 for i in H]
#  print(new_H)
#  print(bisect.bisect_left(new_H, A))
idx = bisect.bisect_left(new_H, A)
if idx == len(new_H):
    print(len(H)-1)
    exit()
print(H.index(new_H[idx]))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ls = [abs(A-(T-x*6/1000)) for x in list_H]
ls.index(min(ls)+1)

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
p = []
for i in range(len(li)):
    m = t - 0.006 * li[i]
    p.append(m)
print(li.index(int((t-min(p)) / 0.006)))

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
h=[]
for i in range(n):
    tmp=int(input)
    c=t-tmp*0.006
    h.append(abs(a-c))

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

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
h=[]
for i in rrange(n):
    tmp=int(input)
    c=t-tmp*0.006
    h.append(abs(a-c))

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

count = t
result = 0

for i in range(n):
    test = t - list[i]*0.006
    if test >= a:
        if test-a <= count:
            count = test - a
            result = i+1
        else:
            pass
    else:
        if a-test <= count:
            count = a - test
            result = i+1
        else:
            pass
          
print(result

Submission status: Runtime Error

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

count = t
result = 0

for i in range(n):
    test = t - list[i]*0.006
    if test >= a:
        if test-a <= count:
            count = test - a
            result = i
        else:
            pass
    else:
        if a-test <= count:
            count = a - test
            result = i
        else:
            pass
          
print(result)

Submission status: Runtime Error

Solution code:
def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif
 
N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]
 
lisnew = [tempDif(H,T,A) for H in lis]
print(listnew.index(max(listnew)))

Submission status: Runtime Error

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

li = []
for i in range(len(h)):
  li.append(int(t - h[i]*0.006))
  
print(index(min(li)))

Submission status: Runtime Error

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

li = []
for i in range(len(h)):
  li.append(t - h[i]*0.006)
  
print(index(min(li)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

num = 0
pre = 100000
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(num)

Submission status: Runtime Error

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

num = 0
pre = A
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(num)

Submission status: Runtime Error

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

num = 0
pre = A
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(i)

Submission status: Runtime Error

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

num = 0
pre = A
for i in range(N):
    x = input()
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(i)

Submission status: Runtime Error

Solution code:
N = int(input())

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

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

Tlist =[]

for n in range(N):
	Tlist.append(T - H[n]*0.006)


t = Tlist[0]
m = None

for n in range(N):
	if abs(t-A) > abs(Tlist[n]-A):
		t = Tlist[n]
		m = n

M = m + 1
print(M)

Submission status: Runtime Error

Solution code:
import numpy

N,M=map(int,input().split())
P=[]
Y=[]
for _ in range(M):
    data=[int(_) for _ in input().split()]
    P.append(data[0])
    Y.append(data[1])

y=[]
for x in range(1,N+1):
    for m in range(M):
        if P[m]==x:
            y.append(Y[m])

    ind=numpy.array(y)
    ind=ind.argsort()
    for i,k in enumerate(y):
        Y[Y.index(k)]=ind[i]+1
    y=[]

for x in range(M):
    xx=str(P[x])
    yy=str(Y[x])
    print(xx.zfill(6)+yy.zfill(6))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

c = t*1000 - h*6
h_i = min(abs(c[i], a*1000) for i in range(len(c)))
print(str(c).rfind(h_i))

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=(int(i) for i in input().split())
Temp=[T-0.006*int(input()) for i in range(N)]
dif=[abs(A-Temp[j]) for j in range (N)]
print(dif.index(min(dif))+1)

Submission status: Runtime Error

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

temp=[[abs(T-H[i]*0.006-A),i+1] for i in range(N)]
temp.sort()
print temp[0][2]

Submission status: Runtime Error

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

l = []
for i in range(N):
    l.append(abs(A - (T - 0.006 * H[i])))
print(l.index(min(l))+1)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = (int(i) for i in input().split())
H = [int(input(i)) for i in range(N)]
sub = []
for i in range(N):
    sub.append(abs((1000 * T - 6 * H[i] - 1000 * A)))
min_index = sub.index(min(sub))
print(min_index + 1)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = (int(i) for i in input().split())
H = [int(input(i)) for i in range(N)]
print(int(H.index(min(abs((1000*T-6*H[i]) -1000* A) for i in range[N]))))

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = (int(i) for i in input().split())
H = [int(input(i)) for i in range(N)]
print(int(H.index(min(abs((1000*T-6*H[i]) -1000* A) for i in range[N])))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

num = np.abs(A - (T - H * 0.006))
print(np.argmin(num) + 1)

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(map(int,input().split()))
H = list(map(int,input().split()))
T = S[0]
A = S[1]
sub = abs(A - (T - H[0]*0.006))
for x in range(0,N):
    H_sub = abs(A -(T - H[x]*0.006))
    if H_sub < sub:
        sub = H_sub
        X = x
print(X+1)

Submission status: Runtime Error

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: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(1,N+1):
    H = int(input())
    if abs(T - H*0.006 - A) < diff:
        num = i

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(N):
    H = int(input())
    if abs(T - H*0.006 - A) < diff:
        num = i + 1

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
i=input;s=split;t,a=map(int,i().s());l=list(map(lambda x:abs(t-int(x)*0.006-a),i().s()));print(l.index(min(l))+1)

Submission status: Runtime Error

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: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
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: Runtime Error

Solution code:
N = input()
T, A = map(int, input().split())
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: Runtime Error

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

Submission status: Runtime Error

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 - h[x] * 0.006 
    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

Submission status: Runtime Error

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

Submission status: Runtime Error

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.006)
    tmp=a-ave
    if tmp < 0:
        tmp*=-1
    if diff > tmp:
        diff=tmp
        ans=i+1
print(ans)p

Submission status: Runtime Error

Solution code:
import sys
N = input()
TA = input()
T, A = TA.split()
Hinp = input()
H = Hinp.split()
ans = None
for x in range(H):
    _ans = T - x * 0.006
    if _ans == ans:
        print(ans)
        sys.exit()
    if not ans or abs(A - _ans) < abs(A - ans):
        ans = _ans
print(ans)

Submission status: Runtime Error

Solution code:
N = input()
TA = input()
T, A = TA.split()
Hinp = input()
H = Hinp.split()
ans = None
for x in range(H):
    _ans = T - x * 0.006
    if _ans == ans:
        print(ans)
        return
    if not ans or abs(A - _ans) < abs(A - ans):
        ans = _ans
print(ans)

Submission status: Runtime Error

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

avg_tmp = abs(t - (lis[0] * 0.006) - a)
c = 0
for i in range(1, n):
    min_diff = abs(t - (lis[i] * 0.006) - a)
    if(avg_tmp > min_diff):
        l = i
print(l+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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