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()))
minimu = 1234567890

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

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

n=int(input())
t,a=map(int,input().split())
h=[[abs(t-x*0.006-a)]for x in map(int,input().split())]
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):
import numpy

N,M=map(int,input().split())
P=[]
Y=[]
for _ in range(M):
    data=[int(_) for _ in input().split()]
    P.append(data[0])
    Y.append(data[1])

y=[]
for x in range(1,N+1):
    for m in range(M):
        if P[m]==x:
            y.append(Y[m])

    ind=numpy.array(y)
    ind=ind.argsort()
    for i,k in enumerate(y):
        Y[Y.index(k)]=ind[i]+1
    y=[]

for x in range(M):
    xx=str(P[x])
    yy=str(Y[x])
    print(xx.zfill(6)+yy.zfill(6))


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

for i,h in enumerate(H):
    H[i]=abs(T-h*0.006-A)

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 = [int(i) for i in input().split()]

n = 0
for i in range(N):
    if abs(A - (T - H[i] * 0.006) > abs(A - (T - H[n] * 0.006):
       n = i

print(n + 1)

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

n = 0
for i in range(N):
    if abs(A - (T - H[i] * 0.006) > abs(A - (T - H[n] * 0.006):
       n = i

print(n + 1)

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

n = 0
for i in range(N):
    if abs(A - (T - H[i] * 0.006)) > abs(A - (T - H[n] * 0.006)):
       n = i

print(n + 1)

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

n = 0
for i in range(N):
    if abs(A - (T - H[i] * 0.006) > abs(A - (T - H[n] * 0.006):
       n = i

print(n + 1)

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

n = 0
for i in range(N):
    if abs(A - (T - H[i] * 0.006)) < abs(A - (T - H[n] * 0.006)):
       n = i

print(n + 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()))
mylist=[]

for i in range (N):
  C=12-H[i]*0.006
  D=A-C
  mylist.append(D)
E=mylist.index(max(mylist))
F=E+1
print(F)

N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
mylist=[]
for i in range (N):
  C=T-H[i]*0.006
  D=abs(A-C)
  mylist.append(D)
E=mylist.index(min(mylist))
F=E+1
print(F)

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())))
z = abs(T-H*0.006)
while z 



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

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
for i in range(n):
    h[i]=abs(t-h[i]*0.006-a)
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):
# -*- coding: utf-8 -*-
n = list(map(int, input().split(' '))).pop();
t,a = list(map(int, input().split(' ')));
h = list(map(int, input().split(' ')));

re = 1000000
index = 0

for i in range(n):
    t0 = t - h[i] * 0.006
    diff = a - t0
    if ( diff < re ):
        re = diff
        index = i

print(i+1)

# -*- coding: utf-8 -*-
n = list(map(int, input().split(' '))).pop();
t,a = list(map(int, input().split(' ')));
h = list(map(int, input().split(' ')));

re = 1000000
index = 0

for i in range(n):
    t0 = t - h[i] * 0.006
    diff = abs(a - t0)
    if ( diff < re ):
        re = diff
        index = i

print(index + 1)

Verdicts: Wrong Answer

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

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

ans=[INF,INF]

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

N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
INF=float('inf')
ans=[INF,INF]

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

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

ans=[]
for i in h:
    temp=t-a-0.006*i
    if temp <0:
        ans.append(temp*-1)
    else:
        ans.append(temp)

mi=ans[0]
num=-1
for j, i in enumerate(ans):
#    print(j,i)
    #print(mi, i)
    if mi > i:
        mi=i
        num=j

print(num+1)


n=int(input())

[t, a]=[int(i) for i in input().split()]

h=[int(i) for i in input().split()]

ans=[]
for i in h:
    temp=t-a-0.006*i
    if temp <0:
        ans.append(temp*-1)
    else:
        ans.append(temp)

mi=ans[0]
num=0
for j, i in enumerate(ans):
    if mi > i:
        mi=i
        num=j

print(num+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())
li = list(map(int,input().split()))
tmp = 0
ans_no = 1
ans_val = abs(t - (li[0] * 0.006))
print("test",ans_val)
for i in range(1,len(li)):
    tmp = abs(t - (li[i] * 0.006))
    if ans_val > tmp:
        ans_val = tmp
        ans_no = i + 1
print(ans_no)


n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
tmp = 0
ans_no = 1
ans_val = abs(a - (t - (li[0] * 0.006)))
for i in range(1,len(li)):
    tmp = abs(a - (t - (li[i] * 0.006)))
    if ans_val > tmp:
        ans_val = tmp
        ans_no = i + 1
print(ans_no)


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

result = 0
min_dif = 10000
for i in range(N):
  dif = abs(A, T - HS[i] * 0.0060 )
  if dif < min_dif:
    min_dif = dif
    result = i
print(result)

N = int(input())
T, A = map(int, input().split())
HS = list(map(int, input().split()))
 
result = 1
min_dif = 10000
for i in range(N):
  dif = abs(A - (T - HS[i] * 0.0060))
  if dif < min_dif:
    min_dif = dif
    result = i + 1
print(result)

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=int(input())
A=int(input())
"候補地の標高"
H=[]
for i in range(N):
    H.append(int(input()))


def abs_1(x):
    return abs(A-(T-x*0.006))

abslists=list(map(abs_1,H))

print(abslists)

print(min(abslists))

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

def abs_1(x):
    return abs(A-(T-x*0.006))
N=int(input())
T=int(input())
A=int(input())
H=[]
for i in range(N):
    H.append(int(input())) 
abslists=list(map(abs_1,H))
print(abslists.index(min(abslists))+1)

N=int(input())
T=int(input())
A=int(input())

def abs_1(x):
    return abs(A-(T-x*0.006))

H=[]
for i in range(N):
    H.append(int(input()))
abslists=list(map(abs_1,H))

print(abslists)

print(min(abslists))

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

N=int(input())
T=int(input())
A=int(input())
"候補地の標高"
H=[]
for i in range(N):
    H.append(int(input()))


def abs_1(x):
    return abs(A-(T-x*0.006))

abslists=list(map(abs_1,H))
print(abslists.index(min(abslists))+1)

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

Verdicts: 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):
def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    
    
    for z in titen :
        titen1.append(abs(z))
    
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1
 
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000 * 1000
    for x in ls_H :
        do = 1000 * T - x * 6
        dosi.append(do)
    
    
    for y in dosi :
        ti = 1000 * A - y
        titen.append(ti)
    
    
    for z in titen :
        titen1.append(abs(z))
    
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1
 
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()


