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

Submission status: Accepted

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

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

min_ten = 9999999999

for i in range(len(li)):
    if abs(min_ten - A) > abs(ave_ten(T,li[i])-A):
        min_ten = ave_ten(T,li[i])
        min_in = i+1

print(min_in)

Submission status: Accepted

Solution code:
a = int(input())
b,c = map(int,input().split())
d = list(map(int,input().split()))
e = []
f = []
ans = 10**9
for i in d:
  e.append(b-0.006*i)
for j in e:
  f.append(abs(c-j))
print(f.index(min(f))+1)

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import decimal

def main():
    numbers=[]
    n = int(input())
    t,a = map(int,input().split())
    numbers=list(map(int,input().split()))
    dp=[]
    hensu=decimal.Decimal('0.006')
    for number in numbers:
        tmp=abs(t-number*hensu-a)
        dp.append(tmp)
    answer=dp.index(min(dp))+1
    print(answer)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
t, a = (int(i) for i in input().split())
list_h = [int(i) for i in input().split()]
tmp = 999
ans = 0
for i in range(0, n):
    if tmp > abs((t - list_h[i] * 0.006) - a):
        tmp = abs((t - list_h[i] * 0.006) - a)
        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()))
palace=0
for i in range(n):
  if abs(a-t+h[i]*0.006)<abs(a-t+h[palace]*0.006):
    palace=i
print(palace+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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



for i in range(N):
    TMP = T - (H[i] * 0.006)
    if A >= 0:
        ABS = abs(TMP - A)
    else:
        ABS = abs(A - TMP)
    M.append(ABS)
            
MIN = min(M)
for i in range(len(M)):
    if MIN == M[i]:
        print(i+1)

Submission status: Accepted

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

dt = 1000
ans = 0
for i in range(len(h)):
    tmp = float(t) - 0.006 * h[i]
    if dt > abs( a - tmp ):
        dt = 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(float, input().split()))

dt = 10000000
ans = 0
for i in range(len(h)):
    tmp = float(t) - 0.006 * h[i]
    if dt > abs( a - tmp ):
        dt = 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()))
h=abs(A-(T-(H[0]*0.006)))
m=1
for i in range(1,N):
    if h>abs(A-(T-(H[i]*0.006))):
        h=abs(A-(T-(H[i]*0.006)))
        m=i+1
print(m)

Submission status: Accepted

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

diff = []
for i in H:
	diff.append(abs(A-T+i*0.006))

diffmin = diff[0]
ans = 0
for i in range(N):
	if diffmin > diff[i]:
		diffmin = diff[i]
		ans = i
print(ans+1)

Submission status: Accepted

Solution code:
import numpy as np

def palace():
    
    N = int(input())
    T, A = np.array(input().split(), dtype="int")[:2]
    H = [int(i) for i in input().split()]
    
    min_dif = 10000
    place = 0
    for i in range(N):
        temp = T - H[i] *0.006
        dif = abs(A-temp)
        
        #誤差の最小値(→候補地も更新)
        if min_dif >= dif:
            min_dif = dif
            place = i+1
    
    print(place)
    
    
palace()

Submission status: Accepted

Solution code:
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))


def main():
    n = int(input())
    t, a = Input()
    h = Input()

    h = [t-i*0.006 for i in h]
    h = [abs(a-i) for i in h]
    min_h = min(h)

    print(h.index(min_h)+1)


main()

Submission status: Accepted

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

N = int(input())
T, A = map(int, input().split())
L = list(map(int, input().split()))
l = []
for i in L:
  l.append(abs(A - calc(T, i)))

mi = min(l)
print(l.index(mi)+1)

Submission status: Accepted

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

Submission status: Accepted

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

    mini = 10**10
    ans = 0
    for i, x in enumerate(h):
        c = t - x * 0.006
        if abs(a - c) < mini:
            mini = abs(a - c)
            ans = i+1

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

temp_list = [(i, abs(A - (T-x*0.006))) for i, x in enumerate(h_list, 1)]

ans = min(temp_list, key=lambda x: x[1])

print(ans[0])

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ans, near = 0, 10**5
for i, high in enumerate(h):
	temp = abs(a - (t - high * 0.006))
	if near > temp:
		near = temp
		ans = i + 1
print(ans)

Submission status: Accepted

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

min_abs = 10**6
ans = -1
for i, h in enumerate(heights):
    t = tempre - 0.006 * h
    if abs(t-a) < min_abs:
        ans = i+1
        min_abs = abs(t-a)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
