peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a,b,c=map(int, input().split())

print("YES" if c>=a and c<=b else "NO")
# Judge status: Accepted
N = int(input())
n = N
if N % 2 == 1: # 奇数のときは偶数がかけられていないので0は並ばない．
    print(0)
else:
    # 1回分は割り算しておく．最初に2で割ることによって1,2,3,4,5,6,7,8...という数列の積になる．
    cnt = N // 10
    N //= 10
    while N > 0:
        cnt += N // 5
        N //= 5
    print(cnt)
# Judge status: Accepted
s = input()
n = len(s)
ans = 0
for i in range(n):
  if s[i]!=s[n-1-i]:
    ans+=1
print(ans//2)
# Judge status: Wrong Answer
import itertools
x = int(input())

if x >= 2500:
    print(1)
    exit()

cnt = 0
for i in range(1, 20):
    for v in itertools.combinations_with_replacement([100, 101, 102, 103, 104, 105], i):
        if sum(v) == x:
            print(1)
            exit()
print(0)
# Judge status: Accepted
S = input()
T = input()
U = [[i,j] for i,j in zip(S,T)]
U.sort()
s = U[0][0]
t = U[0][1]
for i,j in U:
    if  i != s:
        s = i
        t = j
    elif j != t:
        print("No")
        exit()
U.sort(key=lambda x:x[1])
s = U[0][0]
t = U[0][1]
for i,j in U:
    if j != t:
        s = i
        t = j
    elif i != s:
        print("No")
        exit()
print("Yes")
# Judge status: Accepted
A, B = map(int, input().split())
S = input()
res = 'Yes'
if not S[:A].isdecimal() or not S[A+1:].isdecimal() or S[A] != '-':
    res = 'No'

print(res)
# Judge status: Accepted
from collections import deque
s=deque(list(input()))
q=int(input())
l = [list(input().split()) for i in range(q)]
c=0
for i in range(q):
  if l[i][0]=="1":
    c+=1
  elif c%2==0 and l[i][1]=="1":
    s.appendleft(l[i][2])
  elif c%2==0:
    s.append(l[i][2])
  elif c%2==1 and l[i][1]=="1":
    s.append(l[i][2])
  else:
    s.appendleft(l[i][2])
s=list(s)
if c%2==1:
  s=s[::-1]
print(*s, sep="")
# Judge status: Accepted
import sys
import math
input = sys.stdin.readline
H = int(input())
W = int(input())
N = int(input())
a = max(H,W)
print(math.ceil(N/a))
# Judge status: Wrong Answer
N, K = map(int, input().split(' '))
R, S, P = map(int, input().split(' '))
T = list(input())
print(T)
score = 0
A = T
for i in range(N-K):
  if T[i] == T[i+K]:
    A[i+K] = 'a'

for i in range(N):
  if A[i] == 'r':
    score += P
  elif A[i] == 's':
    score += R
  elif A[i] == 'p':
    score += S
print(score)
# Judge status: Wrong Answer
A, B = map(int, input().split())
count = 0
for x in range(A, B, 1):
    letter = str(x)
    if letter[0] == letter[4] and letter[1] == letter[3]:
        count += 1
print(count)
# Judge status: Accepted
S = list(input())

print("yes" if len(S) == len(set(S)) else "no")
# Judge status: Accepted
N = int(input())
L = list(map(int, input(). split()))
count = 0

for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            if (L[i] + L[j] > L[k])and(L[j] + L[k] > L[i])and(L[k] + L[i] > L[j])and(L[i] != L[j])and(L[j] != L[k])and(L[k] != L[i]):
                count += 1
            else:
                continue
print(count)
# Judge status: Accepted
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)
    
N=int(input())
A=list(map(int,input().split()))

ans = A[0]
for a in A:
    ans = gcd(ans,a)
print(ans)
# Judge status: Accepted
def main():
    N, K = map(int, input().split())
    P = list(map(int, input().split()))
    E = list(map(lambda x: (1+x)/2, P))
    tmp = sum(E[:K])
    ans = tmp
    for i in range(K, N):
        tmp += E[i] - E[i-K]
        ans = max(ans, tmp)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())
ans = M
A = set(list(map(int, input().split()))[1:])
for i in range(N-1):
  tmp = set(list(map(int, input().split()))[1:])
  A = A & tmp
print(len(A))
# Judge status: Accepted
N, M = map(int,input().split())
students = []
points = []
for _ in range(N):
    students.append(list(map(int,input().split())))