import sys
 
def solve(N, T, A, ls_H):
    return min([(abs(A - (T - h * 0.006)), i) for (i, h) in enumerate(ls_H, start=1)])[1]
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()


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 = []
for i in range(N):
  H.append(input())

l = []
for i in range(N):
    l.append(abs(A - (T - 0.006 * H[i])))
print(l.index(min(l))+1)

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

l = []
for i in range(N):
    l.append(abs(A - (T - 0.006 * H[i])))
print(l.index(min(l))+1)

Verdicts: Runtime Error

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

Submission attempts (in order):
#B
N = int(input())
T, A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
#print(N, T, A)#
#print(H)#

def dif(h):
    return abs(T - h*0.006 - A)

neari = 0
nearDif = dif(H[0])
for i in range(N):
    #print(i, H[i])#
    idif = dif(H[i])
    if idif<nearDif:
        neari = i
        nearDif = idif
        #print(i, nearDif)
print(i+1)



#B
N = int(input())
T, A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
print(N, T, A)#
print(H)#

def dif(h):
    return abs(T - h*0.006 - A)

neari = 0
nearDif = dif(H[0])
for i in range(N):
    print(i, H[i])#
    idif = dif(H[i])
    if idif<nearDif:
        neari = i
        nearDif = idif
        print(i, nearDif)
print(i+1)



#B
N = int(input())
T, A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
#print(N, T, A)#
#print(H)#

def dif(h):
    return abs(T - h*0.006 - A)

neari = 0
nearDif = dif(H[0])
for i in range(N):
    #print(i, H[i])#
    idif = dif(H[i])
    if idif<nearDif:
        neari = i
        nearDif = idif
        #print(i, nearDif)
print(neari+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):
def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))
    arr = []
    ondo = 0
    for i in range(N):
        ondo = int(T - H[i] * 0.006)
        arr.append([ondo, i+1])
    for j in range(1, N):
        res1 = A - arr[j-1][0]
        res2 = A - arr[j][0]
        if res1 < res2:
            ans = arr[j-i][1]
        else:
            ans = arr[j][1]
    print(ans)
main(

def main():
    N = int(input())
    TA = list(map(int, input().split()))
    T, A = TA[0], TA[1]
    H = list(map(int, input().split()))

    temp1 = abs(A - (T - H[0] * 0.006))
    pos = 0

    for i in range(1, N):
        temp2 = abs(A - (T - H[i] * 0.006))
        if temp1 > temp2:
            temp1 = temp2
            pos = i
    print(pos+1)

if __name__  == '__main__':
    main()


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 = -1
for i in range(n):
  temp = t
  if abs(a - temp) >= abs(a - (t - h[i]* 0.006)):
    ans = i + 1
    temp = t - h[i]* 0.006
print(ans)

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


N=int(input())
T,A=map(int,input().split())
List=list(map(int,input().split()))
a=[]
for i in range(N):
    a.append(abs(T-List[i]*0.006-A))
print(a.index(min(a))+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()))

