Harryxun/stf_run huggingface dataset:
cho,N = map(int,input().split())
moji = str(input())
moji_dict = []
flg = 0
##計算量は10**5
for i in range(cho):
    if flg == 1:
        flg = 0
    elif i != cho and moji[i] == "A" and moji[i+1] =="C":
        moji_dict.append(i + 1)
        flg = 1
##計算量は10**3　* 10 ** 5
for j in range(N):
    s,g = map(int,input().split())
    print(len([k for k in moji_dict if k >= s and k < g]))

### FIXED CODE ###

N,K = map(int,input().split())
moji = str(input())
ans = [0]
for i in range(N-1):
    if moji[i] == "A" and moji[i+1] == "C":
        ans.append(ans[i]+1)
    else:
        ans.append(ans[i])

        
for i in range(K):
    st,sp = map(int,input().split())
    print(ans[sp-1]-ans[st-1])
a = int(input("a:"))
b = int(input("b:"))

if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

a,b = map(int,input().split())

if (a*b)%2 == 0:
    print("Even")
else:
    print("Odd")
# -*- coding: utf-8 -*-

H, W = map(int, input().split())
A = []
for i in range(H):
    A.append("#")
    a = input()
    A[i] += a + "#"

A = ["#" * (W+2)] + A + ["#" * (W+2)]

for i in A:
    print(i)

### FIXED CODE ###

# -*- coding: utf-8 -*-

A = set([1,3,5,7,8,10,12])
B = set([4,6,9,11])
C = set([2])

x, y = map(int, input().split())

if x in A and y in A:
    print("Yes")

elif x in B and y in B:
    print("Yes")

elif x in C and y in C:
    print("Yes")

else:
    print("No")
N = int(input())
L1 = map(int, input().split())
L2 = map(int, input().split())
P1 = L1[:]
P2 = L2[:]
for i in range(1, N):
  P1[i] += P1[i-1]
for j in range(N-1, -1, -1):
  P2[j] += P2[j+1]
L3 = [0]*N
for k in range(N):
  L3[k] = P1[k]+P2[k]
print(max(L3))
  
  
  


### FIXED CODE ###

N = int(input())
L1 = [x for x in map(int, input().split())]
L2 = [x for x in map(int, input().split())]
P1 = L1[:]
P2 = L2[:]
for i in range(1, N):
  P1[i] += P1[i-1]
for j in range(N-2, -1, -1):
  P2[j] += P2[j+1]
L3 = [0]*N
for k in range(N):
  L3[k] = P1[k]+P2[k]
print(max(L3))
N,M=map(int,input().split())

pn_num=0
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi-1)
        
    if Si=='AC':
        AC_list[pi]=1
    
    else:
        if AC_list[pi]==0:
            pn_num+=1
    
print(sum(AC_list),pn_num)

### FIXED CODE ###

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

pn_num=0
WA_list=[0]*N
AC_list=[0]*N

for _ in range(M):
    pi,Si=input().split()
    pi=int(pi)
        
    if Si=='AC':
        if AC_list[pi-1]==0:
            pn_num+=WA_list[pi-1]
            AC_list[pi-1]=1
    
    else:
        WA_list[pi-1]+=1
    
print(sum(AC_list),pn_num)
a, b, c = map(int, input().sprit())

count = 0:
for x in range(a, b + 1)
    if c % x == 0:
        count += 1
    	
print(count)

### FIXED CODE ###

a, b, c = map(int, input().split())

count = 0
for x in range(a, b + 1):
    if c % x == 0:
        count += 1
    	
print(count)
,q = map(int, input().split())
d = list(map(int, input().split()))

