TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
# ABC113b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

# ABC113b
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
T,A = map(int,input().split())
res = 0
diff = 100
Hlist = input().split()
Hlist = [int(i) for i in Hlist]
for i in range(N):
    H = Hlist[i]
    average = T - H * 0.006
    print(average,diff)
    a = abs(A-average)
    if diff >= a:
        res = i
    diff = min(diff,a)
print(res+1)

N = int(input())
T,A = map(int,input().split())
res = 0
diff = 10000
Hlist = input().split()
Hlist = [int(i) for i in Hlist]
for i in range(N):
    H = Hlist[i]
    average = T - H * 0.006
    a = abs(A-average)
    if diff >= a:
        res = i
    diff = min(diff,a)
print(res+1)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
T,A  =[int(i) for i in input().split()]
H = [int(i) for i in input.split()]
diff = (abs(A-(T-H[0]*0.006)))
palace = 0
for i in range(H):
    if(abs(A-(T-H[i]*0.006)) < diff):
        palace = i
        diff = abs(A-(T-H[i]*0.006))
print(palace)


N = int(input())
T,A  =[int(i) for i in input().split()]
H = [int(i) for i in input().split()]
diff = (abs(A-(T-H[0]*0.006)))
palace = 0
for i in range(len(H)):
    if(abs(A-(T-H[i]*0.006)) < diff):
        palace = i
        diff = abs(A-(T-H[i]*0.006))
print(palace+1)


Verdicts: Runtime Error

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

Submission attempts (in order):
n = int(input())
t,a = map(int,input().split())
H_list = list(map(int,input().split()))
t_list = [t-h*0.006 for h in H_list ]
a_list = [abs(a-x) for x in temp_list]
print(a_list.index(min(a_list))+1)   

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

Verdicts: Runtime Error

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))
ans = 100
for i in N:
    s = T - i*0.006
    ans = min(A-s,ans) 
print(ans)

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

for i in N:
    s = T - H(i)*0.006
    ans = min(A-s,ans) 
print(ans)

N = int(input())
T, A = map(int, input().split())
H = list(map(int,input().split()))
ans= 0
tmp = 100000
for i in range(N):
    s = T - H[i]*0.006
    if tmp > abs(A - s):
        tmp = abs(A - s )
        ans = i + 1
print(ans)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
def solve(N, T, A, H):
  best = (T - A) / 0.006
  index = -1
  diff = -1
  for i in range(N):
    d = abs(best - H[i])
    if diff == -1 or d < diff:
      diff = d
      index = i
  return i + 1


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


print(solve(N, T, A, H))


def solve(N, T, A, H):
  best = (T - A) * 500 / 3
  index = -1
  diff = 10001
  for i in range(N):
    d = abs(best - H[i])
    if d < diff:
      diff = d
      index = i
  return i + 1


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


print(solve(N, T, A, H))


def solve(N, T, A, H):
  best = (T - A) / 0.006
  index = -1
  diff = -1
  for i in range(N):
    d = abs(best - H[i])
    if diff == -1 or d < diff:
      diff = d
      index = i
  return index + 1


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


print(solve(N, T, A, H))


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#print(h)
l =[]
for i in range(n):
  a = T - h[i]*0.006
  print(a)
  b = abs(a-A)
  l.append(b)
  print(l)
c = l.index(min(l))
print(c+1)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 110
    d = [int(i) for i in input().split()]

    for i in d:
        a =Decimal(i)*Decimal(0.006)
        list.append(abs(c-a))
        if min > abs(c-a):
            min=abs(c-a)
    print(list.index(min)+1)



import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list =[]
    min = 100000
    d = [int(i) for i in input().split()]

    for i in d:
        a =b-Decimal(i)*Decimal(0.006)
        diff=0
        if a > c:
            diff =abs(c+a)
        else:
            diff =abs(c-a)
        list.append(diff)
        if min > diff:
            min=diff
    print(list.index(min)+1)



import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *

import numpy as np

import math

if __name__ == '__main__':
    n = int(input())
    b, c = map(int, input().split())
    list = []
    min = 10000000000
    d = [int(i) for i in input().split()]
    c = c * 1000

    for i in d:
        a = b *1000 - i * 6
        diff = 0
        if (a > 0 and c > 0) or (a < 0 and c < 0):
            diff = abs(c - a)
        else:
            diff = abs( a) +abs(c)
        list.append(diff)
        if min > diff:
            min = diff
    print(list.index(min) + 1)

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
_=input()
T,A = map(int,input().split())
H = map(int, input().split())
min_i = -1
min_d = 10**10
for i,h in enumerate(H):
  d = abs(A-(T-h*0.006))
  print(d)
  if d<min_d:
    min_d=d
    min_i=i
