Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

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

def sum_element(p:list,i:int,k:int):
    ans = 0
    for j in range(k):
        ans += p[i+j]
    return ans

pmax = 0
pindex = 0

for i in range(len(p)-k+1):
    ptmp = sum_element(p,i,k)
    if pmax < ptmp:
        pindex = i
        pmax = ptmp

ans = 0
for j in range(k):
    ans += (p[pindex+j]*(p[pindex+j]+1))/2/p[pindex+j]

print(ans)

### FIXED CODE ###

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

ev = [0] * n

for i in range(n):
    ev[i] = (1+p[i])/2

cs = [0] * n
cs[0] = ev[0]

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

ans = cs[k-1]

for i in range(n-k):
    s = cs[i+k] - cs[i]
    if s > ans:
        ans = s

print(ans)
### BUGGY CODE ###

#解説の方法
N,M = map(int,input().split())
AB = [[] for _ in range(10**5+1)]#報酬振り込み日数ごとに報酬を格納
for _ in range(N):
    a,b = map(int,input().split())
    AB[a].append(b)
q = []
ans =0
for i in range(1,M+1):
    q += AB[i]#後ろから見るイメージ　残りi日で請けれる仕事をリストに追加する
    if len(q)>0:
        q.sort()
        ans += q.pop()
print(ans)



### FIXED CODE ###


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

AB.sort(key= lambda x:(-x[1],-x[0]))
memo = [0]*(10**5+1)#請け負うと決めた仕事の日
work = [float('inf')]*(10**5+1)

noMore = float('inf') #これ以上の日数が振り込みにかかる仕事は受けれない
ans = 0
for a,b in AB:
    if a< noMore:
        flag = 1
        for idx in range(min(M-a,work[a]),-1,-1):
            if memo[idx] == 0:#仕事が請けられる
                ans += b
                memo[idx]=1
                flag = 0
                work[a] = idx
                break
        if flag ==1:
            noMore = a
    
print(ans)
### BUGGY CODE ###

from collections import Counter
n = int(input())
p = [list(str(input())) for _ in range(n)]
ln = []
a = []
for i in p:
    a.append(Counter(i))
    if Counter(i)not in ln:
        ln.append(Counter(i))

ln2 = [0] * len(ln)

for j in a:
    ln2[ln.index(j)] += 1

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k]) 
    
    return result

x = 0

for k in ln2:
    if k > 1:
        x += cmb(k, 2)
    
print(x)        

### FIXED CODE ###

N = int(input())
S = [''.join(sorted(list(input()))) for _ in range(N)]
 
from collections import Counter
a=Counter(S)
 
ans = 0
 
for i in a.values():
    if i>1:
        ans += i*(i-1)/2
 
print(int(ans))
### BUGGY CODE ###

def double_landscape(N: int, M: int, A: list, B: list) -> int:
    if not (is_unique(A) and is_unique(B)):
        return 0

    count = 1
    for x in range(N * M + 1, 0, -1):
        availables = 0
        if x in A and x in B:
            availables = 1
        elif x in A:
            availables = sum(b > x for b in B)
        elif x in B:
            availables = sum(a > x for a in A)
        else:
            used = (N * M - x)
            availables = sum(a > x and b > x for a in A for b in B)
            availables -= used

        if availables == 0:
            return 0

        count *= availables
        count %= 10**9 + 7

    return count


def is_unique(l: list) -> bool:
    return len(l) == len(set(l))


if __name__ == "__main__":
    N, M = [int(s) for s in input().split()]
    A = [int(s) for s in input().split()]
    B = [int(s) for s in input().split()]

    print(double_landscape(N, M, A, B))


### FIXED CODE ###

def double_landscape(N: int, M: int, A: list, B: list) -> int:
    if not (is_unique(A) and is_unique(B)):
        return 0

    A = sorted(A, reverse=True)
    B = sorted(B, reverse=True)
    i_a, i_b = 0, 0

    count = 1
    NM = N*M
    for x in range(NM, 0, -1):
        availables = 0
        if i_a < N and i_b < M and x == A[i_a] and x == B[i_b]:
            availables = 1
            i_a += 1
            i_b += 1
        elif i_a < N and x == A[i_a]:
            availables = i_b
            i_a += 1
        elif i_b < M and x == B[i_b]:
            availables = i_a
            i_b += 1
        else:
            availables = i_a * i_b - (NM - x)

        if availables <= 0:
            return 0

        count *= availables
        count %= 10**9 + 7

    return count