def query(n,x,m):
  x %= m
  ans = n-1
  n -= 1
  s1 = 0
  t1 = 0
  for i in range(k):
    s1 += d[i] % m
    if d[i] % m == 0:
      t1 += 1
  s2 = 0
  t2 = 0
  for i in range(n%k):
    s2 += d[i] % m
    if d[i] % m == 0:
      t2 += 1
  x += s1 * (n//k) + s2
  ans -= x//m
  ans -= t1 * (n//k) + t2
  
  print(ans)
  
    

for _ in range(q):
  n,x,m = map(int, input().split())
  query(n,x,m)


### FIXED CODE ###

# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import math

#############
# Constants #
#############

MOD = 10**9 +7
INF = float('inf')

#############
# Functions #
#############

kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

#############
# Main Code #
#############

k,q = map(int, input().split())
d = list(map(int, input().split()))

def query(n,x,m):
  x %= m
  ans = n-1
  n -= 1
  s1 = 0
  t1 = 0
  for i in range(k):
    s1 += d[i] % m
    if d[i] % m == 0:
      t1 += 1
  s2 = 0
  t2 = 0
  for i in range(n%k):
    s2 += d[i] % m
    if d[i] % m == 0:
      t2 += 1
  x += s1 * (n//k) + s2
  ans -= x//m
  ans -= t1 * (n//k) + t2
  
  print(ans)
  
    

for _ in range(q):
  n,x,m = map(int, input().split())
  query(n,x,m)
size, jumps = map(int, input().split())
array =  list(map(int, input().split()))
dp = [0]* size
for i in range(1,size):
	for j in range(i,jumps):	
		
		dp[j] = min(dp[j],abs(array[i] - array[j]))
print(dp[-1])

### FIXED CODE ###

import sys


def input():
    return sys.stdin.readline().strip()


def main():
    size, jumps = map(int, input().split())
    array = list(map(int, input().split()))
    dp = [999999999] * size
    dp[0]= 0
    dp[1] = abs(array[0]- array[1])
    for i in range(2,size):
        dp[i] = min(abs(array[i] - array[j]) + dp[j] for j in range(max(0, i - jumps), i))
    print(dp[size-1])

if __name__ == "__main__":
    main()
n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
D = {}
for i in range(n):
    if d[i] not in D:
        D[d[i]] = 1
    else:
        D[d[i]] += 1
T = {}
for j in range(m):
    if t[j] not in T:
        T[t[j]] = 1
    else:
        T[t[j]] += 1
for k in T:
    if T[k] <= D[k]:
        continue
    else:
        print('NO')
        break
else:
    print('YES')



### FIXED CODE ###

n = int(input())
d = list(map(int, input().split()))
m = int(input())
t = list(map(int, input().split()))
D = {}
for i in range(n):
    if d[i] not in D:
        D[d[i]] = 1
    else:
        D[d[i]] += 1
T = {}
for j in range(m):
    if t[j] not in T:
        T[t[j]] = 1
    else:
        T[t[j]] += 1
for k in T:
    try:
        if T[k] <= D[k]:
            continue
        else:
            print('NO')
            break
    except:
        print('NO')
        break
else:
    print('YES')
x, a = map(int, input().split())
if s < a:
    print(0)
else:
    print(10)

### FIXED CODE ###

x, a = map(int, input().split())
if x < a:
    print(0)
else:
    print(10)
N, M, K = map(int, input().split())
mod = 10**9+7
ans = 0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
mod = 10**9+7 #出力の制限
N = 2*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

for d in range(1,N):
    ans += d*(N-d)*M**2 % mod
for d in range(1,M):
    ans += d*(M-d)*N**2 % mod
ans *= cmb(N*M-2, K-2, mod) % mod
print(ans)

### FIXED CODE ###

N, M, K = map(int, input().split())
ans=0
mod = 10**9+7 #出力の制限
max = 2*10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
for i in range( 2, max + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
for d in range(1,N):
    ans += d*(N-d)*M**2 % mod
for d in range(1,M):
    ans += d*(M-d)*N**2 % mod
ans = ans*cmb(N*M-2, K-2, mod) % mod
print(ans)
a,b=input().split()
print(a-b+1)

### FIXED CODE ###

a,b=map(int,input().split())
print(a-b+1)
S = str(input())
S += "<"
l = 0
r = 0
ans = 0
tmp = ">"
for i in range(len(s)):
    if tmp == ">" and S[i] == "<":
        ans += max(l, r) * (max(l, r) + 1) / 2 + min(l, r) - 1
        l = 1
        r = 0
        tmp = S[i]
    else:
        if S[i] == ">":
            r += 1
        else:
            l += 1
        tmp = S[i]
print(ans)

### FIXED CODE ###

S = str(input())
l = 0
r = 0
ans = 0
tmp = S[0]
if tmp == ">":
    r = 1
else:
    l = 1
for i in range(1,len(S)):
    if tmp == ">" and S[i] == "<":
        ans += max(l, r) * (max(l, r) + 1) / 2 + min(l, r) * (min(l, r) - 1) / 2
        l = 1
        r = 0
        tmp = S[i]
    else:
        if S[i] == ">":
            r += 1
        else:
            l += 1
        tmp = S[i]
ans += max(l, r) * (max(l, r) + 1) / 2 + min(l, r) * (min(l, r) - 1) / 2
print(int(ans))
input1 = input()
Kbai= int(input1)

input2=input().split(" ")
maxs= int(input2[0])
mins= int(input2[2])
flg=0
ans=0

while ans < maxs:
  ans=ans+kbai
  if ans >= mins and ans <= maxs:
    flg=1
 
if flg ==1:
  print("OK")
else:
  print("NG")


### FIXED CODE ###

#
#at coder beginner contest165 a we love golf
#
import math

input1 = input()
kbai= int(input1)
 
input2=input().split(" ")
mins= int(input2[0])
maxs= int(input2[1])
flg=0
ans=0
tmp=0

tmp=math.floor(mins/kbai)
ans=tmp*kbai
#print(tmp)

while ans <= maxs:
  if ans >= mins and ans <= maxs:
    flg=1
  ans=ans+kbai

if flg ==1:
  print("OK")
  #print(ans,maxs,mins,flg)
else:
  print("NG")
  #print(ans,maxs,mins,flg)
x = input()
 print(int(x)**3)

### FIXED CODE ###

x = raw_input()
print(int(x)**3)
N, X, M = map(int, input().split())

nxt = X
lst = []
dic = {}

for i in range(M):
    if nxt in dic:
        loop_st = dic[nxt]
        loop_ed = i - 1
        break

    lst.append(nxt)
    dic[nxt] = i

    nxt = (nxt ** 2) % M


v = N - loop_st
q, r = divmod(v, loop_ed - loop_st + 1)

pre_sum = sum(lst[:loop_st])
loop_sum = q * sum(lst[loop_st:])
post_sum = sum(lst[loop_st:loop_st + r])


### FIXED CODE ###

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

nxt = X
lst = []
dic = {}

for i in range(M + 1):
    if nxt in dic:
        loop_st = dic[nxt]
        loop_ed = i - 1
        break

    lst.append(nxt)
    dic[nxt] = i

    nxt = (nxt ** 2) % M


v = N - loop_st
q, r = divmod(v, loop_ed - loop_st + 1)

pre_sum = sum(lst[:loop_st])
loop_sum = q * sum(lst[loop_st:])
post_sum = sum(lst[loop_st:loop_st + r])
print(pre_sum + loop_sum + post_sum)
if len(set(input().split()))1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

if len(set(input().split()))==1:
    print("Yes")
else:
    print("No")
N, K = map(int, input().split())
x = list(map(int, input().split()))
L = []

for i in range(N-K):
    L.append(abs(x[i]) + x[K+i-1] - x[i])
    L.append(abs(x[K+i-1]) + x[K+i-1] - x[i])
    
if N != 1:
    print(min(L))
else:
    print(abs(x[0]))

### FIXED CODE ###

N, K = map(int, input().split())
x = list(map(int, input().split()))
L = []

for i in range(N-K+1):
    L.append(abs(x[i]) + x[K+i-1] - x[i])
    L.append(abs(x[K+i-1]) + x[K+i-1] - x[i])
    
if N != 1:
    print(min(L))
else:
    print(abs(x[0]))
import numpy as np

n = int(input())
m = int(input())
list_homework = input().split(" ")
list_homework = np.array([int(list_homework[i]) for i in range(len(list_homework))])  

rest_day = n - list_homework.sum()

if rest_day >= 0:
    print(rest_day)
else:
    print("-1")

### FIXED CODE ###

from operator import add
import functools


n = input().split(" ")

list_homework = input().split(" ")
list_homework = [int(list_homework[i]) for i in range(len(list_homework))]  

rest_day = int(n[0]) - functools.reduce(add, list_homework)

if rest_day >= 0:
    print(rest_day)
else:
    print("-1")
X = int(input())
 
flag = 0
A = 0
B = 0
 
for i in range(0, 100000):
  for j in range(0, 100000):
    if i**5 - j**5 == X:
      A = i
      B = j
      break
    elif i**5 + j**5 == X:
      A = i
      B = j
      break
    elif -i**5 - j**5 == X:
      A = -i
      B = j
      break
print(str(A) + ' ' + str(B))

### FIXED CODE ###

a = input()

if a == 'ABC':
  print('ARC')
else:
  print('ABC')
n=int(input())
q=lambda i:input('%d\n'%i)
i=0
j=n-1
a=q(i)
b=q(j)
print('hoge')

### FIXED CODE ###

n=int(input())
i=0
j=n-1
print(i)
a=input()
print(j)
b=input()
while 1:
    if j-i<2:
        print(i)
        _=input()
        print(j)
        if input()!='Vacant':
            print('助けてくれ～～～')
    k=(j-i)//2+i
    print(k)
    c=input()
    if(k-i)%2and a==c or not(k-i)%2and a!=c:
        j=k
    else:
        a=c
        i=k
max = 0
n_max = 19999

price = [0]*n_max
for i in range(n_max):
  price[i] = int(raw_input())

for i in range(n_max):
  for j in range(j, n_max+1):
    if max <= price[j] - price[i]:
      max = price[j] - price[i]
print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
N,K = map(int,input().split())
S = str(input())
S = list(S)


if N/2 < K:
    ans = N
else:
    cnt = 0
    state = S[0]
    X = []
    if S[0] == "0":
        X.append(0)
    for i in S:
        if i == state:
            cnt += 1
        else:
            state = i
            X.append(cnt)
            cnt = 1
    X.append(cnt)

    #print(X)
    #print(len(X)-K)

    Y = []
    for i in range(0,len(X)-(K*2+1)+1,2):
        tmp = 0
        for j in range(i,i+(K*2+1)):
            tmp += X[j]
        Y.append(tmp)
    
    #print(Y)

    ans = max(Y)

print(ans)

### FIXED CODE ###

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

cnt = 0
state = sss[0]
x = []
if sss[0] == "0":
    x.append(0)
for s in sss:
    if s == state:
        cnt += 1
    else:
        state = s
        x.append(cnt)
        cnt = 1
x.append(cnt)
if sss[-1] == "0":
    x.append(0)
#11101010110011
#1:3 1 1 2 2
#0: 1 1 1 2

#1
#1

y = [0]
for i in range(len(x)):
    y.append(y[i] + x[i])
#:0,1,2,3,4,5,6 7, 8 ,9
#:0,3,4,5,6,7,8,10,12,14

#0,1

z = []
for i in range(k*2+1,len(y))[::2]:
    z.append(y[i] - y[i - (k*2+1)])
#print(x)
#print(y)
#print(z)
if len(x) <= k*2-1:
    print(sum(x))
else:
    print(max(z))
x, y = map(int, re.split(' ', raw_input()))
print('%d %d' % (x, y ))
#print(gcd(x, y))

### FIXED CODE ###

import re

def gcd(x, y):
    if x == y:
        return x
    if x < y and y % x == 0:
        return x
    if x > y and x % y == 0:
        return y
    if x <= y:
        m = y % x
        return gcd(x, m)
    if x >= y:
        m = x % y
        return gcd(y, m)

    l = list(range(1, int(min(x, y) / 2) + 1))
    l.reverse()
    r = 1
    for i in l:
        if x % i == 0 and y % i == 0:
            return i
    return 1
 
x, y = map(int, re.split(' ', raw_input()))
print(gcd(x, y))
n=int(input())
a=[int(input()) for i in range(n)]
cost=abs(a[n-1])
a.append(0)
a.insert(0,0)

for i in range(n):
    ans=cost+abs(a[i]-a[i+2])-abs(a[i+1]-a[i])-abs(a[i+1]-a[i+2])
    print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
cost=abs(a[n-1])
a.append(0)
a.insert(0,0)
for i in range(n):
    tmp=abs(a[i]-a[i+1])
    cost+=tmp
for i in range(n):
    ans=cost+abs(a[i]-a[i+2])-abs(a[i+1]-a[i])-abs(a[i+1]-a[i+2])
    print(ans)
N = int(input())
D = sorted(list(map(int,input().split())))
ans = 1
D.append(-1)
if D[0]>0:
    ans = 0
elif D[1]==0:
    ans = 0
else:
    cur = 0
    n1 = 1
    n2 = 1
    for i,d in enumerate(D[1::],1):
        if d == cur:
            n2 += 1
        else:
            ans *= n1**n2
            n1 = n2
            n2 = 1
            cur = d
print(ans%998244353)

### FIXED CODE ###

N = int(input())

if N%2 == 0:
    print(int(N//2-1))
else:
    print(int((N+1)//2-1))
# ABC114C - 755
n = input()
digit = len(n)
ans = 0
for i in range(1, digit):
    ans += len([i for i in itertools.product("357", repeat=i) if len(set(i)) == 3])
tup = tuple(i for i in n)
lst = [i for i in itertools.product("357", repeat=digit) if len(set(i)) == 3] + [tup]
lst.sort()
ans += lst.index(tup)
print(ans)

### FIXED CODE ###

# ABC114C - 755
def shichi_go_san(s="0"):
    if int(s) > n:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in "753") else 0
    for c in "753":
        ret += shichi_go_san(s + c)
    return ret


n = int(input())
print(shichi_go_san())
S=input()
T=input()
print(sum(x!=y for x,y in zip(S,T))


### FIXED CODE ###

S=input()
T=input()
print(sum(x!=y for x,y in zip(S,T)))
def a(t,i):
    if i==l-1:
        print(sum(map(int,t.split('+'))))
        exit()
    return a(t+s[i+1],i+1)+a(t+'+'+s(i+1),i+1)

s=input()
a(s[0],0)
l = len(s)

### FIXED CODE ###

def dfs(i,s):
    if i==n-1:
        return sum(map(int,s.split('+')))
    return dfs(i+1,s+S[i+1])+dfs(i+1,s+'+'+S[i+1])

S=input()
n=len(S)
ans=dfs(0,S[0])
print(ans)
a, b, n = map(int, input().split())
x = min(b-1, n)
print(floor(a*x/b) - a * floor(x/b))

### FIXED CODE ###

from math import floor
a, b, n = map(int, input().split())
if b == 1:
	print(0)
else:
	x = min(b-1, n)
	print(floor(a*x/b) - a * floor(x/b))
n, k, x, y = [map(int(input()), for i in range(4))]
print(x * n - (x - y)*max(0, n - k)

### FIXED CODE ###

n,k,x,y=[int(input()) for i in range(4)]
print(n*x-(x-y)*max(n-k,0))
A, B, C, D=map(int, input().split())
print(max(AB, CD))

### FIXED CODE ###

A, B, C, D=map(int, input().split())
print(max(A*B, C*D))
n=int(input())
c=0
for i in range(n):
    x,y=input().split()
    c+=y-x+1
print(c)

### FIXED CODE ###

n=int(input())
c=0
for i in range(n):
    x,y=map(int,input().split())
    c+=y-x+1
print(c)
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]

bc.sort(key = lambda x:x[1], reverse = True)

a.sort()

a_count = 0
for b, c in bc:
        if c > a[a_count]:
                for i in range(b):
                        if c > a[a_count]:
                                a[a_count] = c
                                a_count += 1
                        else:
                                break
        else:
                break

print(sum(a))

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [[int(i) for i in input().split()] for i in range(m)]

bc.sort(key = lambda x:x[1], reverse = True)

a.sort()

a_count = 0
for b, c in bc:
        if c > a[a_count]:
                for i in range(b):
                        if c > a[a_count]:
                                a[a_count] = c
                                a_count += 1    
                        else:
                                break
                        if a_count == n:
                                        break

        else:
                break
        if a_count == n:
                break        

print(sum(a))
import math

n = int(input())

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

l = [1]

for i in range(1, n):
    b_max1 = 2 * (l[i - 1] - a[i - 1])
    b_max2 = sum(a[i:])

    if a[i] > 2 ** i - math.ceil(l[i-1]/2):
        l = -1
        break

    l.append(min(b_max1, b_max2))

if l != -1:
    l.append(a[-1])
    print(sum(l))
else:
    print(-1)

### FIXED CODE ###

n = int(input())

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

cumsum_a = a.copy()

for i in range(n-1, -1, -1):
    cumsum_a[i] += cumsum_a[i+1]

ans = 0
childable_node = 1

for i in range(n + 1):
    if a[i] > childable_node:
        ans = -1
        break

    ans += childable_node

    if i < n:
        b_max1 = 2 * (childable_node - a[i])
        b_max2 = cumsum_a[i + 1]
        childable_node = min(b_max1, b_max2)

print(ans)
N, K = map(int, input().split())
p = list(map(int, input().split()))

sum_k = [0] * N
tmp = 0
for i in range(K):
    tmp += p[i]
sum_k[0] = tmp
max_sum = tmp
candidate = 0
for i in range(len(p)-K):
    sum_k[i+1] = sum_k[i] - p[i] + p[i+K]
    if max_sum < sum_k[i+1]:
        max_sum = sum_k[i+1]
        candidate = i+1


dice = [0] * 1001

ans = 0
for i in range(candidate, candidate + K):
    tmp = 0
    if dice[p[i]+1] != 0:
        ans += dice[p[i]+1]
        continue
    for j in range(1, p[i]+1):
        tmp += j * (1 / p[i])
    dice[p[i]+1] = tmp
    ans += tmp
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))

sum_k = [0] * N
tmp = 0
for i in range(K):
    tmp += p[i]
sum_k[0] = tmp
max_sum = tmp
candidate = 0
for i in range(len(p)-K):
    sum_k[i+1] = sum_k[i] - p[i] + p[i+K]
    if max_sum < sum_k[i+1]:
        max_sum = sum_k[i+1]
        candidate = i+1


dice = [-1] * 10000

ans = 0
for i in range(candidate, candidate + K):
    tmp = 0
    if dice[p[i]+1] != -1:
        ans += dice[p[i]+1]
        continue
    for j in range(1, p[i]+1):
        tmp += j * (1 / p[i])
    dice[p[i]+1] = tmp
    ans += tmp
print(ans)
n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(m)]
p = list(map(int, input().split()))
ans = 0

for i in range(2**n):
    bulb = [0] * m
    for j in range(n):
        if i>>j & 1:
            for k in range(m):
                if j+1 in lst[k][1:]:
                    bulb[k] += 1

	for l in range(m):
    	if bulb[l] % 2 == p[l]:
        	ans += 1

print (ans)


### FIXED CODE ###

n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(m)]
p = list(map(int, input().split()))
ans = 0

for i in range(2**n):
    bulb = [0] * m
    for j in range(n):
        if i>>j & 1:
            for k in range(m):
                if j+1 in lst[k][1:]:
                    bulb[k] += 1

    flag = True
    for l in range(m):
        if bulb[l] % 2 != p[l]:
            flag = False
    if flag:
        ans += 1

print (ans)
#Two Anagrams
s = list(input()).sorted
t = list(input()).sorted
if s < t:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a,b=map(int,input().split())
print((1+a+b)//2)
number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(number[K-1])

### FIXED CODE ###

number = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(number[int(input())-1])
from collections import deque
N=int(input())
C=list(input())

qw=deque(list())
qr=deque(list())

ans=0
for i in range(N//2):
    if C[i]=='W':
        qw.append(i)
    if C[-(i+1)]=='R':
        qr.append(-(i+1))
    if len(qw)>0 and len(qr)>0:
        ans+=1
        l=qw.popleft()
        r=qr.popleft()
        C[l],C[r]=C[r],C[l]

if len(qw)>0:
    l=qw.popleft()
    if C[l+1]=='R':
        C[l+1]='W'
        ans+=1
elif len(qr)>0:
    r=qr.popleft()
    if C[r-1]=='W':
        C[r-1]='R'
        ans+=1

if (C[N//2-1]==C[N//2]==C[N//2+1]) or (C[N//2]=='R' and C[N//2-1]=='R' and C[N//2+1]=='W') or (C[N//2]=='W' and C[N//2-1]=='R' and C[N//2+1]=='R'):
    print(ans)
else:
    print(ans+1)



### FIXED CODE ###

N=int(input())
C=list(input())

white=[0]*(N+1)
red=[0]*(N+1)

for i in range(N):
    if C[i]=="W":
        white[i+1]=white[i]+1
        red[i+1]=red[i]
    else:
        white[i+1]=white[i]
        red[i+1]=red[i]+1

if white[-1]==N or red[-1]==N:
    print(0)
    exit()

ans=float("inf")
for i in range(1,N):
    wcnt=white[i]
    rcnt=red[-1]-red[i]
    m=max(wcnt,rcnt)
    ans=min(m,ans)

print(ans)
import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[line-1]

### FIXED CODE ###

import sys
N = 999999
lis = []
if N >= 2:
	lis.append(2)
if  N >= 3:
	lis.append(3)
if N >= 5:
	for i in xrange(5,N+1,2):
		for item in lis:
			if item > (i**0.5):
				lis.append(i)
				break
			if i % item == 0:
				break
		else:
			lis.append(i)
dp = [0]*999999
for item in lis:
	dp[item-1] += 1
for i in xrange(1,999999):
	dp[i] += dp[i-1]

for line in sys.stdin:
	num = int(line)
	print dp[num-1]
n = int(input())
d = [list(input())for i in ranghe(n)]
print(len(set(d)))


### FIXED CODE ###

n = int(input())
d = list(int(input())for i in range(n))
print(len(set(d)))