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


def calc_deg(h):
    return t - h * 0.006


ans = 0
min_diff = 1e6
for i, h in enumerate(h_list, 1):
    diff = abs(calc_deg(h) - a)
    if diff < min_diff:
        min_diff = diff
        ans = i

print(ans)

Submission status: Accepted

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

errors=[abs((t-hi*0.006)-a) for hi in h]
#print(errors)
min_error=min(errors)
print(errors.index(min_error)+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
temp=[abs(t-0.006*int(x)-a) for x in input().split()]

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

Submission status: Accepted

Solution code:
import sys

N = int(input())
T, A = map(int, input().split())
H = list(map(int, sys.stdin.readline().rsplit()))

mini = 10 ** 9
index = -1
for i, h in enumerate(H):
    temp = T - h * 0.006
    if mini > abs(temp - A):
        mini = abs(temp - A)
        index = i + 1
print(index)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
m_diff = float('inf')
idx = 1
for i, diff in enumerate(map(lambda x, T=T, A=A: abs(A - (T - int(x) * 0.006)), input().split())):
    if diff < m_diff:
        m_diff = diff
        idx = i + 1
print(idx)

Submission status: Accepted

Solution code:
# B - Palace

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

ans = 0
d = 10**18
temp = [0] * N
for i in range(N):
    temp[i] = T - H[i] * 0.006
    if d > abs(temp[i] - A):
        ans = i + 1
        d = abs(temp[i] - A)

print(ans)

Submission status: Accepted

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

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

main()

Submission status: Accepted

Solution code:

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

ans = 0
minimum = float('inf')

for i,v in enumerate(h):
    temp = abs(a - (t - v*0.006))
    if temp < minimum:
        minimum = temp
        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()))
Ans = []
for i in range(n):
    ans = t-h[i]*0.006
    Ans.append(abs(ans-a))
abc = 10**100000
for j in range(n):
    abc = min(abc, Ans[j])
print(Ans.index(abc)+1)

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def Yes(): print("Yes"); return
def No(): print("No"); return

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#############
# Main Code #
#############

N = inputI()
T,A = inputIL()
H = inputIL()

H_T = [T-h*0.006 for h in H]

MIN = INF
POS = None

for i in range(N):
  if abs(H_T[i] - A) < MIN:
    MIN = abs(H_T[i] - A)
    POS = i+1
    
print(POS)

Submission status: Accepted

Solution code:
import itertools
import math
import fractions
import functools
import copy
n = int(input())
t, a = map(int, input().split())
h  = list(map(int, input().split()))
minimum = 10**10
index = 0
for i in range(n):
    minimum = min(minimum,abs(a-(t-h[i]*0.006)))
    if minimum == abs(a-(t-h[i]*0.006)):
        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()))
d=[0]*N
for i in range(N):
  d[i]=abs(T-H[i]*0.006 - A)
