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(float,input().split()))
tm=0
tem=0
TEM = []
TM = []
for h in H:
    tm=T-h*0.006
    TM.append(tm)
for tm in TM:
    tem=abs(tm-A)
    TEM.append(tem)
num = TEM.index(min(1))
print(num+1)

N=int(input())
T,A = map(int,input().split())
H=list(map(float,input().split()))
tm=0
tem=0
TEM = []
TM = []
for h in H:
    tm=T-h*0.006
    TM.append(tm)
for tm in TM:
    tem=abs(tm-A)
    TEM.append(tem)
num = TEM.index(min(TEM))
print(num+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()))
a=[]
for i in h:
  a.append(abs(A-(T-i*0.006)))
print(index(max(a))+1)

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(index(min(a))+1)

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)

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):
n = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 100000
aa = 0
for i in range(n):
    if ans >= abs((T-0.006*H[i])-A):
        ans = abs((T-0.006*H[i])-A)
        aa = i
        
print(i+1)

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

def TEMP(H):
    return T - H*0.006

def AAA(H):
    return abs(A - H)

H = list(map(TEMP, H))

H = list(map(AAA, H))

print(H.index(min(H))+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(' ')]
T=[]
for i in range(n):
  T[i]=t-h[i]
index=0
for i in range(n):
  if abs(T[i]-a)<abs(T[index]-a):
    index=i
print(index+1)

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

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


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):
n = int(input())
t, a = list(map(int, input().split()))
h = list(map(int, input().split()))

diff_temp = [abs(x - (a - t) / 0.006) for x in h]
print(h[diff_temp.index(min(diff_temp))])


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

print(min(list(map(lambda x: [abs(t - x * 0.006 - a), h.index(x)], h)), key = lambda x:x[0]).pop() + 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):
s=input()
d=[]
for i in range(len(s)-2):
	d.append(int(s[i:i+3]))
ans=[abs(j-753) for j in d]
print(min(ans))

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

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

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

N=int(input())
T,A=pin()
c=(T-A)/0.006
HH=[abs(h-c) for h in pin()]
#print(c,HH)
print(HH.index(min(HH))+1)


def pin(type=int):
    return map(type,input().split())

"""

"""
#solution:

N=int(input())
T,A=pin()
H=[i for i in pin()]
c=(T-A)/0.006
HH=[abs(h-c) for h in H]
#print(c,HH)
print(HH.index(min(HH))+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):
# your code goes here
n=int(input())
a,b=map(int,input().split())
c=list(map(int,input().split()))
mi=(10000000000,-1)
for i in range(len(c)):
	mi=min(mi,(abs(a-c[i]*0.006),i))
print(mi[1]+1)
	

# your code goes here
n=int(input())
a,b=map(int,input().split())
c=list(map(int,input().split()))
mi=(10000000000,-1)
for i in range(len(c)):
	mi=min(mi,(abs(a-c[i]*0.006-b),i))
print(mi[1]+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):
ans=10**18
n=int(input())
t,a=map(int,input().split())
for i in map(int,input().split()):
  b=t-i*0.006
  if abs(ans-a)>abs(b-a):
    ans=b
    
print(ans)

n=int(input())
t,a=map(int,input().split())
ans=1
b=10**5
h=list(map(int,input().split()))
for i in range(n):
  if abs(b-a)>abs(t-h[i]*0.006-a):
    b=t-h[i]*0.006
    ans=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):
n = int(input())
t, a = map(int,input().split())
a *= 1000
t *= 1000
h = list(map(int,input().split()))

diff = 1e9
ans = 0
for i in range(n):
  h[i] = t - h[i] * 6
  if abs(a - h[i]) < diff:
    diff = abs(a - h[i])
    ans = i + 1
  
  print(ans)
  

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

diff = 1e9
ans = 0
for i in range(n):
  h[i] = t - h[i] * 6
  if abs(a - h[i]) < diff:
    diff = abs(a - h[i])
    ans = 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):
n = int(input())
t,a = map(int,input().split())
h_list = list(map(int,input().split()))

temp_list = [abs((t-h*0.006)-a) for h in h_list]
print(temp_list)
ans = temp_list.index(min(temp_list))+1