def is_unique(l: list) -> bool:
    return len(l) == len(set(l))


if __name__ == "__main__":
    N, M = [int(s) for s in input().split()]
    A = [int(s) for s in input().split()]
    B = [int(s) for s in input().split()]

    print(double_landscape(N, M, A, B))
### BUGGY CODE ###

N = int(input())

num=0

for a in range(1,N+1):
  for b in range(1,N+1):
    if str(a)[0] == str(b)[-1] and str(a)[-1] == str(b)[0]:
      num +=1
print(num)
    


### FIXED CODE ###

import collections
N = int(input())

num=0

li = [i+1 for i in range(N)]

l4 = list(map(lambda x: str(x)[0]+str(x)[-1], li))
ll = set(l4)
l5 = list(map(lambda x: str(x)[-1]+str(x)[0], li))
c4 = collections.Counter(l4)
c5 = collections.Counter(l5)

for l in ll:
  num += c4[l] * c5[l]
print(num)
### BUGGY CODE ###

A, B, N = map(int, input().split())
x = []
i = N

while i % B != 0:
  x.append(i % B)
  i = i - 1
  
i = i - 1
if i < 0:
  ans = (A * x[0]) // B - A * (x[0] // B)
else:
  ans = (A * i) // B - A * (i // B)
  
print(ans)

### FIXED CODE ###

A, B, N = map(int, input().split())
i = (N // B) * B
  
i = i - 1
if i < 0:
  ans = (A * N) // B - A * (N // B)
else:
  ans = (A * i) // B - A * (i // B)
  
print(ans)
### BUGGY CODE ###

n = int(input())
x = []
x = map(int, input().split())
a_list = list(x) 

r_list = []
for i in range(n+1):
    r_list.append(a_list.count(i))

r_list2 = map(str, r_list[1:])
r_list3 = list(r_list2)

ans = "\n".join(r_list3)

print(ans)

### FIXED CODE ###

import collections
n = int(input())
x = map(int, input().split())
a_list = list(x)

# n = 5
# a_list = [1,1,3,3]

r_list = collections.Counter(a_list)
y = []
for i in range(1,(n+1)):
    if (i in r_list):
        y.append(r_list[i])
    else:
        y.append(0)

r_list2 = map(str, y)
r_list2 = list(r_list2)
ans = "\n".join(r_list2)
print(ans)

# r_list = map(a_list.count, range(n+1))
#r_list = list(r_list_v)
### BUGGY CODE ###

H, W = map(int, input().split())

field = []
dist = [[float('inf')] * (W * H) for h in range(W * H)]

for _ in range(H):
    field.append(input())

weight = 1
for i in range(H):
    for j in range(W):
        if j + 1 < W and field[i][j] == '.' and field[i][j + 1] == '.':
            dist[W * i + j][W * i + j + 1] = weight
            dist[W * i + j + 1][W * i + j] = weight
        if i + 1 < H and field[i][j] == '.' and field[i + 1][j] == '.':
            dist[W * i + j][W * (i + 1) + j] = weight
            dist[W * (i + 1) + j][W * i + j] = weight


def warshall_floyd(d):
    for k in range(len(d)):
        for i in range(len(d)):
            for j in range(len(d)):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])


warshall_floyd(dist)

ans = 0
for i in range(H * W):
    for j in range(i + 1, H * W):
        if dist[i][j] != float('inf'):
            ans = max(ans, dist[i][j])

print(ans)


### FIXED CODE ###

from collections import defaultdict
import heapq
import math

H, W = map(int, input().split())

edges = defaultdict(list)
field = []

for _ in range(H):
    field.append(input())

weight = 1
for i in range(H):
    for j in range(W):
        if j + 1 < W and field[i][j] == '.' and field[i][j + 1] == '.':
            edges[W * i + j].append((W * i + j + 1, weight))
            edges[W * i + j + 1].append((W * i + j, weight))
        if i + 1 < H and field[i][j] == '.' and field[i + 1][j] == '.':
            edges[W * i + j].append((W * (i + 1) + j, weight))
            edges[W * (i + 1) + j].append((W * i + j, weight))


def dijkstra(s):
    que = []
    dist = [float('inf')] * (H * W)
    dist[s] = 0
    heapq.heappush(que, (0, s))

    while que:
        p = heapq.heappop(que)
        v = p[1]
        if dist[v] < p[0]:
            continue
        for i in range(len(edges[v])):
            e = edges[v][i]
            if dist[e[0]] > dist[v] + e[1]:
                dist[e[0]] = dist[v] + e[1]
                heapq.heappush(que, (dist[e[0]], e[0]))

    dist = [0 if d == float('inf') else d for d in dist]
    return dist


