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:
candidate_num = int(input())
temperature_str = input()
temperature_list = temperature_str.split()
temperature_base = int( temperature_list[0] )
temperature_ideal = int( temperature_list[1] )
candidate_list_str = input() 
candidate_list = candidate_list_str.split()
 
candidate = int(candidate_list[0])
candidate_temperature = temperature_base - candidate*0.006
answer = 1
diff = abs(temperature_ideal - candidate_temperature)
for i in range( 1, len( candidate_list) ):
    candidate = int(candidate_list[i])
    candidate_temperature = temperature_base - candidate*0.006
    if  abs(temperature_ideal -  candidate_temperature) < diff:
        diff = abs(temperature_ideal - candidate_temperature)
        answer = i+1
    
 
 
print(answer)

Submission status: Accepted

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

place = 1
closest = abs(A - (T - H[0]*0.006))

for i in range(1,N):
    temperature = abs(A - (T - H[i]*0.006))
    if temperature < closest:
        place = i + 1
        closest = temperature

print(place)

Submission status: Accepted

Solution code:
N = int(raw_input())
T, A = map(int, raw_input().split())
H = list(map(int, raw_input().split()))
difH = 10**5
ai = 0
for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    if d < difH:
        difH = d
        ai = i+1
print(ai)

Submission status: Accepted