print(ans)

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

temp_list = [abs((t-h*0.006)-a) for h in h_list]
ans = temp_list.index(min(temp_list))+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):
n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
l2 = [t - i * 0.006 for i in l]
diff = a
for i in range(n + 1):
    if diff > abs(i - a):
        diff = abs(i - a)
        ans = i
print(i)


n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
l = list(map(lambda x: t - x * 0.006 , l))
l = list(map(lambda x: abs(x - a), l))
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 = input().split(' ')
t = int(t)
a = int(a)
h = input().split(' ')

diff = 100
point = 10000

for x in range(n):
    tmp = t - h[x] * 0.006 
    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)

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

diff = 100
point = 10000

for x in range(n):
    tmp = t - int(h[x]) * 0.006 
    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)


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

diff = 10000
point = 10000

for x in range(n):
    temp = t - int(h[x]) * 0.006
    tmp = abs(a - temp)

    if tmp < diff:
        diff = tmp
        point = x + 1

print(point)


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):
iN = int(input())
iT,iA = [int(_) for _ in input().split()]
aH = list(map(lambda x: abs(iT-x*0.006 -iA) , [int(_) for _ in input().split()]))
print(aH)
iMin = min(aH)
for i in range(iN):
    if aH[i] == iMin :
        print(i+1)
        exit()


iN = int(input())
iT,iA = [int(_) for _ in input().split()]
aH = list(map(lambda x: abs(iT-x*0.006 -iA) , [int(_) for _ in input().split()]))
iMin = min(aH)
for i in range(iN):
    if aH[i] == iMin :
        print(i+1)
        exit()


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

min_d = 1000
ans = 0
for i in range(N):
    t = T - H[i] * 0.006
    d = abs(t - A)
    if d < min_d:
        min_d = d
        ans = i
        
print(ans)

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

min_d = 1000
ans = 0
for i in range(N):
    t = T - H[i] * 0.006
    d = abs(t - A)
    if d < min_d:
        min_d = d
        ans = 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):
N=int(input())
T,A=map(int,input().split())

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

x=[]

for i in range(len(H)):
    x.append(abs(A-(T-H[i]*0.006)))

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

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

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

x=[]

for i in range(len(H)):
    x.append(abs(A-(T-H[i]*0.006)))

print(x.index(min(x))+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 = 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)


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

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)

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

dist = {}
for i in range(N):
  tempra = T - H[i]*0.006
  dist[i+1] = abs(tempra - abs(A))
print(min(dist, key = dist.get))
print(dist)

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

res = [abs(T-h*0.006-A) for h in H]
print(res.index(min(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(x) for x in input().split()]
h = [int(x) for x in input().split()]
l = [(i, abs(a - (t - x * 0.0006))) for i, x in enumerate(h)]
target = min(l, key = lambda x: x[1])
print(target[0]+1)

n = int(input())
t, a = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
l = [(i, abs(a - (t - x * 0.006))) for i, x in enumerate(h)]
target = min(l, key = lambda x: x[1])
print(target[0]+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(int, input().split()))

min_i =	0
min_temp = abs(T - H[0] * 0.006 - A)

for i in range(1, N):
    if abs(T-H[i]*0.006-A) < min_temp:
	min_temp = abs(T-H[i]*0.006-A)
        min_i =	i

print(min_i+1)


# -*- coding: utf-8 -*-                                                                              

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

min_i =	0
min_temp = abs(T - H[0] * 0.006 - A)

for i in range(1, N):
    if abs(T-H[i]*0.006-A) < min_temp:
	min_temp = abs(T-H[i]*0.006-A)
        min_i =	i

print(min_i+1)


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

min_i =	0
min_temp = abs(T - H[0] * 0.006 - A)

for i in range(1, N):
    if abs(T-H[i]*0.006-A) < min_temp:
	min_temp = abs(T-H[i]*0.006-A)
        min_i =	i

print(min_i+1)


# -*- coding: utf-8 -*-                                                                              

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

import numpy as	np

ans = (T-A) / 0.006

h = np.abs(np.array(list(map(int, input().split()))) - ans)

print(np.argmin(h) + 1)
	


Verdicts: 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):
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)



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)))
    if res>tmp:
        res = tmp
        ans = 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):