for _ in range(M):
    points.append(list(map(int,input().split())))

for i in range(N):
    MIN = 10 ** 10
    index = -1
    for j in range(M):
        if MIN > abs(students[i][0] - points[j][0]) + abs(students[i][1] - points[j][1]):
            MIN = abs(students[i][0] - points[j][0]) + abs(students[i][1] - points[j][1])
            index = j
    print(index + 1)
# Judge status: Accepted
a,b = map(int,input().split())
if (a>9) or(b>9):
  print(-1)
else:
  print(a*b)
# Judge status: Accepted
a=input()
out=''
for i in range(len(a)):
  out+='x'
print(out)
# Judge status: Accepted
a,b,c,d,e,f = input()

if c == d and e == f :
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b,x=map(int,input().split())
print("YES"if (a<=x)&(x<=a+b) else "NO")
# Judge status: Accepted
a, b = map(str, input().split())

n = int(a+b)
if (n**.5).is_integer():
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import deque

N, M = map(int, input().split())

rooms = [[] for _ in range(N)]

for _ in range(M):
    A, B = map(int, input().split())
    rooms[A - 1].append(B - 1)
    rooms[B - 1].append(A - 1)

signposts = [None] * N
que = deque([0])

while que:
    n = que.popleft()
    for room in rooms[n]:
        if signposts[room] is None:
            que.append(room)
            signposts[room] = n + 1

if None in signposts:
    print("No")
else:
    signposts[0] = "Yes"
    for s in signposts:
        print(s)
# Judge status: Wrong Answer
#%%
x = int(input())
sum=x
for i in range(3):
    sum+=pow(x,2)
print(sum)
# Judge status: Accepted
n=[int(c) for c in input()]

if sum(n)%9==0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
from collections import deque
def main():
  N,M,*A=map(int, open(0).read().split())
  mod=10**9+7
  dp = [0] * (N+1)
  A=deque(A+[N+1])
  tmp=A.popleft()
  dp[:2] = [1, 1 if tmp!=1 else 0]
  if tmp==1:
    tmp=A.popleft()
  for i in range(2, N+1):
    if i==tmp:
      tmp=A.popleft()
      continue
    dp[i] = (dp[i-2] + dp[i-1])%mod
  print(dp[N])
main()
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

isMax = False
while K > 0 and not isMax:
    isMax = True
    B = [0] * N
    for i, d in enumerate(A):
        l = max(0, i - d)
        B[l] += 1
        r = i + d + 1
        if r < N:
            B[r] -= 1
    for i in range(N - 1):
        isMax &= (B[i] >= N)
        B[i + 1] += B[i]
    A = B
    K -= 1

print(*A[:N])
# Judge status: Accepted
a, b, n = map(int, input().split())

temp_prev = 0
temp_curr = 0
x = min(n, b-1)

while x <= n:
    temp_prev = temp_curr
    temp_curr = int(a * x / b) - a * int(x / b)
    x += 1.0

    if temp_curr <= temp_prev:
        break

print(max(temp_curr, temp_prev))
# Judge status: Accepted
n, m, *d = open(0).read().split()
n, m = int(n), int(m)
r = range(n - m + 1)
print(["No","Yes"][any(d[n:] == [t[j:j+m] for t in d[i:i+m]] for i in r for j in r)])
# Judge status: Accepted
import sys

N, K, *X = map(int, sys.stdin.read().split())

ans = 10**20
for l, r in zip(X, X[K-1:]):
    if l*r < 0:
        dist = min(-2*l + r, 2*r - l)
    else:
        dist = max(abs(l), abs(r))
    if ans > dist:
        ans = dist
print(ans)
# Judge status: Accepted
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n = int(input())
    print(n+n**2+n**3)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
input=sys.stdin.readline
n,q=map(int,input().split())
s=input().rstrip()

lst=[0]
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        lst.append(lst[i-1]+1)
    else:
        lst.append(lst[i-1])

for i in range(q):
    l,r=map(int,input().split())
    print(lst[r-1]-lst[l-1])
# Judge status: Accepted
A, B = map(int, input().split())
if A <= 9 and B <= 9:
    print(A*B)
else:
    print(-1)
