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

counter = 0
diff = abs(a - (t - h[0] * 0.006))

for x in h:
    average_temple = t - x * 0.006
    counter += 1
    if diff > abs(a - average_temple):
        poss = counter

print(poss)

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

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

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

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

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

h = list(map(lambda i, x: (t - x * 0.006, i), enumerate(h)))

h.sort()

print(h[0][1] + 1)

n = int(input())

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

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

h = list(map(lambda x: (abs(a - (t - x[1] * 0.006)), x[0]), enumerate(h)))

h.sort()

print(h[0][1] + 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 = list(map(int , input().split()))

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

Tlist =[]

for n in range(N):
	Tlist.append(T - H[n]*0.006)


t = Tlist[0]
m = None

for n in range(N):
	if abs(t-A) > abs(Tlist[n]-A):
		t = Tlist[n]
		m = n

M = m + 1
print(M)



N = int(input())

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

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

Tlist =[]

for n in range(N):
	Tlist.append(T - H[n]*0.006)

t = Tlist[0]
m = 0

for n in range(N):
	if abs(t-A) > abs(Tlist[n]-A):
		t = Tlist[n]
		m = n

M = m + 1
print(M)

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(float,input().split())

num = 0
pre = 100000
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(num)

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

num = 0
pre = A
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(i)

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

num = 0
pre = A
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(i)

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

num = 0
pre = A
for i in range(N):
    x = input()
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(i)

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

num = 0
pre = A
for i in range(N):
    x = float(input())
    ave = T - x*0.006
    if abs(A-ave)<pre:
        pre = abs(A-ave)
        num = i
print(num)

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

dis = []
for i in range(N):
    dis.append(abs(A-(T-H[i]*0.006)))
print(dis.index(min(dis))+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())
T,A=list(map(lambda x:float(A),input().split()))
H_list = list(map(lambda x:float(A),input().split()))
diff = [abs(T-x*0.006-A) for x in H_list]
i=diff.index(min(diff))
print(i+1)

N=int(input())
T,A=list(map(lambda x:float(x),input().split()))
H_list = list(map(lambda x:float(x),input().split()))
diff = [abs(T-x*0.006-A) for x in H_list]
i=diff.index(min(diff))
print(i+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())) 

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

if any(i <= 0 for i in list) :
    print(list.index(max(list)) + 1)
else :
    print(list.index(min(list)) + 1)

print(list)



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

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

if any(i < 0 for i in list) :
    print(list.index(max(list)) + 1)
else :
    print(list.index(min(list)) + 1)



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

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

print(list.index(min(list)))



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

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

print(list.index(min(list)))



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

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

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



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

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

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


Verdicts: Wrong Answer

Wrong Answer

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):
n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
Y = []
for i in range(n):
    tmp = t - H[i]*0.006
    Y.append(abs(tmp-a))
miny = Y[0]
for item in Y:
    miny = min(miny, item)
print(Y)
res = Y.index(miny)
print(res+1)

    

n = int(input())
t, a = map(int, input().split())
H = list(map(int, input().split()))
Y = []
for i in range(n):
    tmp = t - H[i]*0.006
    Y.append(abs(tmp-a))
miny = Y[0]
for item in Y:
    miny = min(miny, item)
res = Y.index(miny)
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 = map(int,input().split())
H = list(map(int,input().split()))
ans = 10**10
mean = 10**10
for i in range(len(H)):
    ans = i if A-(T-H[i]*0.006) < mean else ans
    mean = A-(T-H[i]*0.006) if A-(T-H[i]*0.006) < mean else mean
    print(i,A-(T-H[i]*0.006))
print(int(ans)+1)

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

n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
best = float("inf")
ind = 0
for i in range(n):
    temp = abs(a-(t- h[i]*0.006))
    print(temp)
    if temp < best:
        ind = i
        best = temp
print(ind+1)

n = int(input())
t,a = map(int, input().split())
h = list(map(int, input().split()))
ind , temp = 0, float("inf")
for i in range(n):
    x = abs(a-(t-h[i]*0.006))
    if x <= temp:
        ind = i
        temp = x