N = int(raw_inpit())
T, A = map(int, raw_input().split())
Hs = list(map(int, raw_input().split()))

Ts = list(map(lambda x: T-x * 0.006), Hs)

i = 0
v = 0
for _i, _T in enumerate(Ts):
    if abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i)


N = int(raw_inpit())
T, A = map(int, raw_input().split())
Hs = list(map(int, raw_input().split()))

Ts = list(map(lambda x: T-x * 0.006), Hs)

i = 0
v = 0
for _i, _T in enumerate(Ts):
    if abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)


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

Ts = list(map(lambda x: T-x * 0.006, Hs))

i = 0
v = None
for _i, _T in enumerate(Ts):
    print(v)    
    if v is None or abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)

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

Ts = list(map(lambda x: T-x * 0.006), Hs)

i = 0
v = 0
for _i, _T in enumerate(Ts):
    if abs(_T-T) < v:
        v = abs(_T-T)
        i = _i

print(i+1)

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

Ts = list(map(lambda x: T-x * 0.006, Hs))

i = 0
v = None
for _i, _T in enumerate(Ts):
    if v is None or abs(_T-A) < v:
        v = abs(_T-A)
        i = _i

print(i+1)

Verdicts: Runtime Error

Runtime Error

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

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

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

min_diff = 10**10
ans = 0
for i in range(n):
  temp = abs(a - (t - h[i]*0.006))  
  if min_diff > temp:
    min_diff = temp
    ans = 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):
N=int(input())
T,A=map(int,input().split())
H=[int(x) for x in input().split()]
s=float("inf")
j=0
for i in range(N):
  tempgap=abs(T-H[i]*0.006-A)
  if tempgap<s:
    s,j=tempgap,i
print(i+1)
  

N=int(input())
T,A=map(int,input().split())
H=[int(x) for x in input().split()]
s=float("inf")
j=0
for i in range(N):
  tempgap=abs(T-H[i]*0.006-A)
  if tempgap<s:
    s,j=tempgap,i
print(j+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()))
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)

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+1
    judge=abs(a-(t-0.006*h))

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 = input()
T,A = input().split()
H = list(map(lambda x: abs(T - int(x) * 0.006 - A),input().split()))
print(H.index(min(H))+1)

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

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

N = input()
T,A = input().split()
H = map(lambda x: abs(T - x * 0.006 - A),input().split())
print(min(H))

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

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

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

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


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:
        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:
            choice = temperatures[index - 1]
            print(get_key_from_value(h_dict, choice))
        if index <= n - 1:
            choice = temperatures[index + 1]
            print(get_key_from_value(h_dict, choice))


if __name__ == '__main__':
    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=[abs((t-int(i)*0.006)-a) for i in open(0).readline().split()]
print(h.index(min(h))+1)

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

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
b=abs(t-a-h[0]*0.006)
ans=0
for i in range(1,n):
    if b>abs(t-a-h[i]*0.006):
        b=abs(t-a-h[i]*0.006)
        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())
Hs = list(map(int,input().split()))
ts = []
for H in Hs:
    ts.append(T - H * 0.006)
min_t = -10**6
min_idx = 0
for idx, t in enumerate(ts):
    print(idx)
    if abs(t - A) > min_t:
        min_idx = idx
print(min_idx+1)

N = int(input())
T, A = map(int, input().split())
Hs = list(map(int,input().split()))
ts = []
for H in Hs:
    ts.append(T - H * 0.006)
min_t = 10**6
min_idx = 0
for idx, t in enumerate(ts):
    if abs(t - A) < min_t:
        min_t = abs(t - A)
        min_idx = idx
print(min_idx+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):
input()
T,A=list(map(int,input().split(" ")))
H=list(map(int,input().split(" ")))
avg=[]
for h in H:
    avg.append(T-h*0.006)
#print(avg)


mini=abs(A-avg[0])
re=10000
for i in range(1,len(avg)):
    #print(abs(A-avg[i]),mini)
    if abs(A-avg[i])<mini:
        mini=abs(A-avg[i])
        #print(mini)
        re=i