ans = 0
for i in range(H*W):
    ans = max(ans, max(dijkstra(i)))

print(ans)
### BUGGY CODE ###

from collections import Counter
import math
def com(n,r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))

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

cnt = Counter(a)
for i in range(1, n + 1):
    temp = a[i - 1]
    ans = 0
    for num, k in cnt.items():
        kosu = k
        if num == temp:
            kosu -= 1
        if kosu >= 2:
            ans += com(kosu, 2)

    print(ans)

### FIXED CODE ###

import sys
input=sys.stdin.readline
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
cnt=Counter(a)
#print(cnt)

ans=0
for i in cnt.values():
    ans=ans+i*(i-1)//2

for i in a:
    print(ans-cnt[i]+1)
### BUGGY CODE ###

INF = 1<<50
n, m = list(map(int, input().split()))
a, b, c = [], [], []
for _ in range(m):
    abc = list(map(int, input().split()))
    a.append(abc[0])
    b.append(abc[1])
    c.append(-abc[2]) # convert pos-neg

dist = [INF]*(n+1)
dist[1] = 0
for loop in range(n-1):
    for i in range(m):
        if dist[a[i]] == INF:
            continue
        if dist[b[i]] > dist[a[i]] + c[i]:
            dist[b[i]] = dist[a[i]] + c[i]
ans = dist[-1]

negative = [False]*(n+1) # negative closed path
for loop in range(n):
    for i in range(m):
        if dist[a[i]] == INF:
            continue
        if dist[b[i]] > dist[a[i]] + c[i]:
            dist[b[i]] = dist[a[i]] + c[i]
            negative[b[i]] = True
        if negative[a[i]] is True:
            negative[b[i]] = True

# print(dist, negative)
if negative[-1] is True:
    print('inf')
else:
    print(-ans)

### FIXED CODE ###

INF = float('inf')
n, m = list(map(int, input().split()))
a, b, c = [], [], []
for _ in range(m):
    abc = list(map(int, input().split()))
    a.append(abc[0])
    b.append(abc[1])
    c.append(-abc[2]) # convert pos-neg

dist = [INF]*(n+1)
dist[1] = 0
for loop in range(n-1):
    for i in range(m):
        if dist[a[i]] == INF:
            continue
        if dist[b[i]] > dist[a[i]] + c[i]:
            dist[b[i]] = dist[a[i]] + c[i]
ans = dist[-1]

negative = [False]*(n+1) # negative closed path
for loop in range(n):
    for i in range(m):
        if dist[a[i]] == INF:
            continue
        if dist[b[i]] > dist[a[i]] + c[i]:
            dist[b[i]] = dist[a[i]] + c[i]
            negative[b[i]] = True
        if negative[a[i]] is True:
            negative[b[i]] = True

    if negative[-1] is True:
        break
# print(dist, negative)
if negative[-1] is True:
    print('inf')
else:
    print(-ans)
### BUGGY CODE ###

def solve():
    MOD = 10**9 + 7

    N, M = map(int, input().split())
    Ss = list(map(int, input().split()))
    Ts = list(map(int, input().split()))

    dp = [[0]*(M+1) for _ in range(N+1)]
    for i in range(N+1):
        dp[i][0] = 1
    for j in range(M+1):
        dp[0][j] = 1

    for i, S in enumerate(Ss, start=1):
        for j, T in enumerate(Ts, start=1):
            dp[i][j] = dp[i-1][j] + dp[i][j-1] - dp[i-1][j-1]
            if S == T:
                dp[i][j] += dp[i-1][j-1]
            dp[i][j] %= MOD

    print(dp[N][M])


solve()


### FIXED CODE ###

MOD = 10**9 + 7

N, M = map(int, input().split())
Ss = list(map(int, input().split()))
Ts = list(map(int, input().split()))

dp = [[1]*(M+1) for _ in range(N+1)]
for i, S in enumerate(Ss, 1):
    for j, T in enumerate(Ts, 1):
        dp[i][j] = dp[i-1][j] + dp[i][j-1]
        if S != T:
            dp[i][j] -= dp[i-1][j-1]
        dp[i][j] %= MOD

print(dp[-1][-1])
### BUGGY CODE ###