print(ind+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):
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)

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: 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 = [int(i) for i in input().split(' ')]
    H = [int(i) for i in input().split(' ')]
    minTemp = 600
    
    for i,h in enumerate(H):
        temp = T - h * 0.006
        if abs(temp-A) < minTemp:
            minTemp = abs(temp-A)
            place = i+1
    print(place)

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

for i,h in enumerate(H):
    temp = T - h * 0.006
    if abs(temp-A) < minTemp:
        minTemp = abs(temp-A)
        place = i+1
print(place)

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_t = 10000
ans = 0
for i in H:
  t = T - i * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    ans = i
print(i)

N = int(input())
T, A = map(int, (input().split(" ")))
H = list(map(int,input().split(" ")))
ans_t = 10000
ans = 0
 
for i in range(len(H)):
  t = T - H[i] * 0.006
  l = abs(A - T)
  if l < ans_t:
    ans_t = l
    ans = i
print(ans)

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

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

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):
from sys import exit
N = int(input())
T,A = [int(n) for n in input().split()]
H = [int(n) for n in input().split()]
mnear = 0
mint = (1 << 20)
for i in range(N):
    if abs(A - (T - H[i]*0.006)) < mint:
        mint = abs(A - (T - H[i])*0.006)
        mnear = i

print(mnear+1)
exit()


from sys import exit
N = int(input())
T,A = [int(n) for n in input().split()]
H = [int(n) for n in input().split()]
mnear = 0
mint = (1 << 20)
for i in range(N):
    # print(T - H[i]*0.006)
    if abs(A - (T - H[i]*0.006)) < mint:
        mint = abs(A - (T - H[i]*0.006))
        mnear = i

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

x = []

for i in h:
    b = t - 0.006 * j - a
    x.append(b)

print(x.index(min(x)))

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

x = []

for i in h:
    b = abs(t - 0.006 * i - a)
    x.append(b)

print(x.index(min(x)) + 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=[abs(A-(T-i*0.006)) for i in map(int,input().split())]
print(H)
print(H.index(min(H))+1)

N=int(input())
T,A=map(int,input().split())
H=[abs(A-(T-i*0.006)) for i in map(int,input().split())]
print(H.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=map(int,input().split())
h=[]
for i in rrange(n):
    tmp=int(input)
    c=t-tmp*0.006
    h.append(abs(a-c))

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m)


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

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m)


n=int(input())
t,a=map(int,input().split())
h=[]
tmp=input()
lst=tmp.split(' ')

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

m=0
for i in range(1,n):
    if(h[i]<h[m]):
        m=i
print(m+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 = 10**4
for i in range(N):
    ans = min(ans, abs(A - T + H[i]*0.006))
print(ans)


N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
minDiff = 10**4
for i in range(N):
    if minDiff > abs(A - T + H[i]*0.006):
        ans = i
        minDiff = abs(A - T + H[i]*0.006)
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())
hl=list(map(int,input().split()))
gap=abs(a-(t-hl[0]*0.006))
print(gap)
city=1
for i in range(2,n+1):
    temp_gap=abs(a-(t-hl[i-1]*0.006))
    print(i,temp_gap)
    if temp_gap<gap:
        gap=temp_gap
        city=i
print(city)

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


mn=abs(a-(t-hl[0]*0.006))
temp=[]
for i in range(n):
    mn=min(mn,abs(a-(t-hl[i]*0.006)))
    temp.append(abs(a-(t-hl[i]*0.006)))

print(temp.index(mn)+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()))
k = []
for i in h:
  k.append(abs(t - a - i * 0.006))
print(hh.index(min(k))+1)

n = int(input())
t,a = map(int,input().split())
h = list(map(int, input().split()))
k = []
for i in h:
  k.append(abs(t - a - i * 0.006))
print(k.index(min(k))+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())
tmp=input().split()
T=int(tmp[0])
A=int(tmp[1])
H=input().split()
H=[abs(A-(T-0.006*int(H[i]))) for i in range(0,N)]
min=H[0]
for i in range(1,N):
    if min>H[i]:
        min=H[i]
        index=i
