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: Accepted

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

for i in range(n):
    c=t-int(lst[i])*0.006
    h.append(abs(a-c))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(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: Accepted

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

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

print(ans+1)

Submission status: Accepted

Solution code:
#ABC113B-Palace.py

from sys import stdin

input = stdin.readline

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

temp = [T-i*0.006 for i in H]
diff = [abs(A-i) for i in temp]

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

Submission status: Accepted

Solution code:
N = int(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: Accepted

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

Submission status: Accepted

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

I = 999999
minT = 999999
def temp(x):
    return t - x*0.006

for i in range(n):
    if minT >= abs(a - temp(H[i])):
        minT =  abs(a - temp(H[i]))
        I = i+1

print(I)

Submission status: Accepted

Solution code:
def temp(x):
    return T - x * 0.006

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

def temp(x):
    return abs((T - x * 0.006) - A)

ans = list(map(temp, H))
print(int(ans.index(min(ans))) + 1)

Submission status: Accepted

Solution code:
#cording: utf-8

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

H_temperature = []
H_abs = []
for i in range(N):
    H_temperature.append(T - H[i]*0.006)
    H_abs.append(abs(A - H_temperature[i]))

min_ind = H_abs.index(min(H_abs))
print(int(min_ind + 1))

Submission status: Accepted

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

c = 1
for i in H:
    Hls.append((abs(A - (T - int(i)*0.006)),int(c)))
    c = c+1

print(min(Hls)[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:

# coding: utf-8

# In[4]:


import numpy as np


# In[13]:


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


# In[14]:


h = np.array(h)


# In[15]:


print(np.argmin(abs((t - h * 0.006) - a)) + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#my_answer
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))#N times
#print(H)
#temp=T-x*0.006
temp=[0]*N
gap=[0]*N

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

#print(temp)
for i in range(N):
	if(gap[i]==min(gap)):
		print(i+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = list(map(int, input().split()))
H = list(map(int, input().split()))
AveT = [T - h*0.006 for h in H]
diff = [abs(Ave_t - A) for Ave_t in AveT]

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

Submission status: Accepted

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

for i in range(N):
	AveT.append(T - H[i]*0.006)
	diff.append(abs(AveT[i] - A))

for i in range(N):
	if diff[i] == min(diff):
		place = i + 1

print(place)

Submission status: Accepted

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 t_list]
print(a_list.index(min(a_list))+1)

Submission status: Accepted

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

Submission status: Accepted

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

diff_min = float("inf")
ans = 0
for i in range(N):
  diff = abs(A - (T - H[i] * 0.006))
  if diff < diff_min:
    diff_min = diff
    ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

min_ = 10000000000000
ans = None
for i, x in enumerate(h):
    tmp = t - x*0.006# その地点の平均気温
    if a > 0 and tmp > 0:
        sa = a - tmp
    elif a > 0 and tmp < 0:
        sa = a + abs(tmp)
    elif a < 0 and tmp > 0:
        sa = abs(a) + tmp
    else:
        sa = abs(a) - abs(tmp)
    sa = abs(sa)
    if sa < min_:
        min_ = sa
        ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

list = []

for i in range(n):
    temperature = t - list_original[i]*0.006
    list.append(abs(a - temperature))

point = list.index(min(list)) + 1

print(point)

Submission status: Accepted

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

print(ans+1)

Submission status: Accepted

Solution code:
n = input()
ta = [int(i) for i in input().split()] 
target = ta[0] - ta[1]
h = [abs(target - int(i) * 0.006) for i in input().split()]
print(h.index(min(h)) +1)

Submission status: Accepted

Solution code:
def calc_point(t, a, h):
        min_diff = float('inf')
        min_diff_point = None
        for i, h_v in enumerate(h):
                diff = abs(a - (t - h_v * 0.006))
                if diff < min_diff:
                        min_diff = diff
                        min_diff_point = i
        return min_diff_point


input()
t, a = [int(v) for v in input().split()]
h = [int(v) for v in input().split()]
print(calc_point(t, a, h) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

H = list(map(int, input().split()))
answers=[]
for h in H:
    sub = T - h*0.006
    sub = A - sub
    answers.append(abs(sub))

min_idx = answers.index(min(answers))+1

print(min_idx)

Submission status: Accepted

Solution code:
input()
T, A = map(int, input().split())
print(min([(i+1, abs(T-0.006*h-A)) for i, h in enumerate(map(int, input().split()))], key=lambda x:x[1])[0])

Submission status: Accepted

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

Submission status: Accepted

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

ans_H = (T - A)/0.006
dif = 10**20
ans = 0
for i in range(len(H)):
	temp_dif = abs(ans_H - H[i])
	if (dif > temp_dif):
		dif = temp_dif
		ans = i + 1
	
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int, input().split())
H = [int(s) for s in input().split()]
H = [T - x*0.006 for x in H]
#print(H)
palace = {}
for i in range(N):
    palace[H[i]] = abs(H[i]-A)
#print(palace)


diff = sorted(palace.items(),key=lambda x: x[1])

if diff[0][0] in H:
    print(H.index(diff[0][0])+1)

Submission status: Accepted

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

temps = []

for i, v in enumerate(h):
    h[i] = t - h[i] * 0.006
    temps.append(abs(a - h[i]))

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

Submission status: Accepted

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

Submission status: Accepted

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(lisnew.index(min(lisnew))+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import math
import sys
from operator import itemgetter
input = sys.stdin.readline


# a = int(input().rstrip())
# a, b = map(int, input().rstrip().split())
# D = list(map(int, input().rstrip().split()))
# H = [int(input().rstrip()) for _ in range(L)]
# DD = [[0 for j in range(100)] for i in range(200)]
# dict = {} ## dictionary

# a = sorted(a, key=lambda x: x[1]))
# if __name__ == '__main__':

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

t_diff = []
for h in H:
	t_diff.append(abs(float(T - A - 0.006 * h)))
print(t_diff.index(min(t_diff))+1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int, input().split())
min = 10000000000
c=0
for i in list(map(int,input().split())):
    c+=1
    a = T-i*0.006
    if A-a>=0: b=A-a
    else: b=a-A
    if b < min: 
        min = b
        answer = c
print(answer)

Submission status: Accepted

Solution code:
N=input()
T=list(map(int,input().split()))
H=list(map(int,input().split()))
count=0
min=1000000
for h in H:
 count=count+1
 if abs(T[0]-0.006*h-T[1])<min:
  ans=count 
  min=abs(T[0]-0.006*h-T[1])
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
x = (t - a)/0.006

for i in range(N):
    H[i] = abs(x-H[i])

print(np.argmin(H) + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

y = 1000

for i in range(N):
    x = A - (T - H[i] * 0.006)
    if y > abs(x):
        y = abs(x)
        result = i+1

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def dif_temp(T, A, x):
    return abs(T - x * 0.006 - A)

N = int(input())
T, A = map(int, input().split())
H = [dif_temp(T, A, int(i)) for i in input().split()]
for i in range(N):
    if H[i] == min(H):
        print(i + 1)

Submission status: Accepted

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

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


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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

ts = [abs(t - item*0.006-a) for item in ts]

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

Submission status: Accepted

Solution code:
# B
import numpy as np
N = int(input())
T, A = map(int, input().split())
H = [int(i) for i in input().split()]
T_list = [T-x*0.006 for x in H]
def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx
print(getNearestValue(T_list, A) + 1)

Submission status: Accepted

Solution code:
n = raw_input()
t = raw_input()
t, a = int(t.split(" ")[0]),int(t.split(" ")[1])
h = raw_input()
h = [int(i) for i in h.split(" ")]

min_diff = 999999
min_i = 1
for i in range(len(h)):
	temp = t-h[i]*0.006
	diff = abs(temp-a)
	if diff<min_diff:
		min_diff = diff 
		min_i = i+1
print(min_i)

Submission status: Accepted

Solution code:
from sys import stdin

N, T, A, *H = map(int, stdin.read().split())

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

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

Submission status: Accepted

Solution code:
def main() -> None:
    n = int(input())
    T, A = map(int, input().split())
    H = input().split()

    min = None
    for i in range(n):
        tempture = T - int(H[i]) * 0.006
        # print(tempture)
        if min is None:
            pos = i + 1
            min = abs(A - tempture)
        elif min > abs(A - tempture):
            pos = i + 1
            min = abs(A - tempture)
    print(int(pos))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(ans+1)

Submission status: Accepted

Solution code:
import math

if __name__ == '__main__':
    n = int(input())
    t, a = map(int, input().split())
    h = map(int, input().split())

    diff = 0
    answer = -1
    first = True

    for index, height in enumerate(h):
        temp = t - height * 0.006
        current_diff = math.fabs(a - temp)
        #print(index, temp, current_diff)

        if current_diff <= diff or first:
            diff = current_diff
            answer = index
            first = False

    print(answer+1)

Submission status: Accepted

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

Submission status: Accepted

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

dif = 1000

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

print(ans)

Submission status: Accepted

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: Accepted

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

for i in range(len(locations)):
    locations[i] = abs(t - (locations[i]*0.006) - a)
    
print(locations.index(min(locations)) + 1)

Submission status: Accepted

Solution code:
input()
T, A = map(int, input().split())
H = list(map(int, input().split()))
d = None
x = None
for i, h in enumerate(H):
    a = T - h * 0.006
    if d is None or d > abs(A - a):
        d = abs(A - a)
        x = i + 1
print(x)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
t, a = (int(i) for i in input().split())
h = np.array([int(i) for i in input().split()])

temp = (t - (h*0.006))

print(np.argmin(abs(temp - a))+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

def tempreture(x):
    return T - x * 0.006

t_ave = [tempreture(h) for h in H]

delta = [abs(t - A) for t in t_ave]

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

Submission status: Accepted

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

for i in H:
    x.append(abs(T - i*0.006 - A))
    
print(x.index(min(x)) + 1)

Submission status: Accepted

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


def solve_temp(h):
    return T-h*c


minimum = abs(A - solve_temp(H[0]))
minIndex = 0
for i in range(N):
    if minimum > abs(A - solve_temp(H[i])):
        minimum = abs(A - solve_temp(H[i]))
        minIndex = i
print(minIndex+1)

Submission status: Accepted

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

Submission status: Accepted

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

t_array = [abs(t - 0.006 * h - a) for h in h_array]
ans = t_array.index(min(t_array)) + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from bisect import bisect

class Solver(object):
    def __init__(self):
        self.n = int(input())
        self.t, self.a = list(map(int, input().split(" ")))
        self.locations = list(map(int, input().split(" ")))
        self.locations = [(x+1, self.t - (0.006*y)) for (x, y) in enumerate(self.locations)]
        self.locations.sort(key=lambda x: x[1])

    def solve(self):
        temps = [y for x, y in self.locations]
        b = bisect(temps, self.a)
        if b >= len(temps):
            print(self.locations[b-1][0])
        else:
            left = abs(self.a - self.locations[b-1][1])
            right = abs(self.a - self.locations[b][1])
            if left < right:
                print(self.locations[b-1][0])
            else:
                print(self.locations[b][0])

    def debug(self):
        for x in self.locations:
            print(x)


if __name__ == "__main__":
    s = Solver()
    s.solve()

Submission status: Accepted

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

for h in H:
    h = T - h * 0.006
    res.append(abs(h - A))

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

Submission status: Accepted

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

Submission status: Accepted

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

list_=[]
for count in range(n):
    list_.append(abs(a-t+0.006*h[count]))
i=0
while i<=n-1:
    if list_[i]==min(list_):
        print(i+1)
        break
    else:
        i+=1

Submission status: Accepted

Solution code:
import sys

def main():
  input = sys.stdin.readline
  N = int(input())
  T, A = map(int, input().split())
  H = [int(h) for h in input().split()]
  dif = float('inf')
  pos = 0
  for i in range(N):
    d = abs(A - (T - H[i] * 0.006))
    if d < dif:
      dif = d
      pos = i+1
  print(pos)


if __name__ == '__main__':
  main()

Submission status: Accepted

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

x = int(round((t - a) / 0.006))

d = 100000
num = -1

for i, y in enumerate(h):
    if d > abs(y - x):
        d = abs(y - x)
        num = i

print(num + 1)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

ans, mind = 0, 1000
for i in range(N):
    td = abs(A - (T - 0.006 * H[i]))
    if mind > td:
        ans = i + 1
        mind = td

print(ans)

Submission status: Accepted

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 = 0

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: Accepted

Solution code:
n=int(input())

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

H=list(map(int,input().split()))
    
new_h=[abs(t-H[i]*0.006-a) for i in range(n)]

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

Submission status: Accepted

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

ans = 0
ui=10000
for i in range(len(lst)):
    if ui > abs((t-lst[i]*0.006)-a):
        ui = abs((t-lst[i]*0.006)-a)
        ans = i+1
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding:utf-8 -*-

def main():
  n = int(input())
  t, a = map(int, input().split())
  hs = list(map(int, input().split()))
  ans = sorted([(i+1, abs( (t-0.006*h) - a )) for i, h in enumerate(hs)], key=lambda x:x[1])[0][0]
  print(ans)
  pass

if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
import numpy as np
import math
n = input()
t,a = input().split()
H = input().split()

n = int(n)
t = int(t)
a = int(a)
H = [int(h) for h in H]

ans = []
for h in H:
	ans.append(np.abs((t - h*0.006) - a))

print(np.argmin(ans)+1)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = {i+1:abs((T-H*0.006)-A) for i, H in enumerate(Hs)}
ans = min(tmp, key=tmp.get)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

lst=[]

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [int(i) for i in input().split()]
d = 9999999999999
num = -1
for i, hei in enumerate(h):
    e = abs(a - (t - hei*0.006))
    if e < d:
        d = e
        num = i + 1
print(num)

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	x,y = map(int,input().split())	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# 3
# hoge
# foo
# bar
# n=int(input())
# string_list=[input() for i in range(n)]
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))

now=999999999999
for i, H_i in enumerate(H):
    temp = T - H_i*0.006
    if(abs(temp-A)<abs(now-A)):
        ans = i
        now = temp

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

sub_arr = [abs(a-(t-i*0.006)) for i in h_arr]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for ix, x in enumerate(h_list):
    tmp = t - x * 0.006
    if ans > abs(a - tmp):
        ans = abs(a - tmp)
        ansi = ix + 1
print(ansi)

Submission status: Accepted

Solution code:
n = int(input())
t,a = (input().split())
t,a = int(t),int(a)
ans = 0
i = 1000000
j = 0

for h in input().split():
    j = j + 1
    h = int(h)
    tmp = t - h*0.006
    if i > abs(a-tmp):
        i = abs(a-tmp)
        ans = j
        
print(ans)

Submission status: Accepted

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

for i,h in enumerate(H):
    H[i]=abs(T-h*0.006-A)

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

Submission status: Accepted

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

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

x=[]

for i in range(len(H)):
    x.append(abs(A-(T-H[i]*0.006)))

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

Submission status: Accepted

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

ret = []
for i, h in enumerate(H):
    ret.append(abs(a - (t - 0.006 * h)))
print(ret.index(min(ret)) + 1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#入力受付
option_num = int(input())
temperature, idea_temperature = map(int, input().split(" "))
options_height = map(int, input().split(" "))

#ダミーデータ
palace_temperature = -999
palace_index = 0
for i, height in enumerate(options_height):
    #候補地の温度を求める
    option_temperature = temperature - height * 0.006
    #現在の最も理想的な候補地と比較
    if abs(idea_temperature - palace_temperature) > abs(idea_temperature - option_temperature):
        #よりいい温度ならばその場所の温度とインデックスを保存
        palace_temperature = option_temperature
        palace_index = i + 1

print(palace_index)

Submission status: Accepted

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

Submission status: Accepted

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

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