Harryxun/stf_run huggingface dataset:
N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
a.insert(0, 0)
C = 0
s = 0
t = 1
for i in range(1, N + 1):
    for l in range(t, N + 1):
        s += a[l]
        if s >= K:
            C += N - l + 1
            s -= a[i] + a[l]
            t = l
            break
    else:
        break
print(C)

### FIXED CODE ###

X, A = list(map(int, input().split()))
print(0 if X < A else 10)
INF = -1000000000000001

n = int(input())
l = list(map(int, input().split()))

a = int(n/2)

dpa = [[0]*(a+1) for i in range(n+1)]

dpa[0][0] = 0
dpa[1][0] = 0
dpa[1][1] = l[0]
j = 1
for i in range(2,n+1):
	if i == j*2:
		dpa[i][j] = max(dpa[i-2][j-1]+l[i-1],dpa[i-1][j])
#		print(i,j,dpa[i][j])
	else:
		dpa[i][j] = max(dpa[i-2][j-1]+l[i-1],dpa[i-1][j])
#		print(i,j,dpa[i][j])
		if (i != n):
			j += 1
#			print(i,j,dpa[i][j])
#			print("   ",i-2,j-1,dpa[i-2][j-1],"")
			dpa[i][j] = dpa[i-2][j-1]+l[i-1]

#print(dpa)
print(dpa[n][a])

### FIXED CODE ###

from collections import defaultdict
INF = -1000000000000001

n = int(input())
l = list(map(int, input().split()))

a = int(n/2)

dpa = defaultdict(lambda: -INF)
#dpa = [[0 for j in range(a+1)] for i in range(n+1)]

dpa[(0,0)] = 0
dpa[(1,0)] = 0
dpa[(1,1)] = l[0]
j = 1
for i in range(2,n+1):
	if i == j*2:
		dpa[(i,j)] = max(dpa[(i-2,j-1)]+l[i-1],dpa[(i-1,j)])
#		print(i,j,dpa[(i,j)])
	else:
		dpa[(i,j)] = max(dpa[(i-2,j-1)]+l[i-1],dpa[(i-1,j)])
#		print(i,j,dpa[(i,j)])
		if (i != n):
			j += 1
#			print(i,j,dpa[(i,j)])
#			print("   ",i-2,j-1,dpa[(i-2,j-1)],"")
			dpa[(i,j)] = dpa[(i-2,j-1)]+l[i-1]

#print(dpa)
print(dpa[n,a])
x, y = input().split(" ")
while():
    if alice() == False:
        print('Brown')
        break
    if brown() == False:
        print('Alice')
        break


def turn():
    a = 0
    if x < y or x == y:
        a = y / 2
        y = y - a * 2
        x = x + a
    else:
        a = x / 2
        y = x - a * 2
        x = y + a
    if a == 0:
        return False
    return True

def alice():
    return turn()

def brown():
    return turn()

### FIXED CODE ###

str = input()
strs = str.split(" ")
ans = ""
for str in strs:
    ans = ans+str[0].upper()
print(ans)
#encoding utf-8

n = int(input())
v = list(int(i) for i in input().split())


v_odd = []
v_even = []
for i in range(n):
    if i%2 == 0:
        v_odd.append(v[i])
    else:
        v_even.append(v[i])

#odd part
count={}
for i in range(len(v_odd)):
    if v_odd[i] in count.keys():
        count[v_odd[i]] += 1
    else:
        count[v_odd[i]] = 1

if len(count) == 1:
    pass
    # num_odd = 0
else:
    for k, v in sorted(count.items(), key=lambda x: -x[1]):
        pass
    keys = list(count.keys())
    # num_odd = len(v_odd)-int(count[keys[0]])
# print(num)

#even part
even_count={}

for i in range(len(v_even)):
    if v_even[i] in even_count.keys():
        even_count[v_even[i]] += 1
    else:
        even_count[v_even[i]] = 1

if len(even_count) == 1:
    pass
    # num += 0