Solution code:
_,t,a,*h=map(int,open(0).read().split());m=[abs(t-0.006*x-a)for x in h];print(m.index(min(m))+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,t,a,*h=map(int,open(0).read().split());d,i=9**9,0
for j,v in enumerate(h):
 w=abs(a-t+v*0.006)
 if w<d:d=w;i=j
print(i+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f, a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
kouho = list(map(int, input().split()))
dragon = 100000
for i in range(N):
    ondo = T - 0.006 * kouho[i]
    if abs(ondo - A) < abs(dragon - A):
        ans = i
        dragon = ondo
print(ans + 1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
l=[]
m=1000000
index=1001
for i in range(n):
  candidate=abs((t-h[i]*0.006)-a)
  if m > candidate:
  	index=i
  	m=candidate
  else:
    pass
print(index+1)

Submission status: Accepted

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

min=100000000000000
min_index=n+1
for i in range(len(h)):
  v = abs(t - h[i]*0.006-a)
  if v < min:
    min=v
    min_index=i
print(min_index+1)

Submission status: Accepted

Solution code:
import sys
 
def solve(N, T, A, ls_H):
    return min([(abs(A - (T - h * 0.006)), i) for (i, h) in enumerate(ls_H, start=1)])[1]
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys

def solve(N, T, A, ls_H):
    li = [abs(A-(T-(i*0.006))) for i in ls_H]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return answer

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

main()

Submission status: Accepted

Solution code:
import io
import sys

import sys
def solve(T,A,listH):
    sa = 1000
    for x in range(len(listH)):
        if sa >= abs(A - (T - (int(listH[x]) * 0.006))):
            sa = abs(A - (T - (int(listH[x]) * 0.006)))
            a = x+1
    return a

def readQuestion():

    line1 = sys.stdin.readline().rstrip()
    line2 = sys.stdin.readline().rstrip()
    list1 = line2.split(" ")
    line3 = sys.stdin.readline().rstrip()
    list2 = line3.split(" ")
    return int(list1[0]),int(list1[1]),list2

def main():
    t,a,h = readQuestion()
    answer = solve(t,a,h)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

func = lambda x: abs(1000 * T - 6 * x - 1000 * A)
H = [func(val) for val in H]

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from operator import itemgetter

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

a=[]
for i in range(N):
    temp = abs(T-h[i]*0.006 - A)
    a.append([i+1,temp])

a = sorted(a,key=itemgetter(1))

print(a[0][0])

Submission status: Accepted

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

Submission status: Accepted

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

ele_A = (T-A)/0.006
for i in range(N):
    H[i] -= ele_A
    H[i] = abs(H[i])

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# input
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
# calc
avg_tmp = t - h[0] * 0.006
if a < avg_tmp:
    dif = avg_tmp - a
else:
    dif = a - avg_tmp
ans = 1
for i in range(1, n):
    avg_tmp = t - h[i] * 0.006
    if a < avg_tmp:
        sub_dif = avg_tmp - a
    else:
        sub_dif = a - avg_tmp
    if dif > sub_dif:
        dif = sub_dif
        ans = i + 1
# output
print(ans)

Submission status: Accepted

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

X = (T-A)/0.006

for i in range(1, len(Hs)):
  if Hs[i] > X:
    xm = Hs[i] if abs(X - Hs[i-1]) > abs(X - Hs[i]) else Hs[i-1]
    print(H.index(xm)+1)
    exit()

Submission status: Accepted

Solution code:
import math
n = int(input())
s = input().split()
t = int(s[0])
a = int(s[1])
s = input().split()
ans = 0
dis = float('inf')
for i in range(n):
	h = int(s[i])
	d = abs(a - t + 0.006 * h)
	if (d < dis):
		dis = d
		ans = i + 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = math.fabs(A - (T - 0.006*n))
    if diff < diff_min:
        diff_min = diff
        diff_i = i + 1

print(diff_i)

Submission status: Accepted

Solution code:
n = input()
x = input().split()
y = input().split()

h = (int(x[0])-int(x[1]))/0.006

lag = 1000000
rec = 0
for i in y:
    if lag > abs(int(i)-h):
        lag = abs(int(i)-h)
        rec = i

num = y.index(rec)
print(int(num)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

dif = float("inf")

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

print(ans+1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = float("inf")
answer = None

for i, h in enumerate(H):
    if abs(A - (T - h*0.006)) < result:
        result = abs(A - (T - h*0.006))
        answer = i + 1

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
temp = list(map(int, input().split()))
palace = list(map(int, input().split()))

tmin = float("inf")
for i in range(n):
    t = temp[0] - palace[i] * 0.006
    a = abs(temp[1] - t)
    if a < tmin:
        tmin = a
        k = i + 1
    else:
        pass

print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n):
  c = abs(a-(t-h[i]*0.006))
  b.append([c, i+1])
b.sort()
print(b[0][1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

nearA=10000000
number=0
index=0
while index < len(listH):
    h = listH[index]
    if index ==0:
        nearA = max(t-h*0.006, a)-min(t-h*0.006, a)
        number = index+1
    elif max(t-h*0.006, a)-min(t-h*0.006, a)< nearA:
        nearA = max(t-h*0.006, a)-min(t-h*0.006, a)
        number = index+1
    index+=1

print(number)

Submission status: Accepted

Solution code:

# coding: utf-8

# In[1]:


N=int(input())


# In[2]:


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


# In[3]:


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


# In[4]:


BestPoint = 0
SaishoSabun=100000000

for i in range(N):
    aaa = T - HList[i] * 0.006
    Sabun = abs(A - aaa)
    
    if SaishoSabun > Sabun:
        BestPoint = i
        SaishoSabun = Sabun

print(BestPoint+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
list_H = list(map(int, input().split()))
best = float('inf')
for i, H in enumerate(list_H):
    cost = abs(A - (T - H * 0.006))
    if cost < best:
        best = cost
        ind = i + 1
print(ind)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#input one int
#a = int(input())

#input some val
#a, b, c = (int(i) for i in input().split())
#val = [[int(i) for i in input().split()] for i in range(N)]

#input matrix
#a = [input().split() for i in range()]

#Input	script	結果
#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']

import math

def my_abs(x):
    if(x < 0):
        return (-x)
    else:
        return x


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

res = []
j = 0

for j in range(N):
    res.append(my_abs(A - (T - H[j]*0.006)))

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
T, A = input().split(" ")
y = int(T) - int(A)

H = input().split()
H = [abs((int(x) * 0.006) - y) for x in H]

T = np.array(H)
res = T.argmin()+1
print(res)

Submission status: Accepted

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

    z = []
    for x in h:
        t_x = abs(a - (t - x * 0.006))
        z.append(t_x)

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

    min = abs(a - h[0])
    i = 0

    for x in h:
        i += 1
        t_x = t - x * 0.006
        if abs(a - t_x) < min:
            min = abs(a - t_x)
            ans = i

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def ABC113B():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    for i in range(N):
        H[i] = T - H[i] * 0.006
    ansT = 1000000000
    ansN = 0
    for i in range(N):
        if abs(H[i] - A) <= ansT:
            ansT = abs(H[i] - A)
            ansN = i
    print(ansN + 1)
ABC113B()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

n = int(input())
listn = [i+1 for i in range(n)]
t,a= (int(i) for i in input().split())  
listx = [int(i) for i in input().split()]
b=np.array(listx)
b= abs(a-(t-0.006*b))

dictz=dict(zip(listn,b))

print( min(dictz, key=(lambda x: dictz[x])))

Submission status: Accepted

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

min_diff = 10 ** 10
ret = -1

for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    if min_diff > d:
        min_diff = d
        ret = i + 1

print(ret)

Submission status: Accepted

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

for i in range(N):
    kion = T - H[i]*0.006
    compare.append(abs(kion - A))
    Min = min(compare)
    #print('kion{}'.format(kion))
    #print('差：{}'.format(abs(kion - A)))
print(compare.index(Min)+1)
#print(T,A)
#print(H)
#print('compare:{}'.format(compare))

Submission status: Accepted

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

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

print(ans+1)

Submission status: Accepted

Solution code:
import numpy as np
def main():
    ttt = []
    n = int(input())
    N, M = map(int, input().split())
    e = list(map(int, input().split()))
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141
    for j in range(n):
        t = N - e[j]*0.006
        tt = abs(M - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()

Submission status: Accepted

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

D = 99999999
R = 0

for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    if D > d:
        D = d
        R = i + 1

print(R)

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(float,input().split())
list = input().split()
list = map(float,list)
alist = []
count = 0
for h in list:
	count += 1
	temp = a - (t - (h*0.006))
	#print(temp)
	alist.append(abs(temp))

x = min(alist)
#print(x,'min')
answer = alist.index(x)

print(answer + 1,end='')

Submission status: Accepted

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

Submission status: Accepted

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

ans = 1000000000000
leastDiff = 10000000000000000

for i in range(len(places)):
	x = places[i]
	#print('x', x)
	thisTemp = t - (x * 0.006)
	#print('this temp', thisTemp)
	thisDiff = abs(thisTemp - a)
	#print("thisdiff")
	if thisDiff < leastDiff:
		ans = i
		leastDiff = thisDiff
print(ans+1)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = np.array(list(map(int, input().split())))
H = np.abs(T - H*0.006 -A)
print(np.argmin(H) +1)

Submission status: Accepted

Solution code:
def calcTmp(T, height):
    Tmp = T - (0.006 * height)
    return Tmp

def main():
    N = int(input())
    (T, targetTMP) = map(int,input().split())
    heightlist = list(map(int,input().split()))
    nearestTmpdef = 1145141919
    nearestIdx = 0

    for i in range(N):
        tmp = calcTmp(T,heightlist[i])
        tmp_deff = abs(targetTMP - tmp)
        if tmp_deff < nearestTmpdef:
            nearestTmpdef = tmp_deff
            nearestIdx = i
    print(nearestIdx+1)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

mindiff = 1e9
ans = -1

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

Submission status: Accepted

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

ans = -1
mini = 1<<30
for i in range(n):
    diff = abs(t - h[i] * 0.006 - a)
    if mini > diff:
        mini = diff
        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()))
minimu = 1234567890

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
t, a = map(int, raw_input().split())
l=600.0
H=map(int, raw_input().split())
ans=n+1
for i in range(n):
    if abs(a-(t-H[i]*0.006)) <l:
        l=abs(a-(t-H[i]*0.006))
        ans=i+1

print ans

Submission status: Accepted

Solution code:
N = int(input())
T, A = (int(x) for x in input().split())
altitude_list = [int(x) for x in input().split()]
for index, item in enumerate(altitude_list) :
    avr = T - item * 0.006
    dif = abs(A - avr)
    if index == 0 or dif < mini :
        mini = dif
        num = index
print(num + 1)

Submission status: Accepted

Solution code:
#abc113b

n=int(raw_input())
t,a=map(int,raw_input().split())
h=map(int,raw_input().split())
m=[]
for i in xrange(n):
 m.append(abs(1.0*(t-a-h[i]*0.006)))
res=[i for i, x in enumerate(m) if x == min(m)]
print res[0]+1

Submission status: Accepted

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

for i in range(N):
	ti=T-(H[i]*0.006)
	
	if dic is not None:
		if dic > abs(A-ti):
			dic = abs(A-ti)
			p=i
	else:
		dic = abs(A-ti)
		p=i
print(p+1)

Submission status: Accepted

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

D = float('inf')

for i,val in enumerate(log,1):
    iA = T - val * 0.006
    iD = abs(A - iA)
    if iD < D:
        D = iD
        idx = i

print(idx)

Submission status: Accepted

Solution code:
I=lambda:list(map(int,input().split()))
n=I()
t,a=I()
s=10**7
p=0
A=I()
for j in range(len(A)):
  i=A[j]
  q=abs(a-(t-0.006*i))
  if q < s:
    s = q
    p = j+1
print(p)

Submission status: Accepted

Solution code:
p = int(input())
T,A = map(int, input().split())
r = list(map(int, input().split()))

ans = -1
tmp = float('inf')
for i in range(p):
    t = T - r[i] * 0.006
    if abs(t - A) < tmp:
        tmp = abs(t - A)
        ans = i + 1
print(ans)

Submission status: Accepted

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

ans = -1
nearest = float('inf')
for k, h in enumerate(H, 1):
    # 平均気温を1000倍した値で比較してもいい(小数の扱いを考えなくていい)
    tmp = abs(1000 * A - (1000 * T - 6 * h))
    if tmp < nearest:
        ans = k
        nearest = tmp
print(ans)

Submission status: Accepted

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

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

ans = -1
tmp = float('inf')
for i in range(N):
    t = T - hN[i] * 0.006
    if abs(t - A) < tmp:
        tmp = abs(t - A)
        ans = i + 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin

N = int(stdin.readline().rstrip())
T,A = [int(x) for x in stdin.readline().rstrip().split()]
H = [int(x) for x in stdin.readline().rstrip().split()]
ans = 0
target = 100000

for i in range(N):
    deg = T - H[i]*0.006
    gap = abs(deg - A)
    if gap < target:
        ans = i
        target = gap

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

b = [abs((t - 0.006*h_i) - a) for h_i in h]
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()))
b=1
c=abs(t-h[0]*0.006-a)
for i in range(n) :
  if(abs(t-h[i]*0.006-a)<c):
    b=i+1
    c=abs(t-h[i]*0.006-a)
  else:
    continue
print(b)

Submission status: Accepted

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

# 1st point set
ans = 0
ans_diff = float("inf")

# check all point
for i in range(n):
    i_diff = abs(t - hs[i] * 0.006 - a)
    if i_diff < ans_diff:
        ans = i + 1
        ans_diff = i_diff
print (ans)

Submission status: Accepted

Solution code:
test_case = int(input())
t, a = map(int, input().rstrip().split())
xs = list(map(int, input().rstrip().split()))
result = None
idx = None

for i in range(len(xs)):
    x = xs[i]
    temp = abs(t - x*0.006 - a)
    if result is None:
        result = temp
        idx = i+1
    elif temp < result:
        result = temp
        idx = i + 1
print(idx)

Submission status: Accepted

Solution code:

N, = [int(x) for x in input().strip().split(" ")]
T, A = [int(x) for x in input().strip().split(" ")]
Hs = [int(x) for x in input().strip().split(" ")]

rs = []
for h in Hs:
    hh = T - (h * 0.006)
    rs .append(abs(A - hh))

rr = None
for i, r in enumerate(rs):
    if rr == None:
        rrr = i
        rr = r
        continue
    if r < rr:
        rrr = i
        rr = r
print(rrr + 1)

Submission status: Accepted

Solution code:
N = input()
T, A = map(int, input().split())
targets = list(map(int, input().split()))
 
result = 0
min = 0
 
for i, target in enumerate(targets):
  temp = T - target * 0.006 
  if i == 0:
    result = i + 1
    min = abs( A - temp )
  elif abs( A - temp ) < min :
    result = i +1 
    min = abs( A - temp )
 
print(result)

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(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 = list(map(int, input().split()))
b = []
for i in h:
    b.append(abs(a-(t-i*0.006)))
print(b.index(min(b)) + 1)

Submission status: Accepted

Solution code:
n = int(input())

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

h = [int(i) for i in input().split()]

dif_m = float("inf")
dif_h = 0
dif_n = 0

for i in range(n):
    dif_h = abs (a - (t - h[i] * 0.006))
    if dif_m > dif_h:
        dif_m = dif_h
        dif_n = i + 1
    
print(dif_n)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = list(map(int, input().split(' '))).pop();
t,a = list(map(int, input().split(' ')));
h = list(map(int, input().split(' ')));

re = 1000000
index = 0

for i in range(n):
    t0 = t - h[i] * 0.006
    diff = abs(a - t0)
    if ( diff < re ):
        re = diff
        index = i

print(index + 1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    C = 0.006
    N = int(input())
    T, A = map(int, input().split())
    H_list = map(int, input().split())

    t_list = map(lambda x: T - C * x, H_list)
    abs_list = list(map(lambda x: abs(x - A), t_list))
    print(abs_list.index(min(abs_list)) + 1)

Submission status: Accepted

Solution code:
import numpy as np
import functools

def calc_temp(t, x):
    return (t - x * 0.006)

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

T_H = []
for i in range(len(H)):
    T_H.append(calc_temp(T, H[i]))

list_A = [A] * N

#print(T_H)
#print(list_A)

diff_T_H = []
for i in range(len(H)):
    diff_T_H.append(abs(T_H[i] - list_A[i]))

#diff_T_H_array = np.array(T_H) - np.array(list_A)
#diff_T_H = diff_T_H_array.tolist()
#print(diff_T_H)
min_index = diff_T_H.index(min(diff_T_H)) + 1
print(min_index)

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(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())
arr = list(map(int,input().split()))

dig = float("inf")
num = 0

for i in range(n):
    ans = t - arr[i] * 0.006
    if dig > abs(a - ans):
        dig = abs(a - ans)
        num = i + 1
print(num)