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: Wrong Answer

Solution code:
n = int(input())
line = input().split()
t = int(line[0])
a = int(line[1])
temps = map(int,input().split())
temps = list(temps)
places = {}
count = len(temps)
for i in range(count):
  places[i] = abs(a - (t - 0.006 * temps[i]))
answer = min(places.items(),key = lambda x:x[1])[0]
print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
 
ans = float("inf")
ans2 = 0
for i,x in enumerate(h):
  tmp = t - x * 0.006
  if abs(ans - a) < abs(tmp - a):
    ans2 = i
    ans = tmp
print(ans2+1)

Submission status: Wrong Answer

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

ans = float("inf")
for x in h:
  tmp = t - x * 0.006
  if abs(ans - a) < abs(tmp - a):
    ans = tmp
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

result = 0
best = float('inf')
for i in range(N):
    t = T - H[i] * 0.006
    if abs(A - t) < best:
        best = A - t
        result = i + 1
print(result)

Submission status: Wrong Answer

Solution code:
candi_num = map(int, input())
temp, target = map(int, input().split(" "))
candidate = map(int, input().split(" "))
elevations = [i for i in candidate]

idx = 0
min_diff = 10000
for i, elevation in enumerate(elevations):
  temperture = temp - 0.006 * elevation
  diff = target - temperture
  if diff < min_diff:
    idx = i
print(idx)

Submission status: Wrong Answer

Solution code:
def c(n):
    return abs(abs(a) - abs(t - (n * 0.006)))

_ = int(input())
t,a = map(int,input().split())
p = list(map(int,input().split()))

d = list(map(c, p))
s = min(d)
print(d.index(s)+1)

Submission status: Wrong Answer

Solution code:
def c(n):
    return abs(abs(a) - abs(t - (n * 0.006)))

n = int(input())
t,a = map(int,input().split())
p = list(map(int,input().split()))
d = list(map(c, p))
s = min(d)
print(d.index(s)+1)

Submission status: Wrong Answer

Solution code:
N=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
judge=10**18
for i,h in enumerate(H):
  if abs(a-(t-0.006*h)) < judge:
    ans=i
    judge=abs(a-(t-0.006*h))

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = None
for x in range(n):
    cand = t * h[x] * 0.006
    if not palace:
        palace = x + 1
    elif abs(a - cand) < abs(a - (t - (h[palace-1] * 0.006))):
        palace = x + 1
print(palace)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = None
for x in range(n):
    cand = t * h[x] * 0.006
    if not palace:
        palace = x + 1
    elif abs(a - cand) < abs(a - (t * h[palace-1] * 0.006)):
        palace = x + 1
print(palace)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = None
for x in range(n):
    cand = t * h[x] * 0.006
    if not palace or abs(a - cand) < abs(a - (t * h[palace-1] * 0.006)):
        palace = x + 1
print(palace)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = None
for x in range(n):
    cand = t * h[x] * 0.006
    if not palace or abs(a - cand) < abs(a - (t * h[palace] * 0.006)):
        palace = x + 1
print(palace)

Submission status: Wrong Answer

Solution code:
n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = None
for x in range(n):
    cand = t * h[x] * 0.006
    if not palace or abs(t - cand) < abs(a - (t * h[palace] * 0.006)):
        palace = x + 1
print(palace)

Submission status: Wrong Answer

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

temp = 0.006
min_t = math.fabs(a - (t - h[0] * temp))
min = 0

for i in range(n):
    T = t - h[i] * temp
    if math.fabs(a - T) < min_t:
        min = i

print(min + 1)

Submission status: Wrong Answer

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

temp = 0.006
min_t = abs(a - (t - h[0] * temp))

for i in range(n):
    T = t - h[i] * temp
    if abs(a - T) <= min_t:
        min = i + 1

print(min)

Submission status: Wrong Answer

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

mint = abs(a - (t - h[0] * 0.006))
min = -1

for i in range(len(h)):
    T = t - h[i] * 0.006
    if abs(a - T) <= mint:
        min = i + 1

print(min)

Submission status: Wrong Answer

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

mint = a - (t - h[0] * 0.006)

