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: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split())
li = list(map(int, input().split()))
x = 55
ind = 0
for i in li:
    mean = t - li[i] * 0.006
    sa = abs(mean - a)
    if sa < x:
        x = sa
        ind = i + 1
print(ind)

Submission status: Runtime Error

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

L = [abs(A-(T-i*0.006)) for i in H]
print(L.index(min(L)+1))

Submission status: Runtime Error

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

ans_num = 1
ans_para = h[0]
for i, r in enumerate(h):
    deg = t - (r * 0.006)
    ans_para_deg = t - (ans_para * 0.006)
    if abs(a - ans_para_deg) >= abs(a - deg):
        ans_para = r
        ans_num = i+1
print(ans_num

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
import numpy as np
for i in range(n):
  h[i] = abs( a - (t - h[i] * 0.006))
print(np.armmin(h) + 1)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(float, input().split())
h = list(map(float, input().split()))
import numpy as np
for i in range(n):
  h[i] = abs( a - (t - h[i] * (-0.006)))
print(np.armmin(h) + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

diff_a = list(map(lambda h: int(abs(a - t + h * 0.006)), hs))
ans = 100_000
result = -1
for i in range(n):
    if diff_a[i] <= ans:
        result = i + 1
        ans = diff_a[i]

print(result)

Submission status: Runtime Error

Solution code:

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

diff_a = list(map(lambda h: int(abs(a - t + h * 0.006)), hs))
ans = 100_000
result = -1
for i in range(n):
    if diff_a[i] <= ans:
        result = i + 1
        ans = diff_a[i]

print(result)

Submission status: Runtime Error

Solution code:

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

diff_a = list(map(lambda h: int(abs(a - t + h * 0.006)), hs))
print(diff_a)
ans = 100_000
result = -1
for i in range(n):
    if diff_a[i] <= ans:
        result = i + 1
        ans = diff_a[i]

print(result)

Submission status: Runtime Error

Solution code:
l = [abs(a-(t-i*0.006)) for i in h]
print(l.index(min(l))+1)

Submission status: Runtime Error

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

dt = 10**9
num = 0
for i in range(n):
  ti = t = hl[i]*0.006
  if abs(a - ti) <= dt:
    dt = abs(a -ti)
    num = i
    
    
print(num + 1)

Submission status: Runtime Error

Solution code:
#潜 影 蛇 手 ! !
N=int(input())
T,A=pin()
c=(T-A)/0.006
HH=[abs(h-c) for h in pin()]
#print(c,HH)
print(HH.index(min(HH))+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

place = 0
diff_min = 0

for cnt, t in enumerate(temp):
  if abs(T-t) < diff_min:
    diff_min = abs(T-t)
    place = cnt

print(place)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + h[0] * 0.006)
for i in range(N):
  d = T - h[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

h = list(map(int, (input().split())))
min = abs(a - (t - h[i]*0.006))

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
d=[]
for i in range(len(s)-2):
	d.append(int(s[i:i+3]))
ans=[abs(j-753) for j in d]
print(min(ans))

Submission status: Runtime Error

Solution code:
n,t,a=int(input()),map(int,input().split())
h=list(map(int,input().split()))
print(min(h).index()+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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(a-(t-h[i]*6/1000))
print(ans.index(min(ans))+1)

Submission status: Runtime Error

Solution code:
row=int(input())
T,A=map(int,input().split())
a = list(map(int,input().split()))
ans=10000000000000000000000
for i in range(row):
    ans=min(ans,A-T+.006*a[i])
print(a.index(int((ans-A+T)/.006))+1)

Submission status: Runtime Error

Solution code:
row=int(input())
T,A=map(int,input().split())
a = list(map(int,input().split()))
ans=1000000000000
for i in range(row):
    ans=min(ans,A-T+.006*a[i])
print(a.index(int((ans-A+T)/.006))+1)

Submission status: Runtime Error

Solution code:
row=int(input())
T,A=map(int,input().split())
a = list(map(int,input().split()))
ans=100
for i in range(row):
    ans=min(ans,A-T+.006*a[i])
print(a.index(int((ans-A+T)/.006))+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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(abs(a)-abs(t−h[i]×0.006)))
print(ans.index(min(ans)+1)

Submission status: Runtime Error

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(a-abs(t−h[i]×0.006))
print(min(ans))

Submission status: Runtime Error

Solution code:
import math

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

pointID = -1
min_diff = math.inf

for i in range (N):
    #地点i の温度 と 平均気温の差(絶対値)
    diff = abs(T - 1000 * H[i] - A)

    if diff < min_diff:
        pointID = i+1
        min_diff = diff

print(pointID)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

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

elev_counted =[abs((T-x*0.006)-A) for x in map(int,input().split())]
print(np.argmin(elev_counted)+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=map(int, input().split())
H=list(map(int, input().split()))
tmin = 10000000
for i in range(N):
  if tmin < (T - H[i] * 0.006):
    ans = i+1
    tmin = T - H[i] * 0.006
print(ans)

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define int ll
#define double long double
#define YES {cout<<"YES"<<'\n';}
#define NO {cout<<"NO"<<'\n';}
#define Yes {cout<<"Yes"<<'\n';}
#define No {cout<<"No"<<'\n';}
#define yes {cout<<"yes"<<'\n';}
#define no {cout<<"no"<<'\n';}
void YN(bool flg){cout<<(flg?"YES":"NO")<<'\n';}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<'\n';}
void yn(bool flg){cout<<(flg?"yes":"no")<<'\n';}
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define out(n) {cout << n << '\n';}
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VI> VVI;
const int MOD = 1000000007;
const long long INF = 10e10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
int POW(int a, int n) { int r = 1; while (n > 0) { if (n & 1)r *= a; a *= a; n /= 2; }return r; }
int isPrime(int n){if(n<2){return 0;}for(int i=2; i*i<=n; i++){if(n%i==0){return 0;}}return 1;}
/*素因数分解*/map< int, int >prime_factor(int n){map< int, int > ret;for(int i = 2; i * i <= n; i++) {while(n % i == 0) {ret[i]++;n /= i;}}if(n != 1) ret[n] = 1;return ret;}
/*約数列挙*/vector<int> divisor(int n){vector<int> v; for(int i=1; i*i<=n; i++){if(n%i==0){v.push_back(i);if(i!=n/i){v.push_back(n/i);}}}sort(v.begin(),v.end()); return v;}
//----------------ライブラリとか----------------

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(15);

    int n,t,a; cin >> n >> t >> a;
    VI h(n); REP(i,n) cin >> h[i];
    //hをxに近づける
    int x = 6*(t-a)/1000;
    int ans , tmp = INF;
    REP(i,n){if(tmp>abs(h[i]-x)){tmp=abs(h[i]-x); ans=i+1;}}
    out(ans);

    return 0;
}

Submission status: Runtime Error

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

ans_l = []

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


ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")

Submission status: Runtime Error

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

ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)
 
ans_mini = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_mini:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")

Submission status: Runtime Error

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

ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.append(ans)
 
ans_min = min(ans_l)

ans_posi =[]

for h in range(N):
    if ans_l[h] == ans_min:
        ans2 = h+1
        ans_posi.append(ans2)


for j in ans_posi:
    print(j,end="")

Submission status: Runtime Error

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

ans_l = []

for i in range(N):
    mater = H[i]
    Temp = (T - (mater*0.006))
    ans = abs(A - Temp)
    ans_l.apped(ans)

ans_min = min(ans_l)

print(ans_l.count(ans_min))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N = int(input())
T, A = map(int, input().split())
Hs = [int(H) for H in input().split()]
min_diff = math.inf
ans = 0
for i, H in enumerate(Hs):
    T_at_H = T - H*0.006
    diff = abs(A - T_at_H)
    if diff < min_diff:
        min_diff = diff
        ans = i + 1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
"""
author : halo2halo
date : 25,Oct,2019
"""

import sys
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline().rstrip())
T, a = map(int, readline().rstrip().split())
lis = list(map(int, readline().rstrip().split()))
cnt = 100000
for num, area in enumerate(lis):
    res = abs(T * 1000 - area * 6 - a * 1000)
    if res <= cnt:
        cnt = res
        ans = num


print(ans+1)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
a=[A-(T-H[i]*0.006) for i in range(0,N) if A-(T-H[i]*0.006)>=0]
b=[A-(T-H[i]*0.006) for i in range(0,N) if A-(T-H[i]*0.006)<0]
if a==[]:
  c=max(b)
elif b==[]:
  c=min(a)
elif min(a)>=-max(b):
  c=max(b)
else:
  c=min(a)
print(H.index((T-A+c)/0.006)+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

res = 200
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

print(ans + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

diff = [0]*len(nums)

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

sa = 60
for i in range(n):
    if sa > a - (t - array[i] * 0.006):
        sa = a - (t - array[i] * 0.006)
        ans = i + 1

print(ans)

Submission status: Runtime Error

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

sa = 60
for i in range(n):
    if sa > a - (t - array[i] * 0.006):
        sa = a - (t - array[i] * 0.006)
        ans = i

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input())
before=math.fabs(t-h[0]*0.006-a)
print(before)
mi=0
for i in range(n-1):
    diff=before-math.fabs(t-h[i+1]*0.006-a)
    if diff>0:
       before=math.fabs(t-h[i+1]*0.006-a)
       mi=i+1
print(mi)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input())
before=math.fabs(t-h[0]*0.006-a)
mi=0
for i in range(n-1):
    diff=before-math.fabs(t-h[i+1]*0.006-a)
    if diff>0:
       before=math.fabs(t-h[i+1]*0.006-a)
       mi=i+1
print(mi)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input())
before=math.fabs(t-h[0]*0.006-a)
mi=0
for i in range(n-1):
    diff=before-math.fabs(t-h[i+1]*0.006-a)
    if diff<0:
       mi=i+1
print(mi)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input())
t_list=[]
for i in range(n):
    math.fabs(t-h[i]*0.006-a)