print(min_i+1)

_=input()
T,A = map(int,input().split())
H = [int(x) for x in input().split()]
min_i = -1
min_d = 10**10
for i,h in enumerate(H):
  d = abs(A-(T-h*0.006))
  if d<min_d:
    min_d=d
    min_i=i
print(min_i+1)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_diff_list = list(map(lambda x: abs(t - x * 0.006 - a), t_mean_list))
 
print(t_diff_list.index(min(t_diff_list)))

n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_diff_list = list(map(lambda x: abs(t - x * 0.006 - a), t_mean_list))

print(t_diff_list.index(min(t_val_list)))


n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_val_list = list(map(lambda x: t - x * 0.006, t_mean_list))
 
diff_min = abs(t_val_list[0] - a)
a_min = 0
for i in range(1, n):
  diff = abs(t_val_list[i] - a)
  if diff < diff_min:
    diff_min = diff
    a_min = i + 1
  else:
    continue
 
print(a_min)

n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_val_list = list(map(lambda x: t - x * 0.006, t_mean_list)

diff_min = math.abs(t_val_list[0] - a)
a_min = 1
for i in range(1, n):
  diff = math.abs(t_val_list[i] - a)
  if diff < diff_min:
    diff_min = diff
    a_min = i
  else:
    continue

print(a_min)

n = int(input())
t, a = map(int, input().split())
t_mean_list = list(map(int, input().split()))
t_val_list = list(map(lambda x: t - x * 0.006, t_mean_list))
 
diff_min = abs(t_val_list[0] - a)
a_min = 0
for i in range(1, n):
  diff = abs(t_val_list[i] - a)
  if diff <= diff_min:
    diff_min = diff
    a_min = i + 1
  else:
    continue

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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

res, height = 0, 100001
for i in range(N) :
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)

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

res, height = 0, 100001
for i in range(N) :
    tmp = T - H[i] * 0.006
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)

Verdicts: Runtime Error

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

Submission attempts (in order):
import numpy as np
N = int(input())
T,A = map(int,input().split())
H = np.array(list(map(int,input().split())))
p = np.absolute(((T-H*0.006)-A)))
print(np.argmin(p)+1)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
n = input()
t, a = map(int, input().split())
h_list = list(map(int, input().split()))