for i in range(len(h)):
    T = t - h[i] * 0.006
    if abs(a - T) <= mint:
        min = i + 1

print(min)

Submission status: Wrong Answer

Solution code:
import numpy as np

N=int(input())
TA = list(map(int,input().split()))
T=TA[0]
A=TA[1]
H = list(map(int,input().split()))
temperature=[]
def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

for i in range(N):
    temperature.append(T-H[i]+0.005)

print(getNearestValue(temperature,A)+1)

Submission status: Wrong Answer

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

mtemp = math.fabs(A - (T - Hn[0] * 0.006))
midx = 0
for idx, v in enumerate(Hn):
    print(idx)
    print(v)
    tmp = math.fabs(A - (T - v * 0.006))
    if tmp < mtemp:
        mtemp = tmp
        midx = idx

print(midx + 1)

Submission status: Wrong Answer

Solution code:
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
t,a = MAP()
h = MAP()

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

Submission status: Wrong Answer

Solution code:
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
t,a = MAP()
h = MAP()

res = MOD
for i in range(n):
    tmp = abs(a-(t-(h[i]*0.06)))
    if res>tmp:
        res = tmp
        ans = i+1
print(ans)

Submission status: Wrong Answer

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

#print(h)
l = [0]*n

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

#最小値のインデックスを出力
#print(l.index(min(l)))

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

Submission status: Wrong Answer

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

ans = []
for i in range(N):
  a_t = T - (H[i] * 0.006)
  Abs = abs(A - a_t)
  ans.append(int(Abs))

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

Submission status: Wrong Answer

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

ans = []
for i in range(N):
  a_t = T - (H[i] * 0.006)
  Abs = abs(A - a_t)
  ans.append(int(Abs))

print(ans.index(min(ans)))

Submission status: Wrong Answer

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

ans = []
for i in range(N):
  a_t = T - (H[i] * 0.006)
  Abs = abs(A - a_t)
  ans.append(int(Abs))

for i in range(N):
  if min(ans) == ans[i]:
    print(i + 1)
    break

Submission status: Wrong Answer

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

ans = []
for i in range(N):
  a_t = T - (H[i] * 0.006)
  Abs = abs(A - a_t)
  ans.append(int(Abs))

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

Submission status: Wrong Answer

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

ans = []
for i in range(N):
  a_t = T - H[i] * 0.006
  Abs = abs(A - a_t)
  ans.append(int(Abs))

print(min(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(T - int(i) * 0.006) for i in input().split()]
result = 10 ** 6
count = 0
diff = {}
for i in range(N):
    list = sorted([A, H[i]])
    dif = str(list[1] - list[0])
    diff[dif] = i
#print(diff)

c = sorted(diff)

#print(c)
print(diff[str(c[0])] + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(T - int(i) * 0.006) for i in input().split()]
result = 10 ** 6
count = 0
for j in range(N):
    for i in range(N):
        list = sorted([A, H[i]])
        dif = list[1] - list[0]

        if dif <= result:
            result = dif
            count = i+1


print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(T - int(i) * 0.006) for i in input().split()]
result = 10 ** 6
count = 0
for j in range(N):
    for i in range(N):
        list = sorted([A, H[i]])
        dif = list[1] - list[0]

        if dif < result:
            result = dif
            count = i+1


print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = map(int, input().split())
H = [int(T - int(i) * 0.006) for i in input().split()]
result = 10 ** 6
count = 0
for i in range(N):
    list = sorted([A, H[i]])
    dif = list[1] - list[0]
    if dif < result:
        result = dif
        count = i+1


print(count)

Submission status: Wrong Answer

Solution code:
# ABC 113: B – Palace
n = int(input())
t, a = [int(s) for s in input().split()]
h = [int(s) for s in input().split()]
difference = [abs(a - (t - i * 0.006)) for i in h]

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

Submission status: Wrong Answer

Solution code:
# ABC 113: B – Palace
n = int(input())
t, a = [int(s) for s in input().split()]
h = [int(s) for s in input().split()]
difference = [abs(a - i * 0.006) for i in h]

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

Submission status: Wrong Answer