t,a = map(int,input().split())
H = list(map(int,input().split()))
p = 9999
m = 9999
for i in range(n):
  tem = t - (H[i]*0.006)
  dist = abs(a-tem)
  if dist < m:
    p = H[i]
    m = dist
print(H.index(p)+1)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = []
for h in H:
    a = T-(h*0.006)
    c = abs(A-a)
    cnt.append(c)
    
ans = cnt.index(min(cnt))+1
print(ans)

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

Submission status: Accepted

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

ans=0
anst=10e7
for i,j in enumerate(h):
    avg=t-j*0.006
    if anst>abs(a-avg):
        anst=abs(a-avg)
        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()))
cnt = 0
dict = {}
for i in h:
    cnt +=1
    dict[abs(a - (t-i*0.006))] = cnt
print(dict[min(dict)])

Submission status: Accepted

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

a -= t
a *= 1000

ans = 0
diff = abs(a + h[0] * 6)

for i in range(1, n):
    if abs(a + h[i] * 6) < diff:
        ans = i
        diff = abs(a + h[i] * 6)

print(ans + 1)

Submission status: Accepted

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

p=[]

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

print(p.index(min(p))+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 = np.array(H)
temp = T-H*0.006
res = np.abs(temp-A)

print(np.argmin(res)+1)

Submission status: Accepted

Solution code:

url = "https://atcoder.jp//contests/abc113/tasks/abc113_b"

def main():
    input()
    t, a = list(map(int, input().split()))
    syuto = list(map(int, input().split()))
    tempture = []
    for s in syuto:
        tempture.append(abs(a - (t - s * 0.006)))
    print(tempture.index(min(tempture))+1)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

_min = 10 ** 7
ans = None
for i, v in enumerate(h):
    c = abs((t - 0.006 * v) - a)
    if c < _min:
        _min = c
        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()))
ans = 1
temp = t-h[0]*0.006
for i in range(n):
    loc = t-h[i]*0.006
    if abs(a-loc)<abs(a-temp):
        temp = loc
        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()))
a1 = []
a2 = []
for i in range(n):
    tt = abs((t - h[i]*0.006) - a)
    a1.append(tt)
    a2.append(i+1)
ans = {}
ans.update(zip(a1, a2))
small = sorted(a1, reverse=False)[0]
print(ans[small])

Submission status: Accepted

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

min_abs = 100000
index = 0
for i in range(n):
    temp = t - h[i] * 0.006
    if abs(a - temp) < min_abs:
        min_abs = abs(a - temp)
        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()))

mini = float('inf')
res = 0

for i in range(len(H)):
    spot = T - H[i] * 0.006
    if abs(spot - A) < mini:
        mini = abs(spot - A)
        res = i+1

print(res)

Submission status: Accepted

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

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

result_score = 10000
result_num = 0

for num, h in enumerate(H, 1):
    temp = T - h * 0.006
    score = abs(A-temp)

    if result_score >= score:
        result_score = score
        result_num = num

print(result_num)

Submission status: Accepted

Solution code:
N = int (input ())
T,A = map (int, input ().split ())
S = 1000000
l = [int (x) for x in input().split()]
for i in range (len(l)):
  s = abs((T-l[i]*0.006)-A)
  if s < S:
    S = s
    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()))

atlist = []
for i in h:
    atlist.append(abs(a - (t - i * 0.006)))

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

Submission status: Accepted

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

for i in range(n):
    x = t - h[i] * 0.006
    if a >= x:
        TMP = a - x
        tmp.append(TMP)
    else:
        TMP = x - a
        tmp.append(TMP)

for i in range(n):
    if tmp[i] == min(tmp):
        print(i+1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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

    dif = sys.maxsize
    ans = -1
    for i in range(N):
        t = T - H[i] * 6 / 1000
        if abs(t - A) < dif:
            dif = abs(t - A)
            ans = i + 1
    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

tmp = float("inf")
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    T, A = map(int, readline().split())
    H = list(map(int, readline().split()))
    X = map(lambda x: abs(A - (T - 0.006 * x)), H)

    x_min = INF
    ans = -1

    for i, x in enumerate(X, 1):
        if x < x_min:
            ans = i
            x_min = x

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
now = 99999
ans = 0
for i in range(N):
  tem = T - H[i] * 0.006
  if abs(tem - A ) < now:
    now = abs(tem - 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()))
ans=1000000000000
for i in range(N):
    temp=T-H[i]*0.006
    if abs(temp-A)<ans:
        ans=abs(temp-A)
        p=i+1
print(p)

Submission status: Accepted

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

num=10**5
ans=0

for i,j in enumerate(l):
  tem=abs(a-(t-j*0.006))
  num=min(num,tem)
  if num==tem:
    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()))