print(d.index(min(d))+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

n = I()
t, a = Is()
H = LI()
B = [abs(t - x*0.006 - a) for x in H]
m = -INF
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=0
temp=999999999
for i in range(0,n):
  temph=abs(t-int(h[i])*0.006-a)
  temp=min(temph,temp)
  if temp==temph:
    ans=i
print(ans+1)

Submission status: Accepted

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

tem = [t - i*0.006 for i in h]
diff = [abs(a - i) for i in tem]

idx = diff.index(min(diff))
print(idx+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):
    x=T-0.006*H[i]
    if i==0:
        ans=1
        diff=abs(x-A)
    else:
        if diff>abs(x-A):
            ans=i+1
            diff=abs(x-A)
print(ans)

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(H.argmin()+1)

Submission status: Accepted

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

ans = 0
min_t = 10 ** 10
for i in range(n):
    hi = h[i]
    ti = abs(a - (t - hi * 0.006))
    if ti < min_t:
        ans = i
        min_t = ti
print(ans + 1)

Submission status: Accepted

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

j = 0
Ta = 1e5 + 1
for i in range(N):
    Tm = T - H[i] * 0.006
    Tb = abs(Tm - A)
    if Ta > Tb:
        Ta = Tb
        j = i
print(j + 1)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
n = 0
place = 0
diff = 10**6
for h in H:
  n += 1
  t = T - h * 0.006
  if abs(A - t) < diff:
    diff = abs(A - t)
    place = n
print(place)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
h_list = list(map(int, input().split()))
diff = 10**8
for i in range(n):
    h_list[i] = t - h_list[i]*0.006
    if abs(h_list[i]-a) < diff:
        diff = abs(h_list[i]-a)
        ind = i

print(ind+1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(place)

Submission status: Accepted

Solution code:
# ABC113 B

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

    differences = []

    for height in H:
        temp = t - height * 0.006
        differences.append(abs(temp - a))
    
    print(differences.index(min(differences)) + 1)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

kion=[]
for i in range(len(h)):
    kion.append(t-h[i]*0.006)
#print(kion)
j=0
x=10000000000000000000000
for i in range(len(kion)):
    if abs(a-kion[i])<x:
        j=i+1
        x=abs(a-kion[i])
print(j)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
High = list(map(int, input().split()))
Sa = []
for a, i in enumerate(High):
    Sa.append(abs(A-(T-High[a] * 0.006)))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

min_diff = 10**8
ans = -1

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

print(ans)

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def temparture(t, x):
    return t - x * 0.006


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

dist_min = h[0]

for i in range(1, n):
    if abs(a - temparture(t, h[i])) < abs(a - temparture(t, dist_min)):
        dist_min = h[i]
print(h.index(dist_min) + 1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())    # 2
t, a = map(int, input().split())    # 12, 5
h_list = list(map(int, input().split()))    # [1000, 2000]

ans_ind = None
ans_diff = float('inf')

for i, h in enumerate(h_list):
  avg_tmp = t - h * 0.006    # fist:6, second:0
  if abs(a - avg_tmp) < ans_diff:    # first:True, second:False
    ans_ind = i    # first:0
    ans_diff = abs(a - avg_tmp)    # first:1

print(ans_ind + 1)   # 0

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline

def main():
    N = int(readline())
    T, A = map(int, readline().rstrip().split())
    H = list(map(int, readline().rstrip().split()))
    temp = [T - x*0.006 for x in H]
    d = 10 ** 5
    res = -1
    for i, t in enumerate(temp):
        if abs(A - t) < d:
            res = i + 1
            d = abs(A - t)
    
    print(res)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans_ind = -1
ans_d = 100000000000

for i, x in enumerate(xs):
  t = T - x*0.006
  
  if abs(A - t) < ans_d:
    ans_ind = i+1
    ans_d = abs(A - t)
    
print(ans_ind)

Submission status: Accepted

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

cur  = float('inf')
ans = 0
for i in range(N):
    x = abs(A - (T - H[i] * 0.006))
    if cur > x:
        cur = x
        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()))
temp = list(map(lambda x: abs(a - (t-0.006*x)), h))
p = temp.index(min(temp))
print(p + 1)

Submission status: Accepted

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

best_i = 0
best_diff = 1e9

for i in range(n):
    h = hs[i]
    temp = t - 0.006 * h
    diff = abs(a - temp)
    if diff < best_diff:
        best_i = i
        best_diff = diff