Solution code:
N = int(input())
t , x = map(int,input().split())
h_list = list(map(int,input().split()))
tmp = []
for h in h_list:
    tmp1 = t - h * 0.006
    tmp.append(tmp1)
ans_val = abs(x - tmp[0])
ans = 0
for i,val in enumerate(tmp):
    if ans_val > abs(x - val):
        ans = i
print(ans + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
t , x = map(int,input().split())
h_list = list(map(int,input().split()))
tmp = []
for h in h_list:
    tmp1 = abs(x - (t - h * 0.006))
    tmp.append(tmp1)
print(tmp)
print(tmp.index(min(tmp)) + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())
t , x = map(int,input().split())
h_list = list(map(int,input().split()))
tmp = []
for h in h_list:
    tmp1 = abs(x - t - h * 0.006)
    tmp.append(tmp1)
print(tmp.index(min(tmp)) + 1)

Submission status: Wrong Answer

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

distFromA = list(map(lambda x: abs((T - x * 0.06) - A), H))

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

Submission status: Wrong Answer

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

near = abs(a-(t-int(h[0]*0.006)))
ind = 1
for i in range(1,n):
	ave = t-int(h[i]*0.006)
	if near > abs(a-ave):
		ind = i+1
		near = abs(a-ave)

print(ind)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A=[int(x) for x in input().split()]
H = [int(x) for x in input().split()]
ans=1
Temp = abs(T -A - 0.006*H[0])

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

print(ans)

Submission status: Wrong Answer

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

C = lambda x: [T-x[i]*0.006 for i in range(len(x))]
CC = C(H)
ABS = [A- i for i in CC]

print(int(ABS.index(min(ABS))+1))

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split()]
H =[int(i) for i in input().split()]
C = lambda x: [T-x[i]*0.006 for i in range(len(x))]
CC = C(H)
bag = []
best_C = CC[0]
index_No = 0
for i in range(N):
    if best_C < abs(A-CC[i]):
        best_C = CC[i]
        index_No = i
print(index_No+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split()]
H =[int(i) for i in input().split()]
C = lambda x: [T-x[i]*0.006 for i in range(len(x))]
CC = C(H)
bag = []
best_C = 10000000
index_No = 0
for i in range(N):
    if best_C < abs(A-CC[i]):
        best_C = CC[i]
        index_No = i
print(index_No+1)

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = [int(i) for i in input().split()]
H =[int(i) for i in input().split()]
C = lambda x: [T-x[i]*0.006 for i in range(len(x))]
CC = C(H)
bag = []
best_C = 100
index_No = 0
for i in range(N):
    if best_C < abs(A-CC[i]):
        best_C = CC[i]
        index_No = i