b = 10 ** 5
c = 0
for i in range(len(h)):
    if abs((t - h[i] * 0.006) - a) < b:
        b = abs((t - h[i] * 0.006) - a)
        c = i
print(c + 1)

Submission status: Accepted

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

s = 10000

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

Submission status: Accepted

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

mn = 10000000
ans = 0
for i in range(N):
    now = T - H[i] * 0.006
    if abs(now - A) <= mn:
        mn = abs(now - A)
        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 = (10**9, -1)
for i in range(N):
    tmp = T - 0.006 * H[i]
    if abs(tmp - A) < ans[0]:
        ans = (abs(tmp - A), i + 1)
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
res=float('inf')
for i in range(n):
  if abs(t-h[i]*float(0.006)-a)<res:
    res=abs(t-h[i]*float(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()))
ans=100000000000000
ans1=-1
for i in range(n):
    if abs(a-(t-h[i]*0.006))<ans:
        ans=abs(a-(t-h[i]*0.006))
        ans1=i+1
print(ans1)

Submission status: Accepted

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

ans = 0
temp = 1000000000000

for i in range(n):
  if temp > abs(a*1000-1000*t+h[i]*6):
    temp = abs(a*1000-1000*t+h[i]*6)
    ans = i+1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]
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()))

min_value = abs(A - (T - H[0] * 0.006))
min_index = 1
for i in range(1, len(H)):
    if(min_value > abs(A - (T - H[i] * 0.006))):
        min_value = abs(A - (T - H[i] * 0.006))
        min_index = i+1
print(min_index)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
T, A = (int(x) for x in input().split())

result = [int(N) for N in input().split()]

list = []
for num in range(N):
    list.append(abs(T-0.006*result[num]-A))

m = np.argmin(list) + 1

print(m)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

now = ts[0]
ans = 1
for i in range(n):
    if ts[i] < now:
        ans = i+1
        now = ts[i]

print(ans)

Submission status: Accepted

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

temp = 10**6
res = 0
for i in range(n):
    dt = abs((t - al[i]*0.006)-a)
    if temp >= dt:
        temp = dt
        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 = []
for i in range(n):
    ans.append([abs((t-h[i]*0.006)-a),i])
ans.sort()
print(ans[0][1]+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = []

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

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

Submission status: Accepted

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

ans = 0
l = a + 10000

for i in range(n):
    k = abs(t-h[i]*0.006-a)
    if l > k:
        l = k
        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()))
ans = []
for i in range(n):
    s = abs(a-(t-h[i]*0.006))
    ans.append([s,i+1])
ans.sort()
print(ans[0][1])

Submission status: Accepted

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

ans = 0
diff = float("inf")

for i, height in enumerate(h):
    temp = T - 0.006 * height
    if diff > abs(A - temp):
        diff = abs(A - temp)
        ans = i + 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
T, A = map(int, input().split())
list1 = []
H = list(map(int, input().split()))
X = [abs(T-h*0.006-A) for h in H]
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()))
ans = 0
m = A + 1000
for i in range(N):
  d = abs(T - H[i] * 0.006 - A)
  if m > d:
    m = d
    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 = 1000
ans = 0
for i in range(n):
    if x >=  abs(a-(t-h[i]*0.006)):
        x = abs(a-(t-h[i]*0.006))
        ans = i+1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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


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

for i, h in enumerate(H_list):
    if i==0:
        diff_min = get_diff(T, A, h)
        diff_min_idx = i + 1
    else:
        diff = get_diff(T, A, h)
        if diff_min > diff:
            diff_min = diff
            diff_min_idx = i + 1 

print(diff_min_idx)

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    n = int(input())
    t, a = map(int, input().split())
    li = list(map(int, input().split()))
    ans_v = float("inf")
    ans_i = 0
    for i, x in enumerate(li):
        temperature = abs(a - (t - x * 0.006))
        if ans_v > temperature:
            ans_v = temperature
            ans_i = i + 1
    print(ans_i)


if __name__ == "__main__":
    main()

Submission status: Accepted

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


def main():
    import numpy as np

    N, T, A, *H = map(int, open(0).read().split())
    print(np.argmin(np.abs(A - (T - np.array(H) * 0.006))) + 1)


main()

Submission status: Accepted

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

temperature_diff_list = []
for height in height_list:
  temperature = T - height*0.006
  temperature_diff = temperature - A if temperature > A else A - temperature 
  temperature_diff_list.append(temperature_diff)

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

Submission status: Accepted

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

diff = list(map(lambda x: abs(A - (T - x * 0.006)), Hs))
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()))
min = 1e8
ans = None

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