import sys

def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N,K = MI()
A = [0] + LI()


dp1 = [[0]*K for _ in range(N+1)]  # dp1[i][j] = A1~Aiを用いてjを作れるか
dp1[0][0] = 1
for i in range(1,N+1):
    a = A[i]
    for j in range(K):
        if j >= a:
            dp1[i][j] = dp1[i-1][j] | dp1[i-1][j-a]
        else:
            dp1[i][j] = dp1[i-1][j]

dp2 = [[0]*K for _ in range(N+2)]  # dp2[i][j] = Ai~ANを用いてjが作れるか
dp2[N+1][0] = 1
for i in range(N,0,-1):
    a = A[i]
    for j in range(K):
        if j >= a:
            dp2[i][j] = dp2[i+1][j] | dp2[i+1][j-a]
        else:
            dp2[i][j] = dp2[i+1][j]

from itertools import accumulate

ans = 0
for i in range(1,N+1):
    B = list(accumulate(dp2[i+1]))
    for j in range(0,K):
        if j < K-A[i]:
            if dp1[i-1][j] & (B[K-1-j]-B[K-A[i]-j-1] > 0):
                ans += 1
                break
        else:
            if dp1[i-1][j]:
                ans += 1
                break

print(N-ans)


### FIXED CODE ###

import sys

def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり


N,K = MI()
A = LI()
A.sort()


def f(n):  # Anが必要か否か
    B = [0] + [A[i] for i in range(N) if i != n]
    dp = [[0]*K for _ in range(2)]  # dp[i][j] = B1~Biを用いてjを作れるか(メモリ節約のため工夫してる)
    dp[0][0] = 1
    for i in range(1,N):
        b = B[i]
        for j in range(K):
            if j >= b:
                dp[i%2][j] = dp[1-i%2][j] | dp[1-i%2][j-b]
            else:
                dp[i%2][j] = dp[1-i%2][j]
    if sum(dp[(N-1) % 2][j] for j in range(max(K-A[n],0),K)) != 0:
        return True
    else:
        return False


left = -1  # 不必要
right = N  # 必要
while left + 1 < right:
    mid = (left + right)//2
    if f(mid):
        right = mid
    else:
        left = mid

print(right)
### BUGGY CODE ###

n = int(input())
words = []
cnt = 0
for _ in range(n):
    s = list(input())
    ss = sorted(s)

    if ss in words:
       cnt += words.count(ss)
    words.append(ss)

print(cnt)

### FIXED CODE ###

n = int(input())
ss = list(''.join(sorted(list(input()))) for _ in range(n))
words = {}
cnt = 0

for s in ss:
    if s in words:
        cnt += words[s]
        words[s] += 1
    else:
        words[s] = 1
print(cnt)
### BUGGY CODE ###


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

# アレイ import numpy as np =np.array(list(map(float,input().split())))

# 文字列 =list(str(input()).split(" " or ","))

# 一文字＆連番(縦横可能) =map(int, open(0).read().split())

# 2-d list
lis=[[] for _ in range(M)]
for i in range(M):
    lis[i] = list(map(int,input().split()[0:]))

# Each list
N = int(input())
a = [0] * N
b = [0] * N
c = [0] * N
for i in range(N):
    a[i], b[i], c[i] = map(int, input().split())