print(re+1)
        
    

        
    



input()
T,A=list(map(int,input().split(" ")))
H=list(map(int,input().split(" ")))
avg=[]
for h in H:
    avg.append(T-h*0.006)
print(avg)


mini=1000
re=10000
for i in range(len(avg)):
    print(abs(A-avg[i]),mini)
    if abs(A-avg[i])<mini:
        mini=abs(A-avg[i])
        #print(mini)
        re=i
print(re+1)
        
    

        
    



input()
T,A=list(map(int,input().split(" ")))
H=list(map(int,input().split(" ")))
X=[abs(A-(T-h*0.006)) for h in H]

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

        
    



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):
a = int(input())
x  = 0
lists = []
ass =[]

b,standard = map(int,input().split())

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

for i in range(a):
    lists.append(abs(b - elev[i] * 0.006 - standard))
    print(lists)

m = min(lists)
mindex = lists.index(1.0)
print(mindex + 1)


import numpy as np

def getNearestValue(list, num):


    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]
a = int(input())
x  = 0
lists = []

b,standard = map(int,input().split())

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

for i in range(a):
    lists.append(int(b - elev[i] * 0.006))
print(getNearestValue(lists, standard)) 

a = int(input())
x  = 0
lists = []
ass =[]

b,standard = map(int,input().split())

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

for i in range(a):
    lists.append(abs(b - elev[i] * 0.006 - standard))

m = min(lists)
mindex = lists.index(m)
print(mindex + 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):
n = int(input())
T, A = map(int,input().split())
h = [int(i) for i in input().split()]
min_T = abs(T - h[0]*0.006)
i_min = 0

for i,v in enumerate(h):
    if (min_T > abs(T - h[i]*0.006)):
        min_T = abs(T - h[i]*0.006);
        i_min = i
print(i_min+1)

n = int(input())
T, A = map(int,input().split())
h = [int(i) for i in input().split()]
min_T = abs(T - h[0]*0.006 - A)
i_min = 0

for i,v in enumerate(h):
    if (min_T > abs(T - h[i]*0.006 - A)):
        min_T = abs(T - h[i]*0.006 - A);
        i_min = i
print(i_min+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 = [int(i) for i in range(N)]
b = []
for x in range(N):
  b.append(T - 0.006 * x - A)
print(min(b))
  

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

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 = input()
T, A = map(int, input().split())
print(T)
temperatures = list(map(int, input().split()))

r = 50000000000000
results = ''

list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      
    ondo_sa = A - avg_temp
    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

N = input()
T, A = map(int, input().split())
temperatures = list(map(int, input().split()))
 
r = 50000000
results = ''
 
list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):      

    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

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

r = 50000000
results = ''

list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):
  	if avg_temp < 0:
      	avg_temp = avg_temp * -1
      
    ondo_sa = A - avg_temp
    if r > ondo_sa:
        r = ondo_sa
        results = index + 1
print(results)

N = input()
T, A = map(int, input().split())
print(T)
temperatures = list(map(int, input().split()))
 
r = 50000000000000
results = ''
 
list = [T - t * 0.006 for t in temperatures]
for index, avg_temp in enumerate(list):
    ondo_sa = avg_temp - A

    if ondo_sa < 0:
        ondo_sa = - ondo_sa

    if r > abs(ondo_sa):
        r = ondo_sa
        results = index + 1
print(results)

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

Verdicts: Wrong Answer

Runtime Error

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())
n,a=map(int,input().split())
h=list(map(int,input().split()))
list=[]
for hh in h:
  list.append(t-0.006*hh)
ans=[]
for l in list:
  ans.append(abs(a-l))
print(min(ans))
        

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

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

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

print(ans.index(min(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_array = list(map(int, input().split()))

t_array = [abs(t - 0.006 * h) - a for h in h_array]
ans = t_array.index(min(t_array)) + 1
print(ans)

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

t_array = [abs(t - 0.006 * h - a) for h in h_array]
ans = t_array.index(min(t_array)) + 1
print(ans)

Verdicts: Wrong Answer

Accepted