min_diff_t = 10e6
ans = 0

for i, e in enumerate(h):
    d = abs(a - (t - 0.006 * e))

    if d < min_diff_t:
        ans = i + 1

print(ans)


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

min_diff_t = 10e6
ans = 0

for i, e in enumerate(h):
    ti = t - 0.006 * e
    d = abs(a - ti)

    if d < min_diff_t:
        min_diff_t = 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=list(map(int,input().split()))
H=list(map(int,input().split()))
L=list()

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


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

for i in range(H):
  Ave_temparature=abs(float(a)-float(t-H[i]*0.006))
  L.append(Ave_temparature)
  
print(min(L))

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

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



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

for i in range(H):
  Ave_temparature=abs(float(a)-float(t)-float(H[i])*0.006)
  L.append(Ave_temparature)
  
print(min(L))


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

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

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

for i in range(H):
  Ave_temparature=abs(float(a)-(float(t)-float(H[i])*0.006))
  L.append(Ave_temparature)
  
print(min(L))


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

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


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

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


Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

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

for i in range(n):
    s.append(abs(a-t+i*0.006))

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

n = int(input())
t,a = map(int,input().split())
s = []
f = 1
for i in range(1,n+1):
    h = int(input())
    d = int(abs(a-t-h*0.006))
    s.append(d)
    if d == min(s):
       f = i
print(f)


n = int(input())
a,t = map(int,input().split())
s = 0
t = 1
for i in range(1,n+1):
    h = int(input())
    if a-t-h*0.006 <= s:
        t = i 
print(i)   

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

Verdicts: Wrong Answer

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 = list(map(int, input().split()))
min_err = 10000
num = -1
for i in range(N):
    temperture = T-H_list[i]*0.006
    err = abs(A - temperture)
    print(err)
    if err < min_err:
        min_err = err
        num = i
print(num+1)

N = int(input())
T, A = map(int, input().split())
H_list = list(map(int, input().split()))
min_err = 10000
num = -1
for i in range(N):
    temperture = T-H_list[i]*0.006
    err = abs(A - temperture)
    if err < min_err:
        min_err = err
        num = i
print(num+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()))
dH =[]
for i in H:
    dH.appendabs((A - T + 0.006 * i))
min_dH = min(dH)
print(dH.index(min_dH) + 1)

N = int(input())
T, A= map(int, input().split())
H = list(map(int, input().split()))
dH =[0]
for i in range(N):
    dH[i] = A + 0.006 * H[i]
min_dH = min(dH)
print(dH.index(min_dH) + 1)

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

result = 0
min = 0

for i, target in enumerate(targets):
  temp = int(int(T) - int(target) * 0.006)
  temp2 = abs(int(A) - int(temp))
  print(int(A))
  print(temp)
  print(temp2)
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
  
print(result)


N = input()
T, A = map(int, input().split())
targets = list(map(int, input().split()))
 
result = 0
min = 0
 
for i, target in enumerate(targets):
  temp = T - target * 0.006 
  if i == 0:
    result = i + 1
    min = abs( A - temp )
  elif abs( A - temp ) < min :
    result = i +1 
    min = abs( A - temp )
 
print(result)

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

h = np.array(h, dtype = float)
h = t - 0.006 * h
h = abs(a-h)
print(np.argmin(h))







import numpy as np

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

h = np.array(h, dtype = float)
h = t - 0.006 * h
h = abs(a-h)
print(np.argmin(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_list= list(map(int,input().split()))
maxi = 10**5+51
ans = 0
for i in H_list:
    if abs(A-T+0.006*i) <= maxi :
        maxi = abs(A-i)
        ans = H_list.index(i)
print(ans+1)

n = int(input())
T,A = map(int,(input().split()))
H_list= list(map(int,input().split()))
maxi = 10**5+51
ans = 0
for i in H_list:
    if abs(A-T-0.006*i) < maxi :
        maxi = abs(A-i)
        ans = H_list.index(i)
print(ans+1)

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

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

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = A - (T - 0.006*n)
    if diff < diff_min:
        diff = diff_min
        diff_i = i + 1

print(diff_i)


import math

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

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = math.fabs(A - (T - 0.006*n))
    if diff < diff_min:
        diff = diff_min
        diff_i = i + 1

print(diff_i)


import math

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

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = math.abs(A - (T - 0.006*n))
    if diff < diff_min:
        diff = diff_min
        diff_i = i + 1

print(diff_i)


import math

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

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = math.fabs(A - (T - 0.006*n))
    if diff < diff_min:
        diff_min = diff
        diff_i = i + 1

print(diff_i)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
k=[]
for i in range(0,n):
    k.append([h[i],i+1])
k.sort()
print(k)
s=(t-a)/(6*(10**(-3)))
for i in range(1,n):
    if s-k[i][0]<0:
        if abs(s-k[i][0])>abs(s-k[i-1][0]):
            print(k[i-1][1])
            break
        else:
            print(k[i][1])
            break

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
k=[]
for i in range(0,n):
    k.append([h[i],i+1])
k.sort()
s=(t-a)/(6*(10**(-3)))
for i in range(1,n):
    if s-k[i][0]<0:
        if abs(s-k[i][0])>abs(s-k[i-1][0]):
            print(k[i-1][1])
            break
        else:
            print(k[i][1])
            break

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()))
TH = []
for i in n:
  TH.append(abs(T-int(T-0.006*H[i])))