temp = abs(a - (t - h_list[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(i)

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

temp = abs(a - (t - h[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(i)

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

temp = abs(a - (t - h_list[0] * 0.006))
result = 1
i=1
for h in h_list:
    if abs(a - (t - h * 0.006)) < temp:
        temp = abs(a - (t - h * 0.006))
        result = i
    i += 1
print(result)


Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
dif = list(map(lambda x: abs(T - int(x) * 0.006 - A), input().split()))
print(dif.index(min(x_list)) + 1)

n = int(input())
t, a = map(int, input().split())
t = (a - t) * 1000
h = list(map(int, input().split()))
min_val = 10 ** 9
for i, x in enumerate(h):
    if min_val > abs(t + x * 6):
        min_val = abs(t + x * 6)
        ans = i
print(ans + 1)

Verdicts: Runtime Error

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

Submission attempts (in order):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
print(H)
P=X=B=0
for i in range(N) :
  X=abs(A-(T-H[i]*0.006))
  if X<=P :
    B=i
  P=X
print(B+1)

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
t, a = map(int, input().split(' '))
H = list(map(int, input().split(' ')))

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))

min_val = 10000

for i in range(len(H)):
    tmp = T - H[i] * 0.006
    sub = abs(tmp - A)
    if min_val > sub:
        ans = i
        min_val = sub2


print(ans+1)


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

min_val = 10000

for i in range(len(H)):
    tmp = T - H[i] * 0.006
    sub = abs(tmp - A)
    if min_val > sub:
        ans = i
        min_val = sub


print(ans+1)


Verdicts: Runtime Error

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

Submission attempts (in order):
N = int(input().strip())
T,A = map(int,input().strip().split())
Hs = [int(x) for x in input().strip().split()]
posTempDiv = 10000000
posId = 0
for i in range(N):
    if posTempDiv > abs(A - (T - Hs[i] * 0.006)):
        posTempDIv = abs(A - (T - Hs[i] * 0.006))
        posId = i + 1
print(posId)

N = int(input().strip())
T,A = map(int,input().strip().split())
Hs = [int(x) for x in input().strip().split()]
posTemp = 10000000
posId = 0
for i in range(N):
    if posTemp > abs(A - (T - Hs[i] * 0.006)):
        posTemp = abs(A - (T - Hs[i] * 0.006))
        posId = i + 1
print(posId)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

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


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

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
ln=[int(h) for h in input().split()]
ln = sorted(ln)
i=0
for h in ln:
    while (t-h*0.006)<=a:
        i+=1
print(min(ln[i],ln[i+1]).index())

n=int(input())
t,a=map(int,input().split())
ln=[abs(a-(t-0.006*int(x))) for x in input().split()]
print(ln.index(min(ln)))

n=int(input())
t,a=map(int,input().split())
ln=[t-0.006*int(a) for a in input().split()]
lm=[]
for x in ln:
    lm.append(abs(a-x))
print(lm.index(min(lm)))

n=int(input())
t,a=map(int,input().split())
ln=[t-0.006*int(x) for x in input().split()]
print(min(ln))

n=int(input())
t,a=map(int,input().split())
tem=[abs(t-0.006*int(m)-a) for m in input().split()]
print(tem.index(min(tem)))

n=int(input())
t,a=map(int,input().split())
tem=[abs(t-0.006*int(m)-a) for m in input().split()]
print(min(tem))

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

Verdicts: Time Limit Exceeded

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H_list = [int(e) for e in input().split()]

diff=1000000
ans = 0

for i in H_list:
	 
    if abs(A-(T−i*0.006)) < diff
    	diff = abs(A-(T−i*0.006))
        ans=i
        
print(ans)

N = int(input())
T, A = map(int, input().split())
H_list = [int(e) for e in input().split()]
     
diff=1000000
ans = 0
     
for i in range(len(H_list)):
  if abs(T-H_list[i]*0.006-A)<diff:
    diff = abs(T-H_list[i]*0.006-A)
    ans = i
    
print(ans+1)

Verdicts: Runtime Error

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

Submission attempts (in order):
import numpy as np

n = int(input())
t, a = list(map(int, input().split()))
li = np.asarray(list(map(int, input().split())))

li2 = np.abs(t - li * 0.006 - a)
print(np.argmin(li2))

import numpy as np

n = int(input())
t, a = list(map(int, input().split()))
li = np.asarray(list(map(int, input().split())))

li2 = np.abs(t - li * 0.006 - a)
print(np.argmin(li2) + 1)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N=int(input())
T,A=map(int,input().split())
H=[int(i) for i in input().split()]
I=[T-item*0.006 for item in H]
print(I)
D=[abs(A-item) for item in I]
print((D.index(min(D)))+1)

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
#-*-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=t-number*hensu
        dp.append(a-tmp)
    print(dp)
    print(dp.index(min(dp))+1)

if __name__=="__main__":
    main()

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006))] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])

from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006)) - abs(A)] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])

from operator import itemgetter
N = int(input())
T, A = map(int, input().split())
*H, = map(int, input().split())
avg = sorted([[i+1, abs(T - (h * 0.006) - A)] for i, h in enumerate(H)], key=itemgetter(1))
print(avg[0][0])

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = [(T - H[i] * 0.006) for i in range(N)]
print(t)
cur = 100000
for i in range(N):
    if (abs(t[i] - A) < cur): ans = i
print(ans)


N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = [(T - H[i] * 0.006) for i in range(N)]
cur = 100000
for i in range(N):
    if (abs(t[i] - A) < cur): cur, ans = abs(t[i] - A), i + 1
print(ans)


Verdicts: Wrong Answer

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

Submission attempts (in order):
i=input;s=split;t,a=map(int,i().s());l=list(map(lambda x:abs(t-int(x)*0.006-a),i().s()));print(l.index(min(l))+1)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
N = int(input())
T, A = input().split()
H = input().split()

min = 10000000
index = -1

for i in range(N):
  temp = int(T) - int(H[i]) * 0.006
  print(temp)
  if min > abs(int(A) - temp):
    min = abs(int(A) - temp)
    index = i

print(index+1)

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

min = 10000000
index = -1

for i in range(N):
  temp = int(T) - int(H[i]) * 0.006
  if min > abs(int(A) - temp):
    min = abs(int(A) - temp)
    index = i

print(index+1)


Verdicts: Wrong Answer

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

Submission attempts (in order):
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = int(input())
T,A = inpl()
HH = inpl()

temp = [T-0.006*H for H in HH]
temp.sort()