else:
    for k, v in sorted(even_count.items(), key=lambda x: -x[1]):
        pass
    even_keys = list(even_count.keys())
    # num += len(v_even)-int(count[even_keys[0]])

if even_keys[0] == keys[0]:
    if len(keys) == 1 and len(even_keys) == 1:
        answer = int(len(keys))
    elif len(keys) == 1:
        answer = len(v_even)-int(v_even[even_keys[1]])
    elif len(even_keys) == 1:
        answer = len(v_odd)-int(v_odd[keys[1]])
    else:
        if int(v_even[even_keys[0]]) >= int(v_odd[keys[0]]):
            answer = len(v_odd)-int(count[keys[1]])
            answer += len(v_even)-int(even_count[even_keys[0]])
        else:
            answer = len(v_odd)-int(count[keys[0]])
            answer += len(v_even)-int(even_count[even_keys[1]])
print(int(answer))


### FIXED CODE ###

from collections import Counter
def main(n,v):
    # n = int(input())
    # v = list(map(int, input().split()))
    odd = Counter(v[0::2]).most_common(2) + [(0, 0)]
    even = Counter(v[1::2]).most_common(2) + [(0, 0)]

    n_half = int(n / 2)

    if (len(odd) == 1 and len(even) == 1) and odd[0][0] == even[0][0]:
        ans = n_half
    elif odd[0][0] == even[0][0]:
        ans = min(n_half - odd[0][1] + n_half - even[1][1],\
                n_half - odd[1][1] + n_half - even[0][1])
    else:
        ans = n_half - odd[0][1] + n_half - even[0][1]

    print(ans)
    return 0

if __name__ == "__main__":
    n = int(input())
    v = list(map(int, input().split()))
    main(n,v)
n, m = map(int, input().split())
stu = []
check = []
for i in range(n):
    stu.append(list(map(int, input().split())))

for i in range(m):
    check.append(list(map(int, input().split())))


ans = []

for i in range(n):
    dist = []
    for j in range(m):
        tmp = abs(stu[i][0] - check[j][0]) + abs(stu[i][1] - check[j][1])
        dist.append(tmp)
    mi = dist.index(min(dist))
    ans.append(mi)


for i in range(len(ans)):
    print(ans[i] + 1)

### FIXED CODE ###

a, b = map(int, input().split())
c = (a + b) % 24
print(c)
X,Y=map(int,input().split())

if 2*X<Y<4*X and (Y-2*X)%2==0 and (4*X-Y)%2==0:
    print("Yes")
elif (4*X-Y)/2==1 and (Y-2*X)/2==0:
    print("Yes")
elif (4*X-Y)/2==0 and (Y-2*X)/2==1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if var[0]==0:
    print(1)
elif var[1]==0:
    print(2)
elif var[2]==0:
    print(3)
elif var[3]==0:
    print(4)
elif var[4]==0:
    print(5)
def resolve():
    import math
    N = int(input())
    price = N/1.08
    reTaxprice = math.floor(math.floor(price)*1.08)
    if reTaxprice == N:
        print(ans)
    else:
        print(':(')
resolve()


### FIXED CODE ###

def resolve():
    import math
    N = int(input())
    price = N/1.08
    reTaxprice1 = math.floor(math.floor(price)*1.08)
    reTaxprice2 = math.floor(math.ceil(price)*1.08)
    if reTaxprice1 == N:
        print(math.floor(price))
    elif reTaxprice2 == N:
        print(math.ceil(price))
    else:
        print(':(')
resolve()
import sympy
        