print(index_No+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
diff = list(map(lambda x: abs((a - t)/0.006-x),h))
mini = min(diff)
for i in range(n):
  if mini == diff[i]:
    print(i+1)

Submission status: Wrong Answer

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

aa = float('inf')
ans = 1

for i in a:
    avg = x - i * 0.006
    dif = abs(y-avg)
    aa = min(aa,dif)
    if dif <= aa:
        ans += a.index(i)
        
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

# at = [t - x * 0.006 for x in h]
h = np.array(h)
at = t - h * 0.006
diff = a - at

print(np.argmin(diff) + 1)

Submission status: Wrong Answer

Solution code:
def main(n, t, a, h):
    def formula(t, x): return int(t - x * 0.006)
    res = []

    for _h in h:
        res.append(abs(a - formula(t, _h)))

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


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

    main(n, t, a, h)

Submission status: Wrong Answer

Solution code:
import numpy as np

def find_nearest(array, value):
    min_value = np.abs(max(array))
    min_idx = 0
    j = 0
    
    for i in array: 
        j += 1
        if(min_value > np.abs(value - i)):
            min_value = np.abs(value - i)
            min_idx = j
    return min_idx

input_N = input()
input_two = input().split()
input_three = input().split()

N = int(input_N)
T = int(input_two[0])
A = float(input_two[1])

H_f = [float(s) for s in input_three]
j = 0
degree_list = list(range(j))
for i in H_f:
    degree_list.append(T-i*0.006)

print(find_nearest(degree_list, A))

Submission status: Wrong Answer

Solution code:
import numpy as np

def find_nearest(array, value):
    min_value = np.abs(max(array))
    min_idx = 0
    j = 0
    
    for i in array: 
        j += 1
        if(min_value > np.abs(value - i)):
            min_value = np.abs(value - i)
            min_idx = j
    i#dx = np.abs(array-value).argmin()
    return min_idx

input_N = input()
input_two = input().split()
input_three = input().split()

N = int(input_N)
T = int(input_two[0])
A = float(input_two[1])

H_f = [float(s) for s in input_three]
j = 0
degree_list = list(range(j))
for i in H_f:
    degree_list.append(T-i*0.006)

print(find_nearest(degree_list, A))

Submission status: Wrong Answer

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

best = t - h[0] * 0.006
ans = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect


def palace():
    def average_temperature(height):
        return t - (height * 0.006)
    
    def get_key_from_value(dict, value):
        for k, v in dict.items():
            if v == value:
                return k
    
    n = int(input())
    t, a = map(float, input().split())
    
    h = list(map(int, input().split()))
    h_dict = {}
    for i in range(n):
        h_dict[i + 1] = average_temperature(h[i])
    
    h_sorted = sorted(h, reverse=True)
    temperatures = [average_temperature(height) for height in h_sorted]
    
    index = bisect.bisect_left(temperatures, a)
    if index - 1 >= 0 and index <= n - 1:
        print('a')
        choices = [temperatures[index - 1], temperatures[index]]
        abses = [abs(a - choices[0]), abs(a - choices[1])]
        if abses[0] >= abses[1]:
            print(get_key_from_value(h_dict, choices[1]))
        else:
            print(get_key_from_value(h_dict, choices[0]))
    else:
        if index - 1 >= 0:
            print('b')
            choice = temperatures[index - 1]
            print(get_key_from_value(h_dict, choice))
        if index <= n - 1:
            print('c')
            choice = temperatures[index + 1]
            print(get_key_from_value(h_dict, choice))


if __name__ == '__main__':
    palace()

Submission status: Wrong Answer

Solution code:
#
# abcxxx b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


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

    ans = 0
    tmpt = float('inf')
    for i in range(N):
        tmp = T-H[i]*0.006
        if tmp * A >= 0:
            tmp = abs(tmp-A)
        else:
            tmp = abs(tmp+A)
        if tmp == min(tmp, tmpt):
            tmpt = tmp
            ans = i+1
    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
12 5
1000 2000"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
21 -11
81234 94124 52141"""
        output = """3"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

Solution code:
#
# abcxxx b
#
import unittest
from io import StringIO
import sys


def input():
    return sys.stdin.readline().rstrip()


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

    ans = 0
    ooo = float('inf')
    for i in range(N):
        tmp = T-H[i]*0.006
        if tmp * A >= 0:
            tmp = abs(tmp-A)
        else:
            tmp = abs(tmp+A)
        if tmp == min(tmp, ooo):
            ooo = tmp
            ans = i+1
    print(ans)


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
12 5
1000 2000"""
        output = """1"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
21 -11
81234 94124 52141"""
        output = """3"""
        self.assertIO(input, output)


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

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

min_temp = 1000
for i in range(N):
    c = T - (H[i] * 0.006)
    if c < min_temp:
        ans = i
        min_temp = c

print(ans)

Submission status: Wrong Answer

Solution code:
N = input()
T_A = input().split()
T = int(T_A[0])
A = int(T_A[1])
H_list = list(map(int, input().split()))

i = 1
i_H_list = []
for H in H_list:
    ave_T = T - H * 0.006
    i_H_list.append([i, abs(A - ave_T)])
    i += 1

print(i_H_list)

min_diff = -1
min_diff_i = -1
for i in range(len(H_list)):
    if min_diff > i_H_list[i][1] or min_diff == -1:
        min_diff = i_H_list[i][1]
        min_diff_i = i_H_list[i][0]
print(min_diff_i)

Submission status: Wrong Answer

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(a-(t-0.006*h[i])))

print(ans.index(min(ans)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
TA = list(map(float,input().split()))
H = list(map(float,input().split()))
temp = 99999999999999.999
ind = 0
for x in H:
	if temp > abs(TA[1] -(TA[0]-x*0.006)):
		temp = abs(TA[1]-x*0.006)
		ind = H.index(x)
print(ind+1)

Submission status: Wrong Answer

Solution code:
N = input()
TA = list(map(float,input().split()))
H = list(map(float,input().split()))
temp = 99999999999999.999
index = 0
for x in H:
	if temp > abs(TA[1]-x*0.006):
		temp = abs(TA[1]-x*0.006)
		index = H.index(x)
print(index+1)

Submission status: Wrong Answer

Solution code:
N = input()
TA = list(map(int,input().split()))
H = list(map(int,input().split()))
temp = 999999999.999
index = 0
for x in H:
	if temp > abs(TA[1]-x*0.006):
		temp = abs(TA[1]-x*0.006)
		index = H.index(x)
print(index+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
T, A = map(int, input().split())
nl = list(map(int, input().split()))

s = [abs(T - i*0.06) for i in nl]
print(s.index(min(s)) + 1)

Submission status: Wrong Answer

Solution code:
n = int(input())
v = list(map(int, input().split()))
p = list(map(int, input().split()))
ans = []

for i in p:
  s = int(v[0] - i * 0.006)
  ans.append(abs(v[1] - s))

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

Submission status: Wrong Answer

Solution code:
n = int(input())
v = list(map(int, input().split()))
p = list(map(int, input().split()))
ans = []

for i in p:
  s = int(v[0] - i * 0.006)
  ans.append(abs(s - v[1]))

print(ans.index(max(ans)))

Submission status: Wrong Answer

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

for i in range(0,len(H)):
  H[i]=abs(1000*a-t*1000+H[i]*6)
  
print(H.index(min(H)))

Submission status: Wrong Answer

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

for i in range(len(H)):
  H[i]=abs(1000*a-t*1000-H[i]*6)
  
print(H.index(min(H)))

Submission status: Wrong Answer

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

for i in range(len(H)):
  d=abs(1000*a-t*1000-H[i]*6)
  d1=d
  if d<d1:
    continue
  else:
    break
  
print(i)

Submission status: Wrong Answer

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

for i in range(len(H)):
  Ave_temparature=abs(1000*a-t*1000-H[i]*6)
  L.append(Ave_temparature)
  
print(L.index(min(L)))

Submission status: Wrong Answer

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

for i in range(len(H)):
  Ave_temparature=1000*a-t*1000-H[i]*6
  L.append(Ave_temparature)
  
print(L.index(min(L)))

Submission status: Wrong Answer

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

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

sabun  = 1000000000000
res = 0
for i in range(n):
    if abs(t[i]-a) < sabun:
        sabun = abs(t[i]-a)
        res = i+1

print(res)

Submission status: Wrong Answer

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

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

sabun  = 1000
res = 0
for i in range(n):
    if abs(t[i]-a) < sabun:
        sabun = abs(t[i]-a)
        res = i+1

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

k = abs(a- (t - h[0] * 0.006))
candidate = 0
for i in range(n):
    avg_tmp = t - h[i] * 0.006
  #  print(avg_tmp)
    if k >= abs(a - avg_tmp):
        candidate = i + 1

print(candidate)

Submission status: Wrong Answer

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

k = abs(a- (t - h[0] * 0.006))
candidate = 1
for i in range(n):
    avg_tmp = t - h[i] * 0.006
  #  print(avg_tmp)
    if k >= abs(a - avg_tmp):
        candidate = i + 1

print(candidate)

Submission status: Wrong Answer

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

k = a- (t - h[0] * 0.006)
candidate = 1
for i in range(n):
    avg_tmp = t - h[i] * 0.006
  #  print(avg_tmp)
    if k >= a - avg_tmp:
        candidate = i + 1

print(candidate)

Submission status: Wrong Answer

Solution code:
from fractions import gcd
import sys
input = sys.stdin.readline


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

    d_min = float('inf')
    ans = 0
    for i in range(n):
        if abs(a - H[i]*0.006)<d_min:
            d_min = abs(a - H[i]*0.006)
            ans = i+1
    
    print(ans)
    

 
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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