print(index)

N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
idx=0
min=abs(A-T+H[0]*0.006)
for i in range(2,len(H)):
  tmp=T-H[i]*0.006
  dist=abs(A-tmp)
  if min > dist:
    min=dist
    idx=i
print(idx+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=input().split()
b=input().split()
n=int(n)
t=int(t)
a=int(a)
min=1000
for i in range(n):
     diff=abs(a-t+0.006*int(b[i]))
     id=i+1 if min>diff else id
print(id)

n=input()
t,a=input().split()
h=[]
n=int(n)
t=int(t)
a=int(a)
b=input().split()
min=1000
for i in range(n):
     b[i]=int(b[i])
     if min > abs(a-t+0.006*b[i]):
          min=abs(a-t+0.006*b[i]))
          id=i+1
print(id)

n=input()
t,a=input().split()
n=int(n)
t=int(t)
a=int(a)
b=input().split()
min=1000
for i in range(n):
    diff=abs(a-t+0.006*int(b[i]))
    if min>diff:
        id=i+1
        min=diff

print (id)


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

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

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

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

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

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

Verdicts: Wrong Answer

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 = list(map(int,input().split()))
H = list(map(int,input().split()))
MinDif = 1000
for i in range(N):
  Temp = T - H[i] * 0.006
  if abs(Temp - A) == min( MinDif, abs(Temp - A) ):
    MinDif = abs(Temp - A)
    ans = i
print(ans)

N = int(input())
T,A = list(map(int,input().split()))
H = list(map(int,input().split()))
MinDif = 1000
for i in range(N):
  Temp = T - H[i] * 0.006
  if abs(Temp - A) == min( MinDif, abs(Temp - A) ):
    MinDif = abs(Temp - 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):
N = int(input())
T, A = map(int, input().split())
height = list(map(int, input().split()))
temperature = [abs(T - i * 0.006) for i in height]
print(temperature.index(min(temperature)) + 1)

N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
t = [abs(T - i * 0.006 - A) for i in h]
print(h.index(min(t)) + 1)

N = int(input())
T, A = map(int, input().split())
height = list(map(int, input().split()))
temperature = list(abs(T - i * 0.006) for i in height)
print(temperature.index(min(temperature)) + 1)

N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
t = [abs(T - i*0.006-A) for i in h]
print(t.index(min(t)) + 1)

Verdicts: 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 = abs(a - (t - h[0] * 0.006))
ans = 0
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        ans = i + 1

print(ans)

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

res = abs(a - (t - h[0] * 0.006))
ans = 1
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        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 numpy as np

N = int(input())

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

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

H = T - H * 0.006
ans = np.abs(A - H)
ans = np.where(ans == ans.min())[0][0]

print(ans)

import numpy as np

N = int(input())

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

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

H = T - H * 0.006
ans = np.abs(A - H)
ans = np.where(ans == ans.min())[0][0] + 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()))
min=2000
ans = 0
for j in range(n):
    if abs(a-t+0.006*l[j]) < min:
        ans=j+1
print(ans)

n = int(input())
t,a = map(int, input().split())
l = list(map(int, input().split()))
min=2000
ans = 0
for j in range(n):
    if abs(a-t+0.006*l[j]) < min:
        min = abs(a-t+0.006*l[j])
        ans=j+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 = [int(num) for num in input().split()]
H = [int(num) for num in input().split()]

best_diff = None
best_height = None
for h in H:
    avg_tmp = T - h * 0.006
    diff = abs(A - avg_tmp)

    print(diff)

    if best_diff is None:
        best_diff = diff
        best_height = h
    elif diff < best_diff:
        best_diff = diff
        best_height = h
    else:
        pass

print([i for i, val in enumerate(H, 1)
       if val == best_height][0])


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

best_diff = None
best_height = None
for h in H:
    avg_tmp = T - h * 0.006
    diff = abs(A - avg_tmp)

    if best_diff is None:
        best_diff = diff
        best_height = h
    elif diff < best_diff:
        best_diff = diff
        best_height = h
    else:
        pass