print(ans + 1)

Submission status: Accepted

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

for i in range(n):
    l.append(abs(a-(t-h[j]*0.006)))
    j+=1

maxv = min(l)
print(l.index(maxv)+1)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 10**7
for i in range(n):
    c = abs(a-(t-h[i]*0.006))
    if c < tmp:
        tmp = c
        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()))
l = []
for i in h:
  l.append(abs(t-i*0.006 - a))
print(l.index(min(l))+1)

Submission status: Accepted

Solution code:
import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n, = [int(num) for num in lines.pop(0).split(" ")]
t, a = [int(num) for num in lines.pop(0).split(" ")]
h_list = [int(num) for num in lines.pop(0).split(" ")]
ans = 1
prev_dif = sys.maxsize
for index, h in enumerate(h_list, 1):
    dif = abs((t - h * 0.006) - a)
    if dif < prev_dif:
        prev_dif = dif
        ans = index
print(ans)

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]

ans = 0
mindt = 100000
for i in range(N):
    if abs(A-temp[i])<mindt:
        ans=i+1
        mindt=abs(A-temp[i])
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

min_degree = 10000

for i in range(len(H)):
  temp = T - H[i]*0.006
  if abs(A-temp) < min_degree:
    min_degree = abs(A-temp)
    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()))

n = 0
t_best = 100000
for i in range(N):
    if abs(A - (T-H[i]*0.006)) < t_best:
        t_best = abs(A - (T-H[i]*0.006))
        n = i+1
    
print("{}".format(n))

Submission status: Accepted

Solution code:
from bisect import *
N = int(input())
T, A = map(int, input().split())
H = []
for i, h in enumerate(map(int, input().split())):
    H.append((T-h*0.006, i))
H.sort()
H2 = [h for h, _ in H]
i = bisect_left(H2,A)
if i==N:
    print(H[-1][1]+1)
elif abs(H[i-1][0]-A) > abs(H[i][0]-A):
    print(H[i][1]+1)
else:
    print(H[i-1][1]+1)

Submission status: Accepted

Solution code:
n=int(input())
t,a=map(int,input().split())
*h,=map(int,input().split())
H=[]
for i in h:
    H.append(abs(t-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()))

ans = 10**9
idx = 0
for i in range(N):
  temp = T - H[i]*0.006
  diff = abs(A - temp)
  if diff < ans:
    ans = diff
    idx = i + 1
print(idx)

Submission status: Accepted

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

def temp(x):
    y = abs(t - x*0.006 - a)
    return y
t_dif = list(map(temp, h_list))
t_min = min(t_dif)
t_index = int(t_dif.index(t_min))
print(t_index+1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
temp0, avg = list(map(int, input().split(' ')))
height = list(map(int, input().split(' ')))

diff = [0]*n
for i in range(n):
  temp = temp0 - 0.006*height[i]
  diff[i] = abs(avg - temp)
print(np.argmin(diff)+1)

Submission status: Accepted

Solution code:
N = int(input())
T,A = map(int,input().split())
Hls = list(map(int,input().split()))
mabs = 10**5+1
for i in range(N):
    if abs(A-(T-Hls[i]*0.006)) <= mabs:
        mabs = abs(A-(T-Hls[i]*0.006))
        ans = i
    else:
        pass
print(ans+1)

Submission status: Accepted

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

Submission status: Accepted

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

temp_list = [abs(t - i * 0.006 - a) for i in h]
min_diff = min(temp_list)
for i, temp in enumerate(temp_list):
    if temp == min_diff:
        print(i + 1)
        break

Submission status: Accepted

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

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

# np.argsortなしで，最大値，最小値のindexを取得
ans = min(enumerate(pt), key=lambda x: x[1])[0]
print(ans + 1)

# 最大値が複数あるとき
# [i for i, v in enumerate(li) if v == max(l)]
# 計算重そう

Submission status: Accepted

Solution code:
n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
minNum = float('inf')

for i in range(len(l)):
    num = t - l[i] * 0.006
    if abs(num - a) < minNum:
        minNum = abs(num -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()))
diff_list = []
for i in range(N):
  tmp = T - H[i]*0.006
  diff = abs(A-tmp)
  diff_list.append(diff)
ans = diff_list.index(min(diff_list)) + 1
print(ans)

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N = I()
T,A = MI()
H = [abs(T-i*0.006-A) for i in LI()]
m = min(H)
print(H.index(m)+1)

Submission status: Accepted

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

Submission status: Accepted

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

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()))
l = [T - h*0.006 for h in H]
print(l.index(min(l, key=lambda v: abs(A - v))) + 1)