"""

import math
a,b,n=map(int,input().split())
kai=[]
for i in range(b,n+1,b):
    k=math.floor(a*i/b)-a*math.floor(i/b)
    kai.append(k)
    k=math.floor(a*(i-1)/b)-a*math.floor((i-1)/b)
    kai.append(k)

if len(kai)==0:
    kai.append(math.floor(a*n/b)-a*math.floor(n/b))
print(max(kai))


### FIXED CODE ###

a, b, n = list(map(int, input().split()))
x = min(b - 1, n) # b-1がいいけど、上限 nの制約あり
ans = int(a * x / b)
print(ans)
### BUGGY CODE ###

import bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        minc = L[a] + L[b]
        indc = bisect.bisect_left(L[b+1:], minc)
        ans += max(indc, 0)

print(ans)


### FIXED CODE ###

import bisect

N = int(input())
L = list(map(int, input().split()))
L.sort()

ans = 0
for i in range(N-2):
    a = L[i]
    for j in range(i+1, N-1):
        b = L[j]
        ans += bisect.bisect_left(L, a+b) - j - 1

print(ans)
### BUGGY CODE ###

n,m = map(int,input().split())
dic={}
P,Y = [],[]
for i in range(m):
  p,y = map(int,input().split())
  P.append(p)
  Y.append(y)
  target = dic.get(p) if dic.get(p)!=None else []
  target.append(y)
  dic[p] = target

def fill_zero(num):
  s = str(num)
  dif = 6-len(s)
  return '0'*dif+s
  
for i in range(m):
  li = sorted(dic[P[i]])  
  ord = li.index(Y[i])+1
  print(fill_zero(P[i])+fill_zero(ord))
  
  

### FIXED CODE ###

N, M = map(int, input().split())
D = [[] for i in range(N)]
 
for i in range(M):
  p, y = map(int, input().split())
  D[p-1].append((y, i)) 

ans = [None]*M
 
for i, d in enumerate(D): 
  d.sort()
  for k, (y, j) in enumerate(d): 
    ans[j] = str(i+1).zfill(6) + str(k+1).zfill(6)
print(*ans, sep = '\n')
### BUGGY CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
????????????
?????? n ?????°??? A ??¨??´??° m ???????????????A ???????´?????????????????????????????´?????¶????????????????
m ???????????????????????????????????????????????°????????????????????????????????????
AA ??????????´???????????????????????????¨?????§????????????

??°??? A ??????????????????????????§???????????¨?????? q ?????? mi ????????????????????§???
???????????????????????? "yes" ????????? "no" ??¨???????????????????????????

n ??? 20 ; q ??? 200 ; 1 ??? A???????´? ??? 2000 ; 1 ??? Mi ??? 2000

"""
def kenzan(m, n, A):

    if m < A[0]:
        return -1

    # ?????????????????§????????°???????????£????????????
    total = 0
    nA = []
    for i in range(n):
        if A[i] == m:
            return 0
#        print("{} m:{} x:{} total:{}".format(nA,m,A[i], total))
        if A[i] > m:
            break
        nA.append(A[i])
        total += A[i]

    if m > total:
        return -1

    n =len(nA)
    l = 2 ** n
    for i in range(1,l):
        c = 0
        bi = "{0:0<{width}b}".format(i,width=n)
        bi = bi[::-1]
#        print("{0:2}[{1}] m[{2:4}] {3}".format(i, bi,m, n))
        for j in range(n):
#            print("\tj:{} bi:{} Aj[{:4}]".format(j, bi[j], A[j]))
            if bi[j] == "1":
                x = c + nA[j]
#                print("\tm[{:4}] c+Aj[{:4}] c[{:4}] j:{} Aj[{:4}]".format(m, x, c, j, A[j]))
                if x == m:
                    return 0
                elif x > m:
#                    print("BAD")
                    break
                else:
                    c = x
    return -1
 
def main():
    """ ????????? """
    n = int(input())
    A = sorted(map(int,input().split()))
    q = int(input())
    M = list(map(int,input().split()))

    for i in range(q):

        if kenzan(M[i], n, A) == 0:
            print("yes")
        else:
            print("no")


if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
????????????
?????? n ?????°??? A ??¨??´??° m ???????????????A ???????´?????????????????????????????´?????¶????????????????
m ???????????????????????????????????????????????°????????????????????????????????????
AA ??????????´???????????????????????????¨?????§????????????

??°??? A ??????????????????????????§???????????¨?????? q ?????? mi ????????????????????§???
???????????????????????? "yes" ????????? "no" ??¨???????????????????????????

n ??? 20 ; q ??? 200 ; 1 ??? A???????´? ??? 2000 ; 1 ??? Mi ??? 2000

