Problem:


Score: 200 points

Problem Statement

A country decides to build a palace.

In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.

There are N places proposed for the place. The elevation of Place i is H_i meters.

Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.

Print the index of the place where the palace should be built.

It is guaranteed that the solution is unique.

Constraints

1 \leq N \leq 1000

0 \leq T \leq 50

-60 \leq A \leq T

0 \leq H_i \leq 10^5

All values in input are integers.

The solution is unique.

Input

Input is given from Standard Input in the following format:

N
T A
H_1 H_2 ... H_N

Output

Print the index of the place where the palace should be built.

Sample Input 1

2
12 5
1000 2000

Sample Output 1

1

The average temperature of Place 1 is 12-1000 \times 0.006=6 degrees Celsius.

The average temperature of Place 2 is 12-2000 \times 0.006=0 degrees Celsius.

Thus, the palace should be built at Place 1.

Sample Input 2

3
21 -11
81234 94124 52141

Sample Output 2

3



Sample input:
2
12 5
1000 2000


Sample output:
1

Submission status: Wrong Answer

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

min = 99999
ans = 99999

for i in range(n):
    tmp = t - hs[i] * 0.006
    d = abs(a-tmp)
    print(d < min , d, min)
    if d < min:
        ans = i
        min = d

print(ans+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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



min = 99999
ans = 99999

for i in range(n):
    tmp = t - hs[i] * 0.006
    if abs(a-tmp) < min:
        ans = i
        min = abs(a-tmp)

print(i+1)

Submission status: Wrong Answer

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



min = 99999
ans = 99999

for i in range(n):
    tmp = t - hs[i] * 0.006
    if abs(a-tmp) < min:
        ans = i
        min = abs(a-tmp)

Submission status: Wrong Answer

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



min = 99999
ans = 99999

for i in range(n):
    tmp = t - hs[i] * 0.006
    if abs(a-tmp) < min:
        ans = i

print(i+1)

Submission status: Wrong Answer

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

m = h[0]
ans = 1
for i in range(len(h)):
    if h[i] < m:
        m = h[i]
        ans = i + 1


print(h)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m = h[0]
ans = 1
for i in range(len(h)):
    if h[i] < m:
        m = h[i]
        ans = i + 1


print(ans)

Submission status: Wrong Answer

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

tmp = 100
i = 0
for index, h in enumerate(H):
    ond = T - h * 0.006
    diff = abs(ond - A)
    if diff < tmp:
        tmp = diff
        i = index + 1

print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

min_diff = 9999999
min_cnt = 0
for c, h in enumerate(H):
    diff = A - (T - h * 0.006)
    if min_diff >= diff:
        min_diff = diff
        min_cnt = c + 1

print(min_cnt)

Submission status: Wrong Answer

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

min_diff = 9999999
min_cnt = 0
for c, h in enumerate(H):
    diff = A - (T - h * 0.006)
    if min_diff > diff:
        min_diff = diff
        min_cnt = c + 1

print(min_cnt)

Submission status: Wrong Answer

Solution code:
import numpy as n
I=lambda:map(int,input().split())
N=I()
T,A=I()
print(n.argmin(abs(T-i*0.006-A)for i in I())+1)

Submission status: Wrong Answer

Solution code:
#coding:utf-8

def diff_A_temperature(T, A, x):
    H_T = T - x
    diff_A = abs(H_T - A)

    return diff_A

def main():
    N = input()
    T, A = map(int, input().split())
    H_list = [int(i) for i in input().split()]
    H_diff_list = [diff_A_temperature(T, A, H) for H in H_list]
    print(H_diff_list.index(min(H_diff_list)) + 1)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#coding:utf-8

def ask_temperature(T, x):
    H_T = T - (x * 0.006)
    return H_T

def main():
    N = input()
    T, A = map(int, input().split())
    H_list = [int(i) for i in input().split()]
    H_T_list = [ask_temperature(T, H) for H in H_list]
    print(H_T_list.index(max(H_T_list)) + 1)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

temp = 10 ** 5
result = 0
for i in range(N):
    h = int(T - (H[i] * 0.006) - A)
    if h < 0:
        h = -h
    if temp > h:
        temp = h
        result = i+1
print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np
import copy
import sys

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

def temp(t, x):
	return t-x*0.006

num_max=-np.inf; arg_max=-1
for i in range(N):
	if (num_max < temp(T, H[i])):
		num_max = temp(T, H[i])
		arg_max = i+1
print(arg_max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

def solve(N, T, A, ls_H):
    temperature= []
    difference = []
    near = []
    ti = 10**5//1
    
    for x in ls_H :
        air = T - x * 0.006
        temperature.append(air)
    #print(temperature)
    
    for y in temperature :
        subtraction = A -y
        difference.append(subtraction)
    #print(difference)
    
    for z in difference : 
        near.append(abs(z))
    #print(near)
    
    for i in near :
        ti = i
    #print(ti)
    return near.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()

Submission status: Wrong Answer

Solution code:
import sys

def solve(N, T, A, ls_H):
    temperature= []
    difference = []
    near = []
    ti = 10**5//1
    
    for x in ls_H :
        air = T - x * 0.006
        temperature.append(air)
    #print(temperature)
    
    for y in temperature :
        subtraction = A -y
        difference.append(subtraction)
    #print(difference)
    
    for z in difference : 
        near.append(abs(z))
    print(near)
    
    for i in near :
        ti = i
    #print(ti)
    return near.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()

Submission status: Wrong Answer

Solution code:
import sys

def solve(N, T, A, ls_H):
    temperature= []
    difference = []
    near = []
    ti = 10**5//1
    
    for x in ls_H :
        air = T - x * 0.006
        temperature.append(air)
    #print(temperature)
    
    for y in temperature :
        subtraction = A -y
        difference.append(subtraction)
    #print(difference)
    
    for z in difference : 
        near.append(abs(z))
    print(near)
    
    for i in near :
        ti = i
    #print(ti)
    return near.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()

Submission status: Wrong Answer

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

X = T-A
Min = abs(X - int(H[0] * 0.006))
Num = 0
for i in range(1,N):
  temp = abs(X - int(H[i] * 0.006))
  if Min > temp:
    Min = temp
    Num = i
print(Num+1)

Submission status: Wrong Answer

Solution code:
import sys
 
def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 1000000
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(abs(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()

Submission status: Wrong Answer

Solution code:
N = int(raw_input())
T, A = map(int, raw_input().split())
H = list(map(int, raw_input().split()))
difH = 10**5
ai = 0
for i, h in enumerate(H):
    d = abs(A - (T - h * 0.006))
    print(d)
    if d < difH:
        difH = d
        ai = i+1
print(ai)

Submission status: Wrong Answer

Solution code:
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
    if a<0 and tt < 0:
        a,tt = abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
print(ind+1)

Submission status: Wrong Answer

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

min=100000000000000
min_index=n+1
for i in range(len(h)):
  v = abs(t - h[i]*0.006)
  if v < min:
    min=v
    min_index=i
print(min_index+1)

Submission status: Wrong Answer

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

min=100000000000000
min_index=n+1
diff = t-a
for i in range(len(h)):
  v = abs(diff-h[i])
  if v < min:
    min=v
    min_index=i
print(min_index+1)

Submission status: Wrong Answer

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

min=100000000
min_index=100
diff = t-a
for i in range(len(h)):
  v = abs(diff-h[i])
  if v < min:
    min=v
    min_index=i
print(min_index+1)

Submission status: Wrong Answer

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

print(int(min( abs(t-h_i*0.006-a) for h_i in h )))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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
    if (a-tt) < mxt:
        mxt = a-tt
        ind = i
print(ind+1)

Submission status: Wrong Answer

Solution code:
import sys

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)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    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()

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=[int(i) for i in input().split()]
H=[int(i) for i in input().split()]
T=[]
for i in H:
  ti=abs(t-i*0.006-a)
  T.append(ti)
m=min(T)
i=T.index(m)
print(i)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=[int(i) for i in input().split()]
H=[int(i) for i in input().split()]
T=[]
for i in H:
  ti=t-i*0.006-a
  T.append(ti)
m=min(T)
i=T.index(m)
print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
T,A = map(int,input().split())
h = list(map(int,input().split()))
#iは番号
ans = 0
base = T - 0.06*h[0]
for i,n in enumerate(h):
    if(i==0):
        pass
    tem = T - 0.006*n
    if(abs(tem - A)<abs(base - A)):
        base = tem
        ans = i+1
    else:
        ans = 1
print(ans)

Submission status: Wrong Answer

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

place = 1
closest = abs(T - H[0]*0.006)

for i in range(1,N):
    temperature = abs(T-H[i]*0.006)
    if temperature < closest:
        place = i + 1
        closest = temperature

print(place)

Submission status: Wrong Answer

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

place = 1
closest = abs(T - H[0]*0.006)

for i in range(1,N):
    if abs(T-H[i]*0.006) < closest:
        place = i + 1

print(place)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

p = 0
ans = 9999999999
for i in range(n):
    at = t - h[i]*0.006
    print(abs(at-a))
    if(abs(at-a) < ans):
        ans = abs(at-a)
        p = i

print(p)

Submission status: Wrong Answer

Solution code:
## ABC 113 b

n = int(input())
t, a = (int(_) for _ in input().split())
h = [int(_) for _ in input().split()]

p = 0
ans = 2*t
for i in range(n):
    at = t - h[i]*0.006
    if(abs(at-a) < ans):
        ans = abs(at-t)
        p = i

print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

nearA=10000000
number=0
index=0
while index < len(listH):
    h = listH[index]
    if index ==0:
        nearA = max(t-h*0.0006, a)-min(t-h*0.006, a)
        number = index+1
    elif max(t-h*0.006, a)-min(t-h*0.006, a)< nearA:
        nearA = max(t-h*0.006, a)-min(t-h*0.006, a)
        number = index+1
    index+=1

print(number)

Submission status: Wrong Answer

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

nearA=10000000
number=0
index=0
while index < len(listH):
    h = listH[index]
    if index ==0:
        nearA = max(t-h*0.06, a)-min(t-h*0.06, a)
        number = index+1
    elif max(t-h*0.06, a)-min(t-h*0.06, a)< nearA:
        nearA = max(t-h*0.06, a)-min(t-h*0.06, a)
        number = index+1
    index+=1

print(number)

Submission status: Wrong Answer

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

nearA=10000000
number=0
index=0
while index < len(listH):
    h = listH[index]
    if max(t-h*0.06, a)-min(t-h*0.06, a)< nearA:
        nearA = max(t-h*0.06, a)-min(t-h*0.06, a)
        number = index+1
    index+=1

print(number)

Submission status: Wrong Answer

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

result = []

for j in range(n):
    calc = abs(T-H_list[j]-A)
    result.append (calc)

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

Submission status: Wrong Answer

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

    z = []
    for x in h:
        t_x = abs(a - x * 0.006)
        z.append(t_x)

    ans = z.index(min(z)) + 1
    print(ans)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
candidate_num = int(input())
temperature_str = input()
temperature_list = temperature_str.split()
temperature_base = int( temperature_list[0] )
temperature_ideal = int( temperature_list[1] )
candidate_list_str = input() 
candidate_list = candidate_list_str.split()

candidate = int(candidate_list[0])
candidate_temperature = temperature_base - int(candidate*0.006)
answer = 1
diff = abs(temperature_ideal - candidate_temperature)
for i in range( 1, len( candidate_list) ):
    candidate = int(candidate_list[i])
    candidate_temperature = temperature_base - int(candidate*0.006)
    if  abs(temperature_ideal -  candidate_temperature) < diff:
        diff = abs(temperature_ideal - candidate_temperature)
        answer = i+1
    


print(answer)

Submission status: Wrong Answer

Solution code:
def ABC113B():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))
    for i in range(N):
        H[i] ==  T - H[i] * 0.006
    ansT = 1000000000
    ansN = 0
    for i in range(N):
        if abs(H[i] - A) <= ansT:
            ansT = abs(H[i] - A)
            ansN = i
    print(ansN + 1)
ABC113B()

Submission status: Wrong Answer

Solution code:
candidate_num = int(input())
temperature_str = input()
temperature_list = temperature_str.split()
temperature_base = int( temperature_list[0] )
temperature_ideal = int( temperature_list[1] )
candidate_list_str = input() 
candidate_list = candidate_list_str.split()

answer = 0
diff = -1
for i in range( len(candidate_list) ):
    candidate = int(candidate_list[i])
    candidate_temperature = abs(temperature_base - int(candidate*0.006))
    if diff == -1:
        diff = abs(temperature_ideal - candidate_temperature)
        answer = i+1
    elif  abs(temperature_ideal -  candidate_temperature) < diff:
        diff = abs(temperature_ideal - candidate_temperature)
        answer = i+1
    


print(answer)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = 2
T,A = 12,5
H = np.array([1000, 2000])
H = np.abs(T - H*0.006 -A)
print(np.argmin(H) +1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main02():
    buf = input("");
    val1 = int(buf);
    buf = input("");
    bufs = buf.split(" ");
    val2 = [];
    for i in range(len(bufs)):
        val2.append(int(bufs[i]));
    buf = input("");
    bufs = buf.split(" ");
    val3 = [];
    for i in range(len(bufs)):
        val3.append(int(bufs[i]));
    temp = val2[0] - val2[1];
    re = [];
    for i in range(len(val3)):
        re.append(abs(temp - val3[i]));
    resultval = min(re);
    result = re.index(resultval) + 1;
    print(result);




if __name__ == '__main__':
    main02()

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
T,A=map(int,input().strip().split())
H=list(map(int,input().strip().split()))
ANS=[]
for i in range(N):
    ANS.append(T-H[i]*0.006)
ANS.sort()
print(np.searchsorted(ANS,A))

Submission status: Wrong Answer

Solution code:
N = int(input())
T, A = (int(x) for x in input().split())
altitude_list = [int(x) for x in input().split()]
dif_list = list(map(lambda x: A - (T - x * 0.006), altitude_list))
print(dif_list.index(min(dif_list)) + 1)

Submission status: Wrong Answer

Solution code:
p = int(input())
q1,q2 = map(int, input().split())
r = list(map(int, input().split()))
for i in range(1, p+1):
  def t(i):
    return (q1 - (r[i-1] * 0.006))
  if(q2 - t(i) >= 0):
    if (i < p):
      if (abs(q2 - t(i+1)) >= abs(q2 - t(i))):
        print(i)
      elif (abs(q2 - t(i+1)) < abs(q2 - t(i))):
        print(i+1)
    elif (i == p):
      if (abs(q2 - t(p)) >= abs(q2 - t(p-1))):
        print(p-1)
      elif (abs(q2 - t(p)) < abs(q2 - t(p-1))):
        print(p)
  else:
    i = i + 1
    
t_p = q1 - (r[p-1] * 0.006)
if (t_p - q2) > 0:
  print(p)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3


if __name__ == "__main__":
    N = int(input())
    T,A = map(int, input().split())
    H = list(map(int, input().split()))
    def temp(h):
        return T - h * 0.006
    closest = 100000000000000
    ind = -1
    for i in range(len(H)):
        t = temp(H[i])
        dif = (abs(H[i] - A)) 
        if dif < closest:
            dif =  closest
            ind = i
    print(i+1)

Submission status: Wrong Answer

Solution code:
def calc_height(t, h):
    return t - h * 0.006

def calc_diff(a, h):
    if a > 0:
        if h > 0:
            return abs(a - h)
        else:
            return abs(a + abs(h))
    else:
        if h > 0:
            return abs(a - abs(h))
        else:
            return abs(a + h)

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

# 1st point set
ans = 1
diff_ans = calc_diff(a, calc_height(t, hs[0]))

# check all point
for i, h in enumerate(hs):
    diff_i = calc_diff(a, calc_height(t, h))
    if diff_i < diff_ans:
        diff = diff_i
        ans = i + 1

print (ans)

Submission status: Wrong Answer

Solution code:

N, = [int(x) for x in input().strip().split(" ")]
T, A = [int(x) for x in input().strip().split(" ")]
Hs = [int(x) for x in input().strip().split(" ")]

rs = []
for h in Hs:
    hh = A - (h * 0.006)
    rs .append(abs(T - hh))

rr = None
for i, r in enumerate(rs):
    if rr == None:
        rrr = i
        rr = r
        continue
    if r < rr:
        rrr = i
        rr = r
print(rrr + 1)

Submission status: Wrong Answer

Solution code:

N, = [int(x) for x in input().strip().split(" ")]
T, A = [int(x) for x in input().strip().split(" ")]
Hs = [int(x) for x in input().strip().split(" ")]

rs = []
for h in Hs:
    hh = A - (h * 0.6)
    rs .append(abs(T - hh))

rr = None
for i, r in enumerate(rs):
    if rr == None:
        rrr = i
        rr = r
        continue
    if r < rr:
        rrr = i
        rr = r
print(rrr + 1)

Submission status: Wrong Answer

Solution code:

N, = [int(x) for x in input().strip().split(" ")]
T, A = [int(x) for x in input().strip().split(" ")]
Hs = [int(x) for x in input().strip().split(" ")]

rs = []
for h in Hs:
    rs .append(abs(T - A - (h * 0.6)))

rr = None
for i, r in enumerate(rs):
    if rr == None:
        rrr = i
        rr = r
        continue
    if r < rr:
        rrr = i
        rr = r
print(rrr + 1)

Submission status: Wrong Answer

Solution code:
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 = int( T - target * 0.006 )
  temp2 = abs( A - temp )
  if i == 0:
    result = i + 1
    min = temp2
  elif temp2 < min :
    result = i +1 
    min = temp2
 
print(result)

Submission status: Wrong Answer

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

dif, m = float('inf'), 0
for i, x in enumerate(H):
    h = abs(A - (T - x) * 0.006)
    if dif > h:
        dif, m = h, i + 1
print(m)

Submission status: Wrong Answer

Solution code:
def calc_height(t, h):
    return int(t - h * 0.006)

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

# 1st point set
ans = 1
diff_ans = abs(a - calc_height(t, hs[0]))

# check all point
for i, h in enumerate(hs):
    diff_i = abs(a - calc_height(t, h))
    if diff_i < diff_ans:
        diff = diff_i
        ans = i + 1

print (ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- 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)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
t,a = map(int,input().split())
hight = list(map(int, input().split()))
ans = 100000
ansnumber = 0
num = 1
for i in hight:
    tmp = math.fabs(a -(t-i*0.006))
    if ans > tmp:
         ans = tmp
         ansnumber = num
         num = num + 1
print(ansnumber)

Submission status: Wrong Answer

Solution code:
# -*- 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)

Submission status: Wrong Answer

Solution code:
import numpy as np
import functools

def calc_temp(t, x):
    return (t - x * 0.006)

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

T_H = []
for i in range(len(H)):
    T_H.append(calc_temp(T, H[i]))

list_A = [A] * N

#print(T_H)
#print(list_A)

diff_T_H_array = np.array(T_H) - np.array(list_A)
diff_T_H = diff_T_H_array.tolist()
#print(diff_T_H)
min_index = diff_T_H.index(max(diff_T_H)) + 1
print(min_index)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    C = 0.006
    N = int(input())
    T, A = map(int, input().split())
    H_list = map(int, input().split())

    t_list = map(lambda x: int(T - C * x), H_list)
    abs_list = list(map(lambda x: abs(x - A), t_list))
    print(abs_list.index(min(abs_list)) + 1)

Submission status: Wrong Answer

Solution code:
N = input()
TandA = raw_input().split(" ")
High = raw_input().split(" ")
T = int(TandA[0])
A = int(TandA[1])
length = []
for x in High:
    length.append(A - (T - int(x) * 0.006))
print length.index(min(length)) + 1

Submission status: Wrong Answer

Solution code:
def calc_height(t, h):
    return (t - h) * 0.006

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

ans = 1
diff = abs(calc_height(t, int(hs[0])))
for i, h in enumerate(hs):
    if calc_height(t, int(h)) < diff:
        ans = i + 1

print (ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
import math
num=[]
ans=float("inf")
for i in range(n):
    num.append(t-0.006*h[i])
for i in range(n):
    temp=int(math.sqrt((h[i]-a)**2))
    if temp<ans:
        ans=temp
        cnt=i+1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
import math
num=[]
ans=float("inf")
for i in range(n):
    num.append(t-0.06*h[i])
for i in range(n):
    temp=int(math.sqrt((h[i]-a)**2))
    if temp<ans:
        ans=temp
        cnt=i+1
print(cnt)

Submission status: Wrong Answer

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