print(TH.index(min(TH))+1)

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

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())
height = [int(input()) for i in range(N)]
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
print(min(subduction)) 


n = int(input())
t,a = map(int,input().split())
height = [int(input()) for i in range(N)]
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
print(min(subduction)) 

N = int(input())
t,a = map(int,input().split())
height = list(map(int,input().split()))
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
ans = float(10**7)
lst = []
for i in range(N):
  if ans > subduction[i]:
    ans = subduction[i]
    lst.append(i)
print(lst[-1])
  


N = int(input())
t,a = map(int,input().split())
height = list(map(int,input().split()))
subduction = [float(abs(t-height[i]*0.006-a)) for i in range(N)]
ans = float(10**7)
lst = []
for i in range(N):
  if ans > subduction[i]:
    ans = subduction[i]
    lst.append(i)
print(lst[-1]+1)
  


Verdicts: 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())
t,a = (int(x) for x in input().split())
b = list(map(int,input().split()))
c = []

for i in b:
  c.append(abs((t - i * 0.006))-a)
  
print(c.index(min(c))+1)

n = int(input())
t,a = (int(x) for x in input().split())
b = list(map(int,input().split()))
c = []

for i in b:
  c.append(abs((t - i * 0.006)-a))
  
print(c.index(min(c))+1)


Verdicts: Wrong Answer

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

Submission attempts (in order):
input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
n = 1
for i in range(len(a)):
    if abs(T-0.006*i-A) <= min_val:
        min_val = abs(T-0.006*i-A)
        min_num = n
    n += 1
print(min_num)

input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
for i in range(len(a)):
    print("min_val={}".format(min_val))
    if abs(T-0.006*a[i]-A) <= min_val:
        min_val = abs(T-0.006*a[i]-A)
        min_num = i
print(min_num+1)

input()
T,A = map(int,input().split())
a = list(map(int,input().split()))
min_val = T-A
for i in range(len(a)):
    print("min_val={}".format(min_val))
    if abs(T-0.006*a[i]-A) <= min_val:
        min_val = abs(T-0.006*a[i]-A)
        min_num = i
print(min_num+1)

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

Verdicts: Wrong Answer

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 = 0
min_diff = 10*5
for i in range(N):
  if abs((T - H*0.006) - A) < min_diff:
    ans = i+1
    min_diff = abs((T - H*0.006) - A)
print(ans)


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

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


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

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

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

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


Verdicts: 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())
line = input().split()
t = int(line[0])
a = int(line[1])
temps = map(int,input().split())
temps = list(temps)
places = {}
count = len(temps)
for i in range(count):
  places[i] = abs(a - (t - 0.006 * temps[i]))
answer = min(places.items(),key = lambda x:x[1])[0]
print(answer)

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

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

memo = 10**5
for i in range(n):
    if (t-h[i]*0.006) < memo:
        ans = i+1
print(ans)

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

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

Verdicts: Wrong Answer

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+i*0.006
    if m>abs(b):
        m=abs(b)
        k=i+1


print(k)     

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+i*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)        
        

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+h[i]*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)        
        

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

k=0
m=100000000000000
for i in range(1,n+1):
    b=a-t+h[i-1]*0.006
    if m>abs(b):
        m=abs(b)
        k=i


print(k)        
        

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: A country decides to build a palace.  In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.  There are N places proposed for the place. The elevation of Place i is H_i meters.  Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.  Print the index of the place where the palace should be built.  It is guaranteed that the solution is unique.

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

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

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

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

s=li.append(abs(A-(T-0.006*H)))

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

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


Verdicts: Runtime Error

Accepted