"""

def main():
    """ ????????? """
    n = int(input())
    A = sorted(map(int,input().split()))
    q = int(input())
    M = list(map(int,input().split()))
    g = 0

    tA = []
    l = 2 ** n
    for i in range(1,l):
        c = 0
        bi = "{0:0{width}b}".format(i,width=n)
        bi = bi[::-1]
        for j in range(n):
            if bi[j] == "1":
                c += A[j]
        tA.append(c)
#    tA.sort()

    for mi in M:
        if mi in tA:
            print("yes")
        else:
            print("no")

if __name__ == '__main__':
    main()
### BUGGY CODE ###

#import numpy as np

N = int(input())
A = list(map(int, input().split()))
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

#K = int(input())
#S = input()

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
#mod = np.array([[-1 for i in range(N)] for i in range(N)])
#A = list(set(A))
A = sorted(A)#わるほう

kouho = list(A.copy())#わられるほう
target = list(set(A))
#print(A)

for i in range(1,len(kouho)):
    if (kouho[max(0,i-1)]==kouho[i]):
        if kouho[i] in target:
            target.remove(kouho[i])
            
kouho = sorted(target.copy())

for i in range(len(A)):
    for j in range(0, len(target)):
        if target[j] <= A[i]:
            continue
        elif  target[j] in kouho:
            if target[j] % A[i] == 0:
                #print(target[j], A[i])
                kouho.remove(target[j])
    target = list(kouho.copy())
    if target == []:
        break
        
print(len(target))

### FIXED CODE ###

#import numpy as np

N = int(input())
A = list(map(int, input().split()))
A.sort()#わるほう

#kouho = sorted([x for x in set(A) if A.count(x) == 1])
#maxA = 10**5

#target = kouho[:]
maxA = A[-1]
work=[0]*(A[-1]+1)

for i in range(len(A)):
    if work[A[i]]<=1:
        maxN = int(maxA/A[i])
        for n in range(1,maxN+1):
            buf = A[i]*n
            #remove_list.append(buf)
            work[buf]+=1
                #print(A[i]*n)

#target = kouho[:]
#kouho = list(set(kouho) - set(remove_list))

sm=0
for s in A:
    if work[s]==1: sm+=1
print(sm)

#print(len(kouho))
### BUGGY CODE ###

N,Q=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N-1)]
PX=[list(map(int,input().split())) for i in range(Q)]

eda=[[] for i in range(N+1)]

pt= [0 for i in range(N+1)]
for a,b in AB:
    eda[a].append(b)
    eda[b].append(a)
for p,x in PX:
    pt[p]+=x
eda=[sorted(i) for i in eda]

stack=[[1,eda[1]]]
v=set()
v.add(1)
while stack:
    while stack[-1][1]:
        a=stack[-1][1].pop()
        if not a in v:
            v.add(a)
            pt[a]+=pt[stack[-1][0]]
            stack.append([a,eda[a]])
    stack.pop()
print(" ".join(list(map(str,pt[1:]))))


### FIXED CODE ###

N,Q=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N-1)]
PX=[list(map(int,input().split())) for i in range(Q)]

eda=[[] for i in range(N+1)]

pt= [0 for i in range(N+1)]
for a,b in AB:
    eda[a].append(b)
    eda[b].append(a)
for p,x in PX:
    pt[p]+=x


stack=[[1,eda[1]]]
v=set()
v.add(1)
while stack:
    while stack[-1][1]:
        a=stack[-1][1].pop()
        if not a in v:
            v.add(a)
            pt[a]+=pt[stack[-1][0]]
            stack.append([a,eda[a]])
    stack.pop()
print(" ".join(list(map(str,pt[1:]))))
### BUGGY CODE ###

import numpy as np
N = int(input())
A = np.prod(list(map(int, input().split())))
cnt = 0
while A%2==0:
    cnt+=1

print(int(cnt//N))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
cnt = 0
ans = []
for i in range(N):
    while A[i]%2==0:
        A[i] /=2
        cnt += 1
    ans.append(int(cnt))
    cnt = 0
        
print(min(ans))
### BUGGY CODE ###

n = int(input())
p = [i for i in range(1, n)]
print(sum(p))

### FIXED CODE ###

n = int(input())
a = n*(n-1)//2
print(a)
### BUGGY CODE ###

N=int(input())
array=input().split(" ")
sum=1
for i in range(N):
  sum=sum*int(array[i])
if sum>1000000000000000000:
	sum=-1
    

print(sum)

### FIXED CODE ###

N=int(input())
array=input().split(" ")
sum=1
for j in range(N):
  if array[j]=="0":
    sum=0
if sum!=0:
  for i in range(N):
    sum=sum*int(array[i])
    if sum>1000000000000000000:
        sum=-1
        break
    else:
      continue
    break
print(sum)
### BUGGY CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, K, *P = map(int, read().split())

P_ = [0] * N
for i in range(N):
    P_[i] = (1 + P[i]) / 2

ans = 0

for i in range(N - K + 1):
    acc = sum(P_[i:i + K])
    ans = max(ans, acc)

print(ans)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, K, *P = map(int, read().split())

P_ = [0] * N

acc = sum(P[:K])
ans = (acc + K) / 2

for i in range(N - K):
    acc -= P[i]
    acc += P[i + K]
    ans = max(ans, (acc + K) / 2)

print(ans)