print(min(t_list))

Submission status: Runtime Error

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

Ts = T - Hs*0.006

Ts_A = np.abs(Ts - A)

print(np.argmin(Ts_A))

Submission status: Runtime Error

Solution code:
N=int(input())
T,A=map(int,input().split())
H=(list(map(int,input().split())))
z = abs(T-H*0.006)
while z

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int,input().split())
def calc(A):
  return((T - A) / 0.006)

H = list(map(int,input().split()))
x = calc(A)
ans=x
for i in range(N):
  if abs(H[i] - x) < abs(ans):
    ans = H[i] - x
    
ans = int(ans + x)
print(H.index(ans))

Submission status: Runtime Error

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

minT = 50

for i in range(N):
  aveT = T - H[i] * 0.006
  minT = min(minT, abs(aveT - A))
  #print(minT)
  if minT == abs(aveT - A):
    ans = i + 1
    
print(ans)

Submission status: Runtime Error

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

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

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

print(min_i+1)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-                                                                              

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

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

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

print(min_i+1)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
t = 999 #平均気温とAとの最短の差
p = 0 #その差を記録したポイント
for i in range(H):
  if t > abs(A - T - H[i]*0.006):
    t = abs(A - T - H[i]*0.006)
    p = i+1
print(p)

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
h=map(int,input().split())
x=100000
ans=0
for i in h:
  if abs(t-i*0.006-a)<x:
    ans=index(i)