# Judge status: Accepted
N, M = map(int, input().split())
if N == M:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
l=int(input())
print(l*l*l/27)
# Judge status: Accepted
s=input()
ans=len(s)
for i in range(2):
  cnt=0
  for j in range(len(s)):
    if j % 2 == 0 and s[j]!=str(i): cnt+=1
    if j % 2 == 1 and s[j]==str(i): cnt+=1
  ans=min(cnt,ans)
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
# C - Multiple Gift
# 標準入力の取得
X,Y = list(map(int, input().split()))

# 求解処理
# Xをどんどん2倍していき、それがYを超えるまでやる
max_length = 0
while X <= Y:
    max_length += 1
    X *= 2

# 結果出力
print(max_length)
# Judge status: Accepted
n = int(input())
s = input()
ans = ''
for ss in s:
    a = ord(ss) - ord('A')
    a += n
    a %= 26
    c = chr(a + ord('A'))
    ans += c
print(ans)
# Judge status: Accepted
x=list(input().split())
for i in range(len(x)):
    if(x[i]=="0"):
        print(i+1)
# Judge status: Accepted
import sys
input = sys.stdin.readline

n, m = map(int, input().split())

wa = 0
marked = [0 for _ in range(n)]
cnt = [0 for _ in range(n)]

for i in range(m):
    x, s = map(str, input().split())
    x = int(x) - 1
    if s == "AC":
        if marked[x] == False:
            wa += cnt[x]
            marked[x] = True
    else:
        cnt[x] += 1

print(sum(marked), wa)
# Judge status: Wrong Answer
i = input()

i = int(i)

flg = False

while i != 0:
  check = i % 10
  if check == 7:
    flg = True
    break
  i = i / 10

if flg == True:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b = map(int, input().split())
a -= 2
b -= 2
if a % 14 > b % 14:
    print("Alice")
elif a % 14 < b % 14:
    print("Bob")
else:
    print("Draw")
# Judge status: Accepted
a,b,c,k=map(int,input().split())
ans=0
if k<a:
    ans+=k
elif k<a+b:
    ans+=a
elif k<=a+b+c:
    ans=ans+a-(k-a-b)
print(ans)
# Judge status: Accepted
n = int(input())
ansc = 0
ans = 0
if n == 1:
    print(1)
    exit()
for i in range(1,n+1):
    x = i
    cnt = 0
    while x % 2 == 0:
        cnt += 1
        x /= 2
        if cnt > ansc:
            ansc = cnt
            ans = i
print(ans)
# Judge status: Accepted
# a,b,cの袋の中のキャンディーの個数を整数で入力
a,b,c = map(int,input().split())
# 袋から出さずに2つの同じ数に分けられるならYes、ダメならNo
if a + b == c or a + c == b or b + c ==a:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
from fractions import gcd

NN = 202020
MOD = 10**9+7
INF = float("inf")

n = int(input())
min_time = n

for i in range(n):
    v6, v9 = i, n-i
    count = 0
    while v6 > 0:
        count += v6 % 6
        v6 //= 6
    while v9 > 0:
        count += v9 % 9
        v9 //= 9
    min_time = min(min_time, count)

print(min_time)
# Judge status: Accepted
import math
N,D=map(int,input().split())
X=[]
for i in range(N):
    x=list(map(int,input().split()))
    X.append(x)
res=0
for i in range(N-1):
    for j in range(i+1,N):
        dist=0
        for d in range(D):
            dist+=(X[i][d]-X[j][d])**2
        dist=math.sqrt(dist)
        if dist==int(dist):
            res+=1
print(res)
# Judge status: Accepted
D = input()
if D == "25":
    print("Christmas")
elif D == "24":
    print("Christmas Eve")
elif D == "23":
    print("Christmas Eve Eve")
else:
    print("Christmas Eve Eve Eve")
# Judge status: Accepted
n,k = map(int,input().split())
p = list(map(int,input().split()))
s = 0

p = sorted(p)
for i in range(k):
  s += p[i]
  
print(s)
# Judge status: Accepted
from decimal import *
a, b = map(Decimal, input().split())

print(int(a * b))
# Judge status: Wrong Answer
A,B,M  = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
t = [0] * M
x = [0] * M
y = [0] * M
for i in range(M):
    t[i], x[i], y[i] = map(int, input().split())

p=int()
q=int()
p=a[0]+b[0]
for i in a:
    for s in b: 
       #if i==:
        #else :
        q=i+s
        if q<p:
            p=q
print(p)
# Judge status: Accepted
N, M = map(int, input().split())
AB = [[int(i) for i in input().split()]for j in range(N)]
sortsecond = lambda val: val[0]
AB.sort(key=sortsecond)
ans = 0
c = 0
for ab in AB:
    if c+ab[1] <= M:
        ans += (ab[0] *ab[1])
        c += ab[1]
        continue
    else:
        while c != M:
            c += 1
            ans += ab[0] 
        break