print(best_i + 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()))
h = list(map(lambda x:abs(t-0.006*x-a),h))
print(np.argmin(h)+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

min_diff = 10000
plan = 0
for i in range(N):
    tmpe = T - 0.006 * H[i]
    diff_A = abs(A - tmpe)
    if min_diff > diff_A:
        plan = i+1
        min_diff = diff_A

print(plan)

Submission status: Accepted

Solution code:
N = int(input())
T, A = list(map(int,input().split()))
H = list(map(int,input().split()))
diffs = [abs(A - (T - h * 0.006)) for h in H]
min_idx = -1
min = float('inf')
for i in range(len(diffs)):
    if min > diffs[i]:
        min = diffs[i]
        min_idx = i
print(min_idx+1)

Submission status: Accepted

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

ans = 0
minimum = 100000000
for i in range(n):
    subs = abs(a - (t-h[i]*0.006))
    if minimum > subs:
        minimum = subs
        ans = i

print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = int(input())

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

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

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

MinH = min(h_list)
print(h_list.index(MinH)+1)

Submission status: Accepted

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

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

B = min(A)
print(A.index(B)+1)

Submission status: Accepted

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

res=10**10


for i in range(n):
	if res>abs((t-L[i]*0.006)-a):
		res=abs((t-L[i]*0.006)-a)
		ress=i+1
		
print(ress)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

diff = []

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

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

Submission status: Accepted

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

answer_id = 10000
answer_height_diff = 10000

for i, hight in enumerate(Hlist, 1):
    tempareture = T - hight * 0.006
    if answer_height_diff > abs(A - tempareture):
        answer_height_diff = abs(A - tempareture)
        answer_id = i

print(answer_id)

Submission status: Accepted

Solution code:

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

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

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

Submission status: Accepted

Solution code:
n = input()

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

def it():
    for i, x in enumerate(map(int, input().split()), 1):
        yield abs(a - (t - x * 0.006)), i

print(min(it())[1])

Submission status: Accepted

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

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

mn = None
for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    mn = (i, d) if mn is None or mn[1] > d else mn
print(mn[0] + 1)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
ls = list(map(int,input().split()))
p = 0
j = 0
for i in range(n):
    if i ==0:
        tem = t - 0.006*ls[i]
        ans = abs(tem-a)
        j = 1
    else:
        tem = t - 0.006*ls[i]
        if ans - abs(tem-a) >0:
            ans = abs(tem-a)
            j = i + 1
print(j)

Submission status: Accepted

Solution code:
n = int(input())
t, a = [int(x) for x in input().split()]
h_list = [int(x) for x in input().split()]
temp_list = sorted([(abs((t - h * 0.006) - a), i + 1) for i, h in enumerate(h_list)])
print(temp_list[0][1])

Submission status: Accepted

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

ans = (-1,float('inf'))
for i,h in enumerate(arr):
  tmp = t - h * 0.006
  if abs(tmp - a) < abs(ans[1]):
    ans = (i, tmp-a)
    
print(ans[0]+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
res = 0
sa = -1

for i in range(N):
  t = T - 0.006 * H[i]
  s = abs(A - t)
  if sa < 0 or s < sa:
    sa = s
    res = i + 1

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

temp=[]
for i in range(n):
    at = t - h[i] * 0.006
    t2 = a - at
    if t2 < 0: t2 *= -1
    temp.append(t2)

ans = 0
diff = 10000.0
for i in range(n):
    if temp[i] < diff:
        ans = i + 1
        diff = temp[i]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
d = 10**10
ans = -1
for i, x in enumerate(h):
  di = abs((t - x * 0.006) - a)
  if di < d:
    d = di
    ans = i + 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_list = []

for i in H_list:
  kion = T - (i * 0.006)
  kion_abs = abs(kion - A)
  ans_list.append(kion_abs)

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

Submission status: Accepted

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

Submission status: Accepted

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

diff = 0
m = 1000
n = 0
for i in range(N):
    temp = T - H[i] * 0.006
    diff = abs(temp - A)
    if diff < m:
        m = diff
        n = i+1
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
s = input().rstrip().split(' ')
gap = 300
loc = 0
for i in range(n):
  temp = t-int(s[i])*0.006
  if abs(temp-a) < gap:
    gap = abs(temp-a)
    loc = i+1
print(loc)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n = int(input())
t ,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 0
kar = 10**9
for i in range(n):
    tmp = t - h[i]*0.006
    if kar > abs(tmp-a):
        kar = abs(tmp-a)
        ans = i+1
    
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, T: int, A: int, H: "List[int]"):
    print(1 + min(range(N), key=lambda i: abs(T - H[i] * 0.006 - A)))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    T = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    H = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, T, A, H)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

ans = 1
mn = np.inf
for i, h in enumerate(H):
    if mn > abs(A - (T - h * 0.006)):
        ans = i+1
        mn = abs(A - (T - h * 0.006))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

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


main()