N,P = map(int,input().split())
d = sympy.factorint(P)
ans=1
a=1
for k,v in d.items():
    a = k*(v//N)
    if a:
        ans *= a
print(ans)    

### FIXED CODE ###

def hoge(p):
    ret = {}
    pp = 2
    while pp * pp <= p:
        while p % pp == 0:
            ret[pp] = ret[pp]+1 if pp in ret else 1
            p //= pp
        pp += 1
    if p != 1: ret[p] = 1
    return ret

N,P=map(int,input().split())
if N==1:
    print(P)
elif P==1:
    print(1)
else:
    ans = 1
    ret = hoge(P)
    for p,e in ret.items():
        ans *= max(1, p**(e//N))
    print(ans)
def solve():
    a, b, c, d = map(int, input().split())
    
    x = c / b
    y = a / d


    if c % b == 0 and x - y <= 1:
        return 'Yes'
        

    return 'Yes' if x < y else 'No'

print(solve())

### FIXED CODE ###

def solve():
    N, M = map(int, input().split())

    return 'safe' if N > M else 'unsafe'

print(solve())
#https://atcoder.jp/contests/dp/tasks/dp_a
import math
N = int(input())
asiba = list(map(int,input().split()))
dp =[math.inf] *N

dp[0]=0
dp[1]=abs(asiba[1]-asiba[0])

for i in range(2,N):
    dp[i] = min(dp[i-2]+abs(asiba[i]-asiba[i-2]),dp[i])
    dp[i] = min(dp[i-1]+abs(asiba[i]-asiba[i-1]),dp[i])
print(dp[N-1])

### FIXED CODE ###

N = int(input())
asiba = list(map(int,input().split()))
dp =[10**10] *N

dp[0]=0
dp[1]=abs(asiba[1]-asiba[0])

for i in range(2,N):
    dp[i] = min(dp[i-2]+abs(asiba[i]-asiba[i-2]),dp[i])
    dp[i] = min(dp[i-1]+abs(asiba[i]-asiba[i-1]),dp[i])
print(dp[N-1])
n,x=map(int, input().split())
llist=list(map(int, input().split()))
point=0
cnt=0
while point<=x and cnt<=n:
  point+=llist[cnt]
  cnt+=1
print(cnt)


### FIXED CODE ###

n,x=map(int, input().split())
llist=list(map(int, input().split()))
point=0
cnt=1
for i in range(n):
  point+=llist[i]
  if(point<=x):
    cnt+=1
print(cnt)
def base_N(N,n,n_N):#N進数に変換
    if n==0:
        return int(n_N[::-1])
    else:
        n_N+=str(n%N)
        n=n//N
        return base_N(N,n,n_N)

def base_N_10(N,n):#N進数を10進数に変換
    n_10=0
    for i in range(len(str(n))):
        n_10+=int(str(n)[i])*N**(len(str(n))-i-1)
    return n_10



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

usable=[i for i in range(10)]
for number in dislike:
    usable.remove(number)

N=len(usable)
M=0
bit=0
num_s=''    
num_i=0



while 1:
    M+=1
    bit=str(base_N(N,M,''))
    for i in range(len(bit)):
        num_s+=str(usable[int(bit[i])])
    num_i=int(num_s)
    if num_i>=n:
        print(num_i)
        exit()
    else:
        num_s=''
        bit=0
        num_i=0

### FIXED CODE ###

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


while 1:
    for i in range(len(str(n))):
        if int(str(n)[i]) in dislike:
            break
        if i==len(str(n))-1:
            print(n)
            exit()
    n+=1
n,k = map(int, input().split())
w = {"A":"a", "B":"b", "C":"c"}
s = input().split()
print([i if i != k-1 else w[s[i]] for i in len(s)])

### FIXED CODE ###

n,k = map(int, input().split())
w = {"A":"a", "B":"b", "C":"c"}
s = list(input())
print(''.join([w[s[i]] if i == k-1 else s[i] for i in range(n)]))
N,K=map(int,input().split())
A=list(map(int,input().split()))
ischecked=[0]*N
move=[]
move1=[]
now=0
count=0
count1=0
while 1:
    move.append(now+1)
    nex=A[now]-1
    ischecked[now]=1
    if ischecked[nex]==1:
        roop=nex+1
        break
    now=nex
for i in range(len(move))[::-1]:
    move1.append(move[i])
    if move[i]==roop:
        b=len(move)-i
        break
if K>len(move):
    n=K-len(move)
    n=n%len(move1)
    print(move1[len(move1)-1-n])
else:
    print(move[K])

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))
ischecked=[0]*N
move=[]
move1=[]
now=0
count=0
count1=0
while 1:
    move.append(now+1)
    nex=A[now]-1
    ischecked[now]=1
    if ischecked[nex]==1:
        roop=nex+1
        break
    now=nex
for i in range(len(move))[::-1]:
    move1.append(move[i])
    if move[i]==roop:
        b=len(move)-i
        break
if K>=len(move):
    n=K-len(move)
    n=n%len(move1)
    print(move1[len(move1)-1-n])
else:
    print(move[K])
class UnionFind():
  def __init__(self):
    self.roots = {}
    self.nums = {}

  def find_root(self, a):
    if a not in self.roots:
      self.nums[a] = 1
      return a
    else:
      self.roots[a] = self.find_root(self.roots[a])
      return self.roots[a]

  def unite(self, a, b):
    root_a = self.find_root(a)
    root_b = self.find_root(b)
    n_a = self.nums[root_a]
    n_b = self.nums[root_b]
    if root_a == root_b:
      return
    else:
      if n_a > n_b: #多い方に合流させる
        self.roots[root_b] = root_a
        self.nums[root_a] = n_a + n_b
        del self.nums[root_b]
      else:
        self.roots[root_a] = root_b
        self.nums[root_b] = n_a + n_b
        del self.nums[root_a]
      return
  
  def is_union(self, a,b):
    return self.find_root(a) == self.find_root(b)

N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(N)]