print(ans)

Submission status: Runtime Error

Solution code:
N = float(input())
T, A = map(float, input().split())
H = list(map(float, input().split()))
l = [i for i in H abs(T - i * 0.006)]

print(min(l))

Submission status: Runtime Error

Solution code:
N,M,X,Y=map(int, input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.apped(X)
y.apped(Y)
print('War' if max(x)>=min(y) else 'No War')

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split())
h = list(abs(t-0.006*int(x)-a), t for x, t in zip(input().split(), range(n)))
k = min(h)
print(k[1])

Submission status: Runtime Error

Solution code:
# https://atcoder.jp/contests/abc113/tasks/abc113_b


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

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

min_diff = temp(T, H[0], A)
answer = 0
for i in range(1, N):
    diff = temp(T, H[i], A)
    if diff < min_diff:
        answer = i
        min_diff = diff
print(answer)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from numpy import ndarray, argmin

input()
temp_on_sea, oracle = map(int, input().rstrip("\n").split())
heights = ndarray(list(map(lambda x: abs(int(x) - oracle) , input().rstrip("\n").split())))

print(heights.argmin() + 1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

min_i = 1001
min_t = 50

for i,p in enumerate(h):
    t = T - h * 0.006
    diff = abs(A-t)
    if min_t >= diff:
        min_i = i+1
        min_t = diff

print(min_i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    [T, A] = string_to_int(inputs[1])
    H = string_to_int(inputs[2])

    min_diff = -1
    min_diff_i = -1
    for i, h in enumerate(H):
        t = T - h * 0.006
        diff = abs(A-t)
        if min_diff == -1 or diff < min_diff:
            min_diff = diff
            min_diff_i = i
    return min_diff_i


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Runtime Error

Solution code:
import math


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

print(okok)

Submission status: Runtime Error

Solution code:

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

t=list(map(lambda h: temp-h*0.006, hs))
t=list(enumerate(t,1))

def solve(best,a,t):
    if not t:
        return best[0]
    if abs(best[1] - a) < abs(t[0][1] - a):
        return solve(best, a, t[1:])
    else:
        return solve(t[0],a,t[1:])

print(solve(t[0],a,t[1:]))

Submission status: Runtime Error

Solution code:

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

t=list(map(lambda h: t-h*0.006, hs))
t=list(enumerate(t,1))

def solve(best,a,t):
    if not t:
        return best[0]
    if abs(best[1] - a) < abs(t[0][1] - a):
        return solve(best, a, t[1:])
    else:
        return solve(t[0],a,t[1:])

print(solve(t[0],a,t[1:]))