print([i for i, val in enumerate(H, 1)
       if val == best_height][0])


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

n = int(input())
t, a = map(int, input().split())
*h, = map(int, input().split())
calc_diff = lambda x: abs(a - (t - x * 0.006))
*hdif, = map(calc_diff, h)
ans = hdif.index(min(hdif)) + 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()))
ans = 0
min_diff = abs(T- max(H)*0.006)
for i in range(N):
  temp = T - H[i]*0.006
  if abs(A-temp) < min_diff:
    ans = i+1
    min_diff = A-temp
print(ans)

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

n, t, a, *h = map(int, open(0).read().split())
ans = 0
diff_a = float('inf')
for i in range(n):
    if diff_a > abs(a - (t - h[i] * 0.006)):
        ans = i+1
        diff_a = abs(a - (t - h[i] * 0.006))
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):
from operator import itemgetter

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

L = []
for i in range(N):
    L.append([i+1,abs(T-H[i]*0.006)])
L = sorted(L, key=itemgetter(1))

print(L[0][0])


from operator import itemgetter

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

L = []
for i in range(N):
    L.append([i+1,abs(T-H[i]*0.006-A)])
L = sorted(L, key=itemgetter(1))

print(L[0][0])


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())
lst = [ abs((t - i * 0.006)-a) for i in list(map(int, input().split()))]
print(lst.index(min(lst)))

n = int(input())
t, a = map(int, input().split())
lst = [ abs((t - i * 0.006)-a) for i in list(map(int, input().split()))]
print(lst.index(min(lst)) + 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):
a=int(input())
b,c=input().split()
b=int(b)
c=int(c)
l=list(map(int,input().split()))
for i in range(a):
  l[0]==abs(c-(b-l[0]*0.006))
for i in range(a):
  if l[i]==min.l
  print(i)

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

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

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


N = int(input())
T, A = 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: 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(map(int, input().split()))
T_H = [T - h*0.006 for h in H]
diff = [abs(A-t) for t in T_H]
print(diff.index(min(diff)))

N = input()
T, A = map(int, input().split())
H = list(map(int, input().split()))
T_H = [T - h*0.006 for h in H]
diff = [abs(A-t) for t in T_H]
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):
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)

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

f = lambda x:t-x*0.006

tmp = list(map(f,h))

MIN = 500000000000000000000
idx = 0

for i in range(len(tmp)):
    if abs(tmp[i]-a)<MIN:
        print(i, tmp[i])
        MIN = abs(tmp[i]-a)
        idx = i+1

print(idx)

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

f = lambda x:t-x*0.006

tmp = list(map(f,h))

MIN = 500000000000000000000
idx = 0

for i in range(len(tmp)):
    if abs(tmp[i]-a)<MIN:
        MIN = abs(tmp[i]-a)
        idx = i+1

print(idx)

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 = float('inf')
idx = None
for i in range(len(H)):
    if min > abs(A - T + H[i] * 0.006):
        idx = i + 1

print(idx)

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

min = float('inf')
idx = None
for i in range(len(H)):
    if min > abs(A - T + H[i] * 0.006):
        idx = i + 1å

print(i)

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

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

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

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())
H=list(map(int,input().split()))
temp=[abs(T-x*0.0006-A) for x in H]
print(temp.index(min(temp)) + 1)

n=int(input())
T, A = map(int,input().split())
H=list(map(int,input().split()))
temp=[abs(T-x*0.006-A) for x in H]
print(temp.index(min(temp)) + 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):
# ABC 113: B – Palace
n = int(input())
t, a = [int(s) for s in input().split()]
h = [int(s) for s in input().split()]
difference = [abs(a - (t - i * 0.006)) for i in h]

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

# ABC 113: B – Palace
N = int(input())
T, A = map(int, input().split())
H = [int(s) for s in input().split()]

diff = [abs(T - h * 0.006 - A) for h in H]
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):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

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

import numpy as np

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

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

Verdicts: Runtime Error

Accepted