ans = -1
MIN = INF
for i,t in enumerate(temp):
    if MIN > abs(t-A):
        ans = i
        MIN = abs(t-A)
print(ans+1)


from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

N = int(input())
T,A = inpl()
HH = inpl()

temp = [[T-0.006*H,i] for i,H in enumerate(HH)]
temp.sort()

ans = -1
MIN = INF
for i,[t,ind] in enumerate(temp):
    if MIN > abs(t-A):
        ans = ind
        MIN = abs(t-A)
print(ans+1)


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
t,a = map(int, input().split())
h = list(map(int,input().split()))
ans = 1000000
for i in n:
    x = t - h[i]*0.006
    ans = min(ans, abs(x-a))
print(ans)  

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

n = int(input())
t,a = map(int, input().split())
h = list(map(int,input().split()))
ans = 1000000
for i in range(n):
    x = t - h[i]*0.006
    ans = min(ans, abs(x-a))
print(ans)  

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n=int(input())
t, a=map(int, input().split())
h=list(int(i) for i input().split())
temp=[abs(a-(t-k*0.006)) for k in h]
print(temp.index(min(temp))+1)




n=int(input())
t, a=map(int, input().split())
h=[int(i) for i input.split()]
temp=[abs(a-(t-k*0.006)) for k in h]
print(temp.index(min(temp))+1)



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



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



n=int(input())
t, a=map(int, input().split())
h=[int(i) for i input().split()]
temp=[abs(a-(t-k*0.006)) for k in h]
print(temp.index(min(temp))+1)


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



n=int(input())
t, a=map(int, input().split())
h=[int(i) for i input.split()]
temp=[abs(a-(t-k*0.006)) for k in h]
print(temp.index(min(temp))+1)

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

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




Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
n = int(input())
t, a = list(map(int, input().split()))
h = list(map(int, input().split()))

kion = list(map(int, list(map(lambda x: t-x*0.006, h))))
sub = list(map(int, list(map(lambda x: abs(a-x), kion))))

print(kion)

temp = sub.copy()
temp.sort()
index = sub.index(temp[0])

print(index+1)

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

kion = list(map(float, list(map(lambda x: t-x*0.006, h))))
sub = list(map(float, list(map(lambda x: abs(a-x), kion))))

temp = sub.copy()
temp.sort()
index = sub.index(temp[0])

print(index+1)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
x=list(map(int,input().split()))
ans=0
cnt=10**3
for i in range(x):
  s=t-x[i]*0.006
  if abs(s-a)<cnt:
    cnt=abs(s-a)
    ans=i+1
print(ans)

n=int(input())
t,a=map(int,input().split())
x=list(map(int,input().split()))
ans=0
cnt=10**3
for i in range(len(x)):
  s=t-x[i]*0.006
  if abs(s-a)<cnt:
    cnt=abs(s-a)
    ans=i+1
print(ans)


Verdicts: Runtime Error

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

Submission attempts (in order):
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)

n = int(input())
t, a = map(int, input().split())
h = [i for i in map(int, input().split())]
palace = 1
for x in range(n):
    diff_cand = abs(a - (t - (h[x] * 0.006)))
    diff_curr = abs(a - (t - (h[palace - 1] * 0.006)))
    if diff_cand < diff_curr:
        palace = x + 1
print(palace)

Verdicts: Wrong Answer

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

Submission attempts (in order):
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]
for i in diff:
	if diffmin > i:
		diffmin = i
print(diffmin)

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)

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)

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)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

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

Submission attempts (in order):
def calc(T, x):
  return T - x * 0.0006

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)

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)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
nums = list(map(int, input().split()))

diff = [0]*len(nums)

for i in len(nums):
    diff[i] = abs(A - (T - nums[i] * 0.006))

print(diff.index(min(diff[i])) + 1)

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

diff = [0] * n

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
n = int(input())
t, a  = map(int, input().split())
h = list(map(int, input().split()))
diff = [0]*n

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

n = int(input())
t, a  = map(int, input().split())
h = list(map(int, input().split()))
diff = [0]*n

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
# coding: utf-8
N = int(input())
T,A = map(int,input().split())
H = list(map(lambda x :  abs(T - int(x)*0.006) , input().split()))
print(H.index(min(H)) + 1)

# coding: utf-8
N = int(input())
T,A = map(int,input().split())
H = list(map(lambda x :  abs(A - (T - int(x)*0.006)) , input().split()))
print(H.index(min(H)) + 1)

Verdicts: Wrong Answer

Accepted