print(ans)
# Judge status: Accepted
from fractions import gcd

n, m = [int(x) for x in input().split()]
a_list = [int(x) for x in input().split()]
a_h_list = [a // 2 for a in a_list]

count = set()
for a_h in a_h_list:
    temp = bin(a_h)
    count.add(len(temp) - temp.rfind("1"))

if len(count) == 1:
    temp = 1
    for a_h in a_h_list:
        temp *= a_h // gcd(a_h, temp)
    ans = (m // temp + 1) // 2
else:
    ans = 0

print(ans)
# Judge status: Wrong Answer
A, B, N = map(int, input().split())
Ymax=0

for i in range(N,N-B,-1):
  x = i+1
  Y = int(float(A)*float(x)/float(B)) - A * int(float(x)/float(B))
  if Y>Ymax:
    Ymax = Y
  print(x)
print(Ymax)
# Judge status: Accepted
n=int(input())
ans=10**n-2*(9**n)+8**n
ans=ans%1000000007
print(ans)
# Judge status: Wrong Answer
a=input().split()
pl1=int(a[0])
pl0=int(a[1])
pl_1=int(a[2])
draw=int(a[3])
#print(pl1,pl0,pl_1,draw)

if(pl1+pl0>=draw):
  print(pl1)
else:
  all_card=pl1+pl0+pl_1
  #print(all_card)
  draw_pl_1=all_card-draw
  #print(draw_pl_1)
  print(pl1-draw_pl_1)
# Judge status: Accepted
a = int(input())
ans = 0
i = 1
while i*i <= a:
  for j in range(1, 1000):
    if i**j <= a and ans < i**j:
      ans = i**j
    if i**j > a:
      break;
  i += 1
print(ans)
# Judge status: Wrong Answer
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

a,b = I()
ans = a*b
if a % 2== 0:
    print("Even")
else:
    print("Odd")
# Judge status: Accepted
input_data = input().split()
 
N = int(input_data[0])
R = int(input_data[1])
 
if N >= 10 :
  print(R)
else:
  print(R+100*(10-N))
# Judge status: Accepted
def main():
	N = int(input())
	A = list(map(int, input().split()))
	if 0 in A:
		print(0)
		return
	prod = 1
	for a in A:
		prod *= a
		if prod > 1000000000000000000:
			print(-1)
			return
	print(prod)
main()
# Judge status: Accepted
S, W = map(int, input().split())
if W >= S:
    ans = 'unsafe'
else:
    ans = 'safe'
print(ans)
# Judge status: Wrong Answer
x,n=map(int,input().split())

if n==0:
  print(x)
  
else:
  a=list(map(int,input().split()))

  for i in range(100):
    if x-i not in a:
      ans=x-1
      break
    if x+i not in a:
      ans=x+i
      break
    
  print(ans)
# Judge status: Accepted
import math
X = int(input())

def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

for i in range(10**7):
    if i < X:
        continue
    elif is_prime(i) is True:
        print(i)
        exit()
# Judge status: Wrong Answer
s = input()

for i in range(len(s)):
    if (i+1)% 2 == 0:
        if s[i] == "R":
            print("No")
            exit()
else:
    if s[i] == "L":
        print("No")
        exit()
print("Yes")
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
a = rl()
cnt = 0
for i in a:
    if i%4 == 0:
        cnt += 1
if math.ceil(n/3) <= cnt:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
a,b = map(int,input().split())
print(math.ceil((a + b)/2))
# Judge status: Accepted
import sys
input = sys.stdin.readline

x = int(input())
if x <= 599:
    print(8)
elif x <= 799:
    print(7)
elif x <= 999:
    print(6)
elif x <= 1199:
    print(5)
elif x <= 1399:
    print(4)
elif x <= 1599:
    print(3)
elif x <= 1799:
    print(2)
else:
    print(1)
# Judge status: Accepted
#!/usr/bin/env python3
def main():
    from bisect import bisect, bisect_left

    N = int(input())
    A = sorted([int(x) for x in input().split()])
    B = sorted([int(x) for x in input().split()])
    C = sorted([int(x) for x in input().split()])

    print(sum([bisect_left(A, b) * (N - bisect(C, b)) for b in B]))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s = input()

print(['x']*len(s))
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split())
t1 = h1 * 60 + m1
t2 = h2 * 60 + m2

print(t2-t1 - k)
# Judge status: Wrong Answer
x, k, d = map(int, input().split())
for i in range(k):
    if abs(x - d) > abs(x + d):
        x = x + d
    else:
        x = x - d
print(x)
# Judge status: Accepted
n = int(input())
mod = 10 ** 9 + 7
print((pow(10, n, mod) - pow(9, n, mod) * 2 + pow(8, n, mod)) % mod)
# Judge status: Accepted
n=int(input())
m = 0
i = 0
while 2**i <= n:
  m = max(m, 2**i)
  i += 1
print(m)
# Judge status: Wrong Answer
A, B = map(int, input().split())

if A%3 == 0 or B%3 == 0 or (A+B)%3 == 0:
  r = "possible"
else:
  r = "impossible"

print(r)
# Judge status: Wrong Answer
def solve(n, m, X):
    X.sort()
    distances = sorted(X[i] - X[i - 1] for i in range(1, m))
    return sum(distances[:m - n])

_n, _m = map(int, input().split())
_X = list(map(int, input().split()))
print(solve(_n, _m, _X))
# Judge status: Accepted
A, B, C, K = map(int, input().split())
print(min(K, A)-max(0, K-A-B))
# Judge status: Accepted
import math
N = int(input())
A = list(map(int,input().split()))

ans = 0
for a in range(N):
    ans = math.gcd(ans,A[a])
print(ans)
# Judge status: Accepted
s = list(input())
n = len(s)
k = int(input())

for i in range(n):
    if k > 0 and i == n-1:
        x = ord(s[i])-ord("a")
        s[i] = chr((k+x)%26+ord("a"))
        break
    if s[i] == "a":
        continue
    x = ord(s[i])-ord("a")

    if k >= 26-x:
        s[i] = "a"
        k -= 26-x
print(*s,sep="")
# Judge status: Accepted
w = input()
char = [chr(ord('a') + i) for i in range(26)]
for c in char:
    if w.count(c) % 2 != 0:
        print('No')
        break
else:
    print('Yes')
# Judge status: Accepted
n,m = list(map(int, input().split()))
x = list(map(int, input().split()))
x.sort()

total = max(x) - min(x)
if n >= m:
    print(0)
elif n == 1:
    print(total)
else:
    gap = []
    for i,j in zip(x, x[1:]):
        gap.append(j-i)
    gap.sort(reverse=True)
    print(total - sum(gap[:n-1]))
# Judge status: Accepted
n = int(input())

res = 0
for i in range(1, n+1):
    res += (i + i*(n//i)) * (n//i) // 2
print(res)
# Judge status: Wrong Answer
x, y, z=map(int, input().split())
print((x-y)//(y+z)+1)
# Judge status: Accepted
#141_D
import heapq
n,m=map(int,input().split())
a=list(map(lambda x:-1*int(x),input().split()))
heapq.heapify(a)
for _ in range(m):
    x=heapq.heappop(a)
    heapq.heappush(a,-(-x//2))
print(-sum(a))
# Judge status: Accepted
x, y = map(int, input().split())
count = 0
while x <= y:
    count += 1
    x *= 2
print(count)
# Judge status: Accepted
N = int(input())

cnt = 0
for i in range(1,N+1):
    if len(str(i)) % 2 == 1:
        cnt += 1

print(cnt)
# Judge status: Accepted
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
MOD = 10**9+7
N = int(readline())
if N == 1:
    print(0)
    sys.exit()
    
a = pow(10,N,MOD)
b = pow(9,N,MOD)
c = pow(8,N,MOD)

ans = ((a-b)*2%MOD - (a-c)%MOD) % MOD

print(ans)
# Judge status: Wrong Answer
a = input().split()
q = int(a[0]) * 4
h = int(a[1]) * 2
s = int(a[2])
t = int(min([q,h,s]))
d = int(a[3]) / 2
b = int(input())

if min([t,d]) == t:
  print(int(b * t))
else:
  if b % 2 == 0:
    print(int(b * d))
  elif b != 1:
    print(int((b-1) * d + t))
  else:
    print(t)
# Judge status: Wrong Answer
n, m = map(int, input().split())
points = [tuple(map(int, input().split())) for _ in range(n)]
points.sort(key=lambda x: x[1])

point = 0
while m > 0:
    if not points:
        break
    t, p = points.pop()
    if t <= m:
        point += p
        m -= 1

print(point)
# Judge status: Accepted
p=[2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b=map(int,input().split())
print('ABloibc e'[p.index(a)<p.index(b)::2] if a!=b else 'Draw')
# Judge status: Accepted
n = int(input())
a = map(int,input().split())
ans = "APPROVED"
for x in a:
  if x%2 == 0:
    if x%3 != 0 and x%5 != 0:
	    ans = "DENIED"
print(ans)
# Judge status: Accepted
n,k = map(int, input().split())
p = list(map(int, input().split()))

saikoro = [0] * 1001
for i in range(1, 1001):
    saikoro[i] = (saikoro[i-1] + i)

s = [0] * (n + 1)
for u in range(1,n + 1):
    s[u] = saikoro[p[u - 1]] / p[u - 1] + s[u - 1]

ans = 0
for j in range(k - 1,n):
    ans = max(ans, s[j + 1] - s[j + 1 - k])
 
print(ans)
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))
X = [x//400 for x in X]
min_X = len(set([x for x in X if x < 8]))
max_X = min_X + len([x for x in X if x >= 8])
# この max は気づかないなあ
print(max([min_X, 1]), max_X)
# Judge status: Accepted
import sys
n = int(sys.stdin.readline().rstrip())
if n%2:
    print(0)
else:
    ans = 0
    n //= 10
    while n > 0:
        ans += n
        n //= 5
    print(ans)
# Judge status: Accepted
a, b, x = map(int, input().split())

start = a if a % x == 0 else x * (a // x) + x
if b - start >= 0:
    ans = (b - start) // x + 1
else:
    ans = 0

print(ans)
# Judge status: Accepted
D, N = map(int, input().split())

if N == 100:
    print(101*100**D)
else:
    print(100**D * N)
# Judge status: Accepted
S = input()
if S == 'ABC':
  print('ARC')
else:
  print('ABC')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 1
up = False
down = False
for i in range(1, n):
    if up:
        if a[i] < a[i - 1]:
            up = False
            ans += 1
    elif down:
        if a[i] > a[i - 1]:
            down = False
            ans += 1
    else:
        if a[i] > a[i - 1]:
            up = True
        elif a[i] < a[i - 1]:
            down = True
print(ans)
# Judge status: Accepted
N=int(input())
print('ABC' if N<1000 else 'ABD')
# Judge status: Accepted
n=int(input());print(((n+1)//2)/n)
# Judge status: Accepted
n, k = map(int, input().split(" "))
h = list(map(int, input().split(" ")))
h = sorted(h)

if n > k:
    print(sum(h[0: n-k]))
if n <= k:
    print(0)
# Judge status: Wrong Answer
N,M = map(int,input().split())

glaf = [[] for i in range(N)]

for i in range(M):
    a,b = map(int,input().split())
    a=a-1
    b=b-1
    glaf[a].append(b)
    glaf[b].append(a)
    
print(glaf)
    
for i in glaf:
    cnt =0
    for j in i:
        cnt+=1
    
    print(cnt)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
sl = []

ma, mi = max(l), min(l)
if ma == mi:
  sl.append(0)

for x in range(mi, ma):
  s = 0
  for i in l:
    s += (i - x)**2 
  sl.append(s)

print(min(sl))
# Judge status: Accepted
s=input()

l=[]

for i in s:
  l.append(i)
new_l = l[::-1]

count=0
for a,b in zip(l,new_l):
  if a != b:
    count+=1
print(count//2)
# Judge status: Accepted
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
lis=[]
for i in range(1,m):
  lis.append(x[i]-x[i-1])
  
lis.sort()
res=0
for i in range(0,m-n):
  res+=lis[i]
print(res)
# Judge status: Accepted
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]
mod = 10**9+7
import math
s = I()
t = 0
ans = 0
for i in range(1,s+1):##iは数列の項の数
  if s - 3*i <0:
    continue
  else:
    t = s-3*i
    #玉の数がt個、仕切りの数がi-1個
    ans += math.factorial(i+t-1)//(math.factorial(t)*math.factorial(i-1))
    ans = ans%mod
print(ans)
# Judge status: Accepted
from math import log2, ceil

n, k = map(int, input().split())

chance =[0]*n


for firstDice in range(1, n+1):
    if firstDice >= k:
        chance[firstDice-1] = 1/n

    else:
        chance[firstDice-1] = 1/n * (1/2)**ceil(log2(k/firstDice))

print(sum(chance))