answer = 0
for i in range(N):
  temp = AB[:i] + AB[i+1:]
  ai, bi = AB[i]
  uf = UnionFind()
  for ab in temp:
    a,b = ab
    uf.unite(a,b)
  answer += not uf.is_union(ai, bi)


print(answer)

### FIXED CODE ###

class UnionFind():
  def __init__(self):
    self.roots = {}
    self.nums = {}

  def find_root(self, a):
    if a not in self.roots:
      self.nums[a] = 1
      return a
    else:
      self.roots[a] = self.find_root(self.roots[a])
      return self.roots[a]

  def unite(self, a, b):
    root_a = self.find_root(a)
    root_b = self.find_root(b)
    n_a = self.nums[root_a]
    n_b = self.nums[root_b]
    if root_a == root_b:
      return
    else:
      if n_a > n_b: #多い方に合流させる
        self.roots[root_b] = root_a
        self.nums[root_a] = n_a + n_b
        del self.nums[root_b]
      else:
        self.roots[root_a] = root_b
        self.nums[root_b] = n_a + n_b
        del self.nums[root_a]
      return
  
  def is_union(self, a,b):
    return self.find_root(a) == self.find_root(b)

N, M = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

answer = 0
for i in range(M):
  temp = AB[:i] + AB[i+1:]
  ai, bi = AB[i]
  uf = UnionFind()
  for ab in temp:
    a,b = ab
    uf.unite(a,b)
  answer += not uf.is_union(ai, bi)


print(answer)
#

#

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
import math

def main():
    n = int(input())
    al = list(map(int, input().split()))

    ans = [0] * n

    half = math.ceil(n/2)
    for i in range(half, n):
        ans[i] = al[i]

    for i in range(half, -1, -1):
        num = i + 1
        val = 0
        for j in range(num * 2 - 1, n, num):
            # print(j)
            val += ans[j]

        val %= 2
        ans[i] = 0 if val == al[i] else 1

    c = ans.count(1)
    print(c)
    if c > 0:
        boxes = []
        for i in range(len(ans)):
            if ans[i] == 1:
                boxes.append(i + 1)
        print(' '.join(map(str, boxes)))


if __name__ == '__main__':
    main()


### FIXED CODE ###

#

#

import itertools
from collections import Counter
from collections import defaultdict
from collections import deque
import bisect
from heapq import heappush, heappop
import math

def main():
    n = int(input())
    al = list(map(int, input().split()))

    ans = [0] * n

    half = math.ceil(n/2)
    for i in range(half, n):
        ans[i] = al[i]

    for i in range(half-1, -1, -1):
        num = i + 1
        val = 0
        for j in range(num * 2 - 1, n, num):
            # print(j)
            val += ans[j]

        val %= 2
        ans[i] = 0 if val == al[i] else 1

    c = ans.count(1)
    print(c)
    if c > 0:
        boxes = []
        for i in range(len(ans)):
            if ans[i] == 1:
                boxes.append(i + 1)
        print(' '.join(map(str, boxes)))


if __name__ == '__main__':
    main()
n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, raw_input().split()))
    if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10:
        print("YES")
    else:
        print("NO")

### FIXED CODE ###

n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print("YES" if abs((y2-y1)*(x4-x3)-(x2-x1)*(y4-y3)) < 1e-10 else "NO")
n = input()
if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

n = int(input())
L = [2,1]
if n == 1:
  print(L[1])
else:
  for i in range(2,n+1):
    l = L[i-2] + L[i-1]
    L.append(l)
  print(L[-1])
N = int(input())
h = list(map(int,input().split()))

N -= 1

def step(i):
  if i == 0:
    return 0
  elif i == 1:
    return abs(h[1]-h[0])
  elif abs(h[i-1]-h[i]) <= abs(h[i-2]-h[i]):
    return step(i-1) + abs(h[i-1]-h[i])
  else:
    return step(i-2) + abs(h[i-2]-h[i])
  
print(step(N))

### FIXED CODE ###

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

dp = [0]*N

dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2,N):
  dp[i] = min(dp[i-2]+abs(h[i]-h[i-2]),dp[i-1]+abs(h[i]-h[i-1]))

print(dp[N-1])
N = input()
 
a = int(N/100)
b = int( (N-a*100)/10 )
c = int(N-a*100-b*10)
 
if a == 7 or b == 7 or c == 7:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

num = input();

if num[0] == "7" or num[1] == "7" or num[2] == "7" :
  print("Yes");
else:
  print("No");
import sys

def main():
    input = sys.stdin.readline
    S = str(input().strip())

    z = []
    o = []
    i = 0
    while i < len(S):
        j = i + 1
        while j < len(S) and S[i] == S[j]:
            j += 1
        if S[i] == '0':
            z.append(j-i)
        else:
            o.append(j-i)

        i = j

    z = sorted(z, key=lambda x: -x)
    o = sorted(o, key=lambda x: -x)

    if z[0] > o[0]:
        if len(z) > 2 and z[0] == z[1]:
            print(z[0] + 1)
        else:
            print(z[0])
    elif o[0] > z[0]:
        if len(o) > 2 and o[0] == o[1]:
            print(o[0] + 1)
        else:
            print(o[0])
    else:
        if len(z) > 2 and z[0] == z[1]:
            print(z[0] + 1)
        elif len(o) > 2 and o[0] == o[1]:
            print(o[0] + 1)
        else:
            print(o[0])


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

def main():
    input = sys.stdin.readline
    S = str(input().strip())
    L = len(S)

    i = 0
    if L % 2 == 1:
        mid = (L - 1) // 2
        m = S[mid]
        while i <= mid and S[mid-i] == S[mid+i] == m:
            i += 1

        print(mid + i)
    else:
        mid =  (L - 1) // 2
        m0 = S[mid]
        m1 = S[mid+1]
        while i <= mid and S[mid-i] == S[mid+i+1] == m0 == m1:
            i += 1

        print(mid + i + 1)


if __name__ == '__main__':
    main()
import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if f_1[i] == t_n[p]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

import bisect

n, m = map(int, input().split())
f_1 = []
t_n = []
jedge = 0
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        f_1.append(b)
    if b == n:
        t_n.append(a)
f_1.sort()
t_n.sort()
for i in range(len(f_1)):
    p = bisect.bisect_left(t_n, f_1[i])
    if p < len(t_n)-1 and f_1[i] == t_n[p]:
        jedge = 1
        break
    elif p == len(t_n)-1 and f_1[i] == t_n[p]:
        jedge = 1
        break
if jedge == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
a,b,c=map(int,input().split())
if a==b && b==c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c=map(int,input().split())
if a==b & b==c:
  print("Yes")
else:
  print("No")
x = input()
a = input()
b = input()
 
x1 = x - a
result  = x1 % b
 
print(result)

### FIXED CODE ###

x = int(input())
a = int(input())
b = int(input())
 
x1 = x - a
result  = x1 % b
 
print(result)
import sys
import numpy as np

def input():
    return sys.stdin.readline()[:-1]


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

ans = np.prod(A)
if ans > 10**18:
	print(-1)
else:
	print(ans)


### FIXED CODE ###

import sys
from functools import reduce


def input():
    return sys.stdin.readline()[:-1]


def mm(a, b):
	ans = a*b
	if ans > 10**18:
		return 0
	else:
		return a*b

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

if 0 in A:
	print(0)
else:
	ans = reduce(mm, A)
	
	if ans == 0:
		print(-1)
	else:
		print(ans)
A, B, C, D = map(int, input().split())

Thit = A
Tatk = B
Ahit = C
Aatk = D
Win = False

while Thit < 0 or Ahit < 0:
    Ahit = Ahit - Tatk
    if Ahit < 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit < 0:
        break

if win:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A, B, C, D = map(int, input().split())

Thit = A
Tatk = B
Ahit = C
Aatk = D
win = False

while True:
    Ahit = Ahit - Tatk
    if Ahit <= 0:
        win = True
        break
    Thit = Thit - Aatk
    if Thit <= 0:
        win = False
        break

if win:
    print("Yes")
else:
    print("No")
s = input()
l = sorted(list({s[i] for i in range(len(s))}))
if len(l) == 26:
    ans = "None"
else:
    for i in range(len(l) - 1):
        if ord(l[i]) + 1 != ord(l[i + 1]):
            ans = chr(ord(l[i]) + 1)
            break
print(ans)


### FIXED CODE ###

s = input()
l = list({s[i] for i in range(len(s))})
a = [False] * 26
for c in l:
    a[ord(c) - ord("a")] = True
ans = "None"
for i in range(len(a)):
    if a[i] == False:
        ans = chr(ord("a") + i)
        break
print(ans)
print((N*(N+1)/2)-(N//3*(N//3+1)/2)-(N//5*(N//5+1)/2)+(N//15*(N//15+1)/2))


### FIXED CODE ###

N=int(input())
print(((N*(N+1))-(N//3*(N//3+1)*3)-(N//5*(N//5+1)*5)+(N//15*(N//15+1)*15))//2)
N,K = map(int,input().split())
h = list(map(int,input().split()))
dp = [0]
dpx = 10**4+1
for i in range(1,K+1):
  for j in range(0,i):
      dpx = min(dpx, abs(h[i]-h[j])+dp[j])
  dp.append(dpx)
print(dp[-1])

### FIXED CODE ###

def main():
    N,K = map(int,input().split())
    h = list(map(int,input().split()))
    dp = [0]*N
    for i in range(1,N):
        dp[i]= min(abs(h[i]-h[j])+dp[j] for j in range(max(0,i-K),i))
    print(dp[-1])
main()
import sys

for line in sys.stdin
 n =map(int,line.split())
 a = n[0]+n[1]
 print line(str(a))

### FIXED CODE ###

import sys

for line in sys.stdin:
 n =map(int,line.split())
 a = n[0]+n[1]
 print len(str(a))
N = int(input())
lst = sorted([int(x) for x in input().split() if x != "1"], reverse=True)
if lst[-1] == 0:
    print(0)
    exit()

ret = 1
for x in lst:
    ret *= x
    if ret > 10 ** 18:
        print(-1)
        exit()

print(ret)

### FIXED CODE ###

N = int(input())
lst = sorted([int(x) for x in input().split() if x != "1"], reverse=True)

if len(lst) == 0:
    print(1)
    exit()
if lst[-1] == 0:
    print(0)
    exit()

ret = 1
for x in lst:
    ret *= x
    if ret > 10 ** 18:
        print(-1)
        exit()

print(ret)
from bisect import bisect_left
N=int(input())
L=list(map(int,input().split()))

L.sort()
a=0
for i in range(N-2):
    for j in range(i+1,N-1):
        a+=bisect_left(L,L[i]+L[j])-j-1
print(result)


### FIXED CODE ###

from bisect import bisect_left
N=int(input())
L=list(map(int,input().split()))

L.sort()
a=0
for i in range(N-2):
    for j in range(i+1,N-1):
        a+=bisect_left(L,L[i]+L[j])-j-1
print(a)
N = int(input())
L = [map(int,input().split())]
if len(set(L)) = N:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
if len(set(L)) == N:
  print('YES')
else:
  print('NO')
S = list(str, input())

if S[2] == S[3]:
  if S[4] == S[5]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

### FIXED CODE ###

S = list(input())

if S[2] == S[3]:
  if S[4] == S[5]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
n1=[*range(1,int(input())+1)]
n2=n1[1:]+[n1[0]]
count=0
for i in range(len(n1)):
  count+=n1[i]%n2[i]
print(count)

### FIXED CODE ###

n=int(input());print(n*(n-1)//2)
from scipy.special import comb
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v = sorted(v,reverse=True)

# (合計, 個数)
max_avg = (sum(v[:A]), A)

t = v[A-1]
num1 = v[:A].count(t)
num2 = v[A:].count(t)

fact = [0]*(N+1)
ifact = [0]*(N+1)
inv = [0]*(N+1)
p=170141183460469231731687303715884105727

def combination(n,fact,ifact):
    fact[0] = 1
    fact[1] = 1
    ifact[0] = 1
    ifact[1] = 1
    inv[1] = 1
    for i in range(2,n+1):
        fact[i] = (fact[i-1]*i)%p
        inv[i] = p - inv[p%i]*(p//i)%p
        ifact[i] = (ifact[i-1]*inv[i])%p
def op(n,k):
    if k<0 or k>n or n<0:
        return 0
    return (fact[n]*ifact[k]*ifact[n-k])%p

combination(N,fact,ifact)


res = int(comb(num1+num2, num1))
if v[0]==v[-1]:
    res = 0
    for i in range(A,B+1):
        res += int(op(N, i))

print(max_avg[0]/max_avg[1])
print(res)




### FIXED CODE ###

N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v = sorted(v,reverse=True)

# (合計, 個数)
max_avg = (sum(v[:A]), A)

t = v[A-1]
num1 = v[:A].count(t)
num2 = v[A:].count(t)

fact = [0]*(N+1)
ifact = [0]*(N+1)
inv = [0]*(N+1)
p=170141183460469231731687303715884105727

def combination(n,fact,ifact):
    fact[0] = 1
    fact[1] = 1
    ifact[0] = 1
    ifact[1] = 1
    inv[1] = 1
    for i in range(2,n+1):
        fact[i] = (fact[i-1]*i)%p
        inv[i] = p - inv[p%i]*(p//i)%p
        ifact[i] = (ifact[i-1]*inv[i])%p
def op(n,k):
    if k<0 or k>n or n<0:
        return 0
    return (fact[n]*ifact[k]*ifact[n-k])%p

combination(N,fact,ifact)

res = int(op(num1+num2, num1))
if v[0]==v[-1]:
    res = 0
    for i in range(A,B+1):
        res += int(op(N, i))
elif v[0] == v[B-1]:
    res = 0
    for i in range(A, B+1):
        res += int(op(num1+num2,i))
elif v[0] == v[A-1]:
    res = 0
    for i in range(A, min(B, A+num2)+1):
        res += int(op(num1+num2, i))
print(max_avg[0]/max_avg[1])
print(res)