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

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

t = []
for i in range(len(p)-k+1):
    t.append(sum(p[i:i+k]))
ind = t.index(max(t))

max_pair = p[ind:ind+k]
exp = []
for i in max_pair:
    sums=0
    for j in range(1,i+1):
        sums += j/i
    exp.append(sums)
print(sum(exp))

### FIXED CODE ###

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

exp = [(1+i)/2 for i in p]

s = []
sums = 0
for i in exp:
    sums += i
    s.append(sums)

exps = [s[k-1]]
for i in range(k,len(p)):
    exps.append(s[i] - s[i-k])
print(max(exps))
### BUGGY CODE ###

N = int(input())
S = input()

lis = [0 for _ in range(1000)]

for i in range(N-2):
  for j in range(i+1, N-1):
    for k in range(j+1, N):
      lis[100*int(S[i])+10*int(S[j])+int(S[k])] = 1
      
print(sum(lis))

### FIXED CODE ###

N = int(input())
S = input()
numbers=[str(i).zfill(3) for i in range(1000)]
 
count=0
for num in numbers:
  j=0
  for i in range(N):
    if num[j]==S[i]:
      j+=1
      if j==3:
        count+=1
        break
print(count)
### BUGGY CODE ###

import sys

n = input()
for i2 in range(n):
    seq1 = raw_input()
    seq2 = raw_input()

    a,b = len(seq1), len(seq2)
    x1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = seq1[i]
        x2 = x1
        x1 = [0 for i in range(b+1)]
        for j in range(b):
            if e1 == seq2[j]:
                x1[j+1]=x2[j] + 1
            else:
                x1[j+1]=max(x2[j+1], x1[j])
    print x1[-1]

### FIXED CODE ###

import sys

def longestcommonsubsequence():
    seq1 = raw_input()
    seq2 = raw_input()

    a, b = len(seq1), len(seq2)
    x1 = [0 for i in range(b+1)]
    for i in range(a):
        e1 = seq1[i]
        x2 = x1+[]
        #x1 = [0 for i2 in range(b+1)]
        for j in range(b):
            if e1 == seq2[j]:
                x1[j+1] = x2[j] + 1
            elif x1[j+1]<x1[j]:
                x1[j+1] = x1[j]
    return x1[-1]

n = input()
for i2 in range(n):

    print longestcommonsubsequence()
### BUGGY CODE ###

import numpy as np

def solv_quadratic_equation(a, b, c):
    """ 2次方程式を解く  """
    if b**2 - 4*a*c>=0:
        D = (b**2 - 4*a*c) ** (1/2)
        x_1 = (-b + D) / (2 * a)
        x_2 = (-b - D) / (2 * a)

        return x_1, x_2
    else:
        return 0,0

def f(n):
    count = 0
    x_max = int(np.sqrt(n/6)//1)
    for x in range(1,x_max+1):
        y_max = int(np.sqrt((n-x**2-2*x)/3)//1)
        for y in range(x,y_max+1):
            z_1,z_2 = solv_quadratic_equation(1,x+y,x**2+y**2+x*y-n)
            zs = [int(z_1),int(z_2)]
            if zs[0] == zs[1]:
                if zs[0]>=y and x**2+y**2+zs[0]**2+x*y+y*zs[0]+zs[0]*x == n:
                    if x==y and y==zs[0]:
                        count += 1
                    elif x==y and y<zs[0]:
                        count += 3
                    elif x<y and y==zs[0]:
                        count += 3
                    elif x<y and y<zs[0]:
                        count += 6
            else:
                for z in zs:
                    if z>=y and x**2+y**2+z**2+x*y+y*z+z*x == n:
                        if x==y and y==z:
                            count += 1
                        elif x==y and y<z:
                            count += 3
                        elif x<y and y==z:
                            count += 3
                        elif x<y and y<z:
                            count += 6

            '''
            z_max = int(np.sqrt(n-x**2-y**2-x*y-x-y)//1)
            for z in range(y,z_max+1):
                if x**2+y**2+z**2+x*y+y*z+z*x == n:
            
                    if x==y and y==z:
                        count += 1
                    elif x==y and y<z:
                        count += 3
                    elif x<y and y==z:
                        count += 3
                    elif x<y and y<z:
                        count += 6
            '''

    return count

N = int(input())
if N >=6:
    for i in range(5):
        print(0)
    for i in range(5,N):
        print(f(i+1))
else:
    for i in range(N):
        print(0)

### FIXED CODE ###

import numpy as np
def f(n):
    counts = [0]*n
    x_max = int(np.sqrt(n))
    for x in range(1,x_max+1):
        y_max = int(np.sqrt(n-x**2))
        for y in range(1,y_max+1):
            z_max = int(np.sqrt(n-x**2-y**2))
            for z in range(1,z_max+1):
                if x**2+y**2+z**2+x*y+y*z+z*x <= n:
                    counts[x**2+y**2+z**2+x*y+y*z+z*x-1] += 1
    return counts
 
N = int(input())
counts = f(N)
for i in range(N):
    print(counts[i])
### BUGGY CODE ###

import numpy as np

n = int(input())
a_list = input().split()
a_list = [int(a) for a in a_list]

b_list = input().split()
b_list = [int(b) for b in b_list]

c_list = input().split()
c_list = [int(c) for c in c_list]

a_ar = np.array(a_list)
b_ar = np.array(b_list)
c_ar = np.array(c_list)

a_ar.sort()
b_ar.sort()
c_ar.sort()

b_count = []
for b in b_ar:
    b_count.append(len(c_ar[c_ar>b]))
    
b_count_ar = np.array(b_count)

count = 0
for a in a_ar:
    count += b_count_ar[np.where(b_ar>a)[0]].sum()
    
print(count)

### FIXED CODE ###

import bisect

n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

a = sorted(a)
b = sorted(b)
c = sorted(c)

ans = 0

for x in b:
    aa = bisect.bisect_left(a,x)
    cc = len(c) - bisect.bisect_right(c,x)
    ans += aa * cc

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

n, m = map(int, input().split())
xyz = [tuple(map(int, input().split())) for _ in range(n)]
def isum(i, x, y, z):
    s = 0
    s += x if (i>>0)&1 else -x
    s += y if (i>>1)&1 else -y
    s += z if (i>>2)&1 else -z
    return s
ans = 0
for i in range(2**3):
    dp = [0 for _ in range(m+1)]
    for k in range(n):
        x, y, z = xyz[k]
        ndp = [0 for _ in range(m+1)]
        for j in range(1, m+1):
            # iを含める場合は、一つ前のj-1から
            # iを含めない場合は、一つ前のjから
            sumj_1 = dp[j-1]
            sj_1 = sumj_1 + isum(i, x, y, z)
            noinc_sum = dp[j]
            ndp[j] = max(sj_1, noinc_sum)

        dp = ndp
    ans = max(ans, dp[-1])
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
xyz = [tuple(map(int, input().split())) for _ in range(n)]
ans = 0
from itertools import product
for p in product([-1, 1], repeat=3):
    xyz_ = map(lambda l: l[0]*p[0] + l[1]*p[1] + l[2]*p[2], xyz)
    xyz_ = sorted(xyz_, reverse=True)
    ans = max(ans, sum(xyz_[:m]))
print(ans)
### BUGGY CODE ###

#!/usr/bin/env python3
s = input()
t = 0
d = {t:0}
for i in (ord(x)-ord('a') for x in s) :
	t ^= 1 << i
	c = d[t] if t in d else 1000000
	for j in range(26) :
		if t^(1<<j) in d :
			c = min(c,d[t^(1<<j)]+1)
	d[t] = c
print(d[t] if d[t] else 1)


### FIXED CODE ###

#!/usr/bin/env python3
s = input()
t = 0
d = {t:0}
for i in (ord(x)-ord('a') for x in s) :
	t ^= 1 << i
	d[t] = min(d[t] if t in d else 1000000, min((d[t^(1<<j)] for j in range(26) if t^(1<<j) in d))+1)
print(d[t] if d[t] else 1)
### BUGGY CODE ###

import sys
import Queue

n = int(raw_input())

graph = [[-1 for i in range(0, n)] for j in range(0, n)]
color = [-1 for i in range(0, n)]
for i in range(0, n - 1):
    u, v, w = map(int, raw_input().split(" "))
    # print("%d %d %d" % (u, v, w))
    graph[u-1][v-1] = w
    graph[v-1][u-1] = w

# for i in range(0, n):
#     for j in range(0, n):
#         sys.stdout.write(str(graph[j][i]) + "\t")
#
#     print("")

queue = Queue.Queue()
queue.put(0)
color[0] = 0
sum = 1

while True:
    if sum >= n:
        break

    while True:
        if queue.empty():
            break

        current_node = queue.get()
        for end in range(0, n):
            if graph[current_node][end] > 0 and color[end] < 0:
                color[end] = (color[current_node] + graph[current_node][end] % 2) % 2
                queue.put(end)
                sum += 1

for node in range(0, n):
    print(color[node])


### FIXED CODE ###

import sys
import Queue

n = int(raw_input())

graph = dict()
color = [-1 for i in range(0, n)]
for i in range(0, n - 1):
    u, v, w = map(int, raw_input().split(" "))
    if (u - 1) in graph:
        graph[u - 1].append((v-1, w))
    else:
        graph[u - 1] = [(v-1, w)]

    if (v - 1) in graph:
        graph[v - 1].append((u - 1, w))
    else:
        graph[v - 1] = [(u - 1, w)]

# for start, value_list in graph.items():
#     for end, weight in value_list:
#         print("%s -> %d (%d)" % (start, end, weight))

queue = Queue.Queue()
sum = 0
next_check = 0

while True:
    if sum >= n:
        break

    for i in range(next_check, n):
        if color[i] < 0:
            queue.put(i)
            color[i] = 0
            sum += 1
            next_check = i
            break

    while True:
        if queue.empty():
            break

        current_node = queue.get()
        if current_node in graph:
            for end, weight in graph[current_node]:
                if color[end] < 0:
                    color[end] = (color[current_node] + weight % 2) % 2
                    queue.put(end)
                    sum += 1

for node in range(0, n):
    print(color[node])
### BUGGY CODE ###

def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]


X,Y,Z,K = (int(x) for x in input().split())

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

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

abc = [[0,0,0,A[0]+B[0]+C[0]]]
#next_abc = [[1,0,0],[0,1,0],[0,0,1]]
#print(A[abc[0][0]]+B[abc[0][1]]+C[abc[0][2]])

for i in range(K):
    max_v = 0
    for j in range(len(abc)):
        if abc[j][3] > max_v:
            max_v = abc[j][3]
            temp_j = j
            
    max_abc = abc.pop(temp_j)
    #print(max_abc)
    #print(A[max_abc[0]]+B[max_abc[1]]+C[max_abc[2]])
    print(max_v)
    
    if max_abc[0]<X-1:
        abc.append([max_abc[0]+1,max_abc[1],max_abc[2],A[max_abc[0]+1]+B[max_abc[1]]+C[max_abc[2]]])
    if max_abc[1]<Y-1:
        abc.append([max_abc[0],max_abc[1]+1,max_abc[2],A[max_abc[0]]+B[max_abc[1]+1]+C[max_abc[2]]])
    if max_abc[2]<Z-1:
        abc.append([max_abc[0],max_abc[1],max_abc[2]+1,A[max_abc[0]]+B[max_abc[1]]+C[max_abc[2]+1]])
    abc = get_unique_list(abc)
    #print(abc)


### FIXED CODE ###

def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]


X,Y,Z,K = (int(x) for x in input().split())

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

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

abc = [[0,0,0,A[0]+B[0]+C[0]]]
list_abc = [[0,0,0]]
#next_abc = [[1,0,0],[0,1,0],[0,0,1]]
#print(A[abc[0][0]]+B[abc[0][1]]+C[abc[0][2]])

for i in range(K):
    max_v = 0
    for j in range(len(abc)):
        if abc[j][3] > max_v:
            max_v = abc[j][3]
            temp_j = j
            
    max_abc = abc.pop(temp_j)
    #print(max_abc)
    #print(A[max_abc[0]]+B[max_abc[1]]+C[max_abc[2]])
    print(max_v)
    
    if max_abc[0]<X-1:
        if not([max_abc[0]+1, max_abc[1], max_abc[2]] in list_abc):
            abc.append([max_abc[0]+1,max_abc[1],max_abc[2],A[max_abc[0]+1]+B[max_abc[1]]+C[max_abc[2]]])
            list_abc.append([max_abc[0]+1, max_abc[1], max_abc[2]])
    if max_abc[1]<Y-1:
        if not([max_abc[0], max_abc[1]+1, max_abc[2]] in list_abc):
            abc.append([max_abc[0],max_abc[1]+1,max_abc[2],A[max_abc[0]]+B[max_abc[1]+1]+C[max_abc[2]]])
            list_abc.append([max_abc[0], max_abc[1]+1, max_abc[2]])
    if max_abc[2]<Z-1:
        if not([max_abc[0], max_abc[1], max_abc[2]+1] in list_abc):
            abc.append([max_abc[0],max_abc[1],max_abc[2]+1,A[max_abc[0]]+B[max_abc[1]]+C[max_abc[2]+1]])
            list_abc.append([max_abc[0], max_abc[1], max_abc[2]+1])
    #abc = get_unique_list(abc)
    #print(abc)
### BUGGY CODE ###

N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]
XY.sort()
XY_Y = sorted(XY, key = lambda x: x[1])

def count(x_min, x_max, y_min, y_max, i, j):
    OK = 0
    NG = 0
    a = j - i + 1 - K
    for m in range(i, j + 1):
        if y_min <= XY[m][1] <= y_max:
            OK += 1
        else:
            NG += 1
        if OK >= K:
            return True
        if NG > a:
            return False


ans = 10 ** 20
for i in range(N - 1):
    for j in range(i + K - 1, N):
        for k in range(N):
            for l in range(N):
                if XY[k][1] < XY[l][1]:
                    if count(XY[i][0], XY[j][0], XY[k][1], XY[l][1], i, j):
                        # print ('A')
                        ans = min(ans, (XY[j][0] - XY[i][0]) * (XY[l][1] - XY[k][1]))
print (ans)


### FIXED CODE ###

#PythonだとTLEする
N, K = map(int, input().split())
X = [0] * N
Y = [0] * N
for i in range(N):
    x, y = map(int, input().split())
    X[i] = x
    Y[i] = y

def count(x_min, x_max, y_min, y_max):
    cnt = 0
    for i in range(N):
        if x_min <= X[i] <= x_max and y_min <= Y[i] <= y_max:
            cnt += 1
    return cnt

ans = 10 ** 20
for i in range(N):
    for j in range(N):
        for k in range(N):
            for l in range(N):
                # print ('i, j , k, l = ', i, j, k, l)
                if X[i] < X[j] and Y[k] < Y[l]:
                    if count(X[i], X[j], Y[k], Y[l]) >= K:
                        # print ('A')
                        ans = min(ans, (X[j] - X[i]) * (Y[l] - Y[k]))
print (ans)
### BUGGY CODE ###

from collections import deque
 
def bfs():
  global direction
  d = [0]*n
  que = deque([])
  que.append(0)
  d[0] = 1 #到達済み
  for i in range(10**10):
    if que == []:
      break
    now = que.popleft() 
    if d == [1]*n: #全て到達したら終わり
      break
    for next in g[now]: #部屋1から行ける場所で回す
      if d[next] == 0:
        que.append(next)
        d[next] = 1
        direction[next] = now 
        
n,m = map(int,input().split())
g = [[] for i in range(n)]
direction = [0]*n
for i in range(m):
  a,b = map(int,input().split())
  g[a-1].append(b-1)
  g[b-1].append(a-1)
  
bfs()
print('Yes')
for i in range(1,n):
  print(direction[i]+1)

### FIXED CODE ###

from collections import deque
 
def bfs():
  que = deque([])
  que.append(0)
  
  while que:
    now = que.popleft()
    for next in g[now]: #部屋1から行ける場所で回す
      if d[next] == 0:
        que.append(next)
        d[next] = now +1
        
n,m = map(int,input().split())
g = [[] for i in range(n)]
d = [0]*n
for i in range(m):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  g[a].append(b)
  g[b].append(a)
  
bfs()
print('Yes')
for i in range(1,n):
  print(d[i])
### BUGGY CODE ###

N, M = map(int, input().split(' '))
H = list(map(int, input().split(' ')))
paths = [list(map(int, input().split(' '))) for _ in range(M)]
good_observatory = [True]*N
for i in range(N):
    for path in paths:
        if i == (path[0]-1) and H[i] <= H[path[1]-1]:
            good_observatory[i] = False
        elif i == (path[1]-1) and H[i] <= H[path[0]-1]:
            good_observatory[i] = False

print(sum(boolean for boolean in good_observatory))

### FIXED CODE ###

N, M = map(int, input().split(' '))
H = list(map(int, input().split(' ')))
paths = [list(map(int, input().split(' '))) for _ in range(M)]
good_observatory = [True]*N
for path in paths:
    if good_observatory[path[0]-1] and H[path[0]-1] <= H[path[1]-1]:
        good_observatory[path[0]-1] = False
    if good_observatory[path[1]-1] and H[path[1]-1] <= H[path[0]-1]:
        good_observatory[path[1]-1] = False

print(sum(boolean for boolean in good_observatory))
### BUGGY CODE ###

from heapq import heappop, heappush

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

g = [[10**10 for _ in range(n)] for __ in range(n)]

for _ in range(m):
    l, r, c = map(int, input().split())
    g[l-1][r-1] = min(g[l-1][r-1], c)

for i in range(1, n):
    g[i][i-1] = 0


d = [10**13] * n
d[0] = 0
q = [(0, 0)]
while q:
    dist_u, u = heappop(q)
    if d[u] < dist_u:
        continue
    for v, c in enumerate(g[u]):
        if d[v] > dist_u + c:
            d[v] = dist_u + c
            heappush(q, (d[v], v))


print(d[n-1] if d[n-1] != 10**10 else -1)


### FIXED CODE ###

from heapq import heappop, heappush

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

g = [[] for __ in range(n)]

for _ in range(m):
    l, r, c = map(int, input().split())
    g[l-1].append((r-1, c))

for i in range(1, n):
    g[i].append((i-1, 0))


d = [10**18] * n
d[0] = 0
q = [(0, 0)]
while q:
    dist_u, u = heappop(q)
    if d[u] < dist_u:
        continue
    for v, c in g[u]:
        if d[v] > dist_u + c:
            d[v] = dist_u + c
            heappush(q, (d[v], v))


print(d[n-1] if d[n-1] != 10**18 else -1)
### BUGGY CODE ###

import sys
from collections import deque

H, W = map(int, sys.stdin.readline().split())
cy, cx = map(int, sys.stdin.readline().split())
gy, gx = map(int, sys.stdin.readline().split())

cy -= 1
cx -= 1
gy -= 1
gx -= 1

grid = []
for _ in range(H):
    grid.append(sys.stdin.readline().strip())

q = deque()
# x, y, 累積移動距離, ブロック通過数, ワープ利用数
q.append((cx, cy, 0))
visited_d = {}
visited_e = {}
ans = float("inf")
while q:
    x, y, e = q.popleft()
    if (x, y) in visited_e and visited_e[(x, y)] <= e:
        continue
    visited_e[(x, y)] = e
    # print(x, y, c, d, e)
    for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):
        nx = x + dx
        ny = y + dy
        if 0 <= nx < W and 0 <= ny < H and grid[ny][nx] != "#":
            if nx == gx and ny == gy:
                ans = min(ans, e)
                continue
            q.appendleft((nx, ny, e))
    for dx in range(-2, 3):
        for dy in range(-2, 3):
            if abs(dx) == 1 and dy == 0 or abs(dy) == 1 and dx == 0:
                continue
            nx = x + dx
            ny = y + dy
            # print("warp", dx, dy)
            if 0 <= nx < W and 0 <= ny < H and grid[ny][nx] != "#":
                if nx == gx and ny == gy:
                    ans = min(ans, e+1)
                    continue
                # print("warp append")
                if (nx, ny) not in visited_e:
                    q.append((nx, ny, e+1))

print(-1 if ans == float("inf") else ans)

### FIXED CODE ###

import sys
from collections import deque

H, W = map(int, sys.stdin.readline().split())
cy, cx = map(int, sys.stdin.readline().split())
gy, gx = map(int, sys.stdin.readline().split())

cy -= 1
cx -= 1
gy -= 1
gx -= 1

grid = []
for _ in range(H):
    grid.append(sys.stdin.readline().strip())

q = deque()
# x, y, 累積移動距離, ブロック通過数, ワープ利用数
q.append((cx, cy, 0))
visited_d = {}
visited_e = {}
ans = float("inf")
while q:
    x, y, e = q.popleft()
    if (x, y) in visited_e and visited_e[(x, y)] <= e:
        continue
    visited_e[(x, y)] = e
    # print(x, y, c, d, e)
    for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):
        nx = x + dx
        ny = y + dy
        if 0 <= nx < W and 0 <= ny < H and grid[ny][nx] != "#":
            if nx == gx and ny == gy:
                ans = min(ans, e)
                continue
            if (nx, ny) not in visited_e:
                q.appendleft((nx, ny, e))
    for dx in range(-2, 3):
        for dy in range(-2, 3):
            if abs(dx) == 1 and dy == 0 or abs(dy) == 1 and dx == 0:
                continue
            nx = x + dx
            ny = y + dy
            # print("warp", dx, dy)
            if 0 <= nx < W and 0 <= ny < H and grid[ny][nx] != "#":
                if nx == gx and ny == gy:
                    ans = min(ans, e+1)
                    continue
                # print("warp append")
                if (nx, ny) not in visited_e:
                    q.append((nx, ny, e+1))

print(-1 if ans == float("inf") else ans)
### BUGGY CODE ###

n = int(input())
s = input()
r, g, b = [], [], []
for i in range(n):
    if s[i] == "R":
        r.append(i)
    elif s[i] == "G":
        g.append(i)
    else:
        b.append(i)
ans = len(r)*len(b)*len(g)
tmp = []
for i in r:
    tmp.append(i)
    for j in g:
        tmp.append(j)
        for k in b:
            tmp.append(k)
            a = sorted(tmp)
            if a[1] - a[0] == a[2] - a[1]:
                ans -= 1
            tmp.pop()
        tmp.pop()
    tmp.pop()

print(ans)


### FIXED CODE ###

n = int(input())
s = input()
r, g, b = set(), set(), set()
for i in range(n):
    if s[i] == "R":
        r.add(i)
    elif s[i] == "G":
        g.add(i)
    else:
        b.add(i)

ans = len(r)*len(b)*len(g)
for i in r:
    for j in g:
        chk = j - i
        if chk + j in b:
            ans -= 1
        if i - chk in b:
            ans -= 1
        if (i + j)/2  in b:
            ans -= 1

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

N,Q=map(int,input().split())
S=input()
Z=''
A=[]
for i in range(Q):
    cnt=0
    l,r=map(int,input().split())
    Z=S[l-1:r]
    for t in range(len(Z)-1):
        if Z[t:t+2]=='AC':
            cnt+=1
        else:
            continue
    A.append(cnt)
for a in A:
    print(a)

### FIXED CODE ###

N,Q=map(int,input().split())
S=input()
t=[0]*(N+1)
for i in range(N):
    t[i+1]=t[i]+(1 if S[i:i+2]=='AC' else 0)
for i in range(Q):
    l,r=map(int,input().split())
    print(t[r-1]-t[l-1])
### BUGGY CODE ###

terms = [int(i) for i in input().split(" ")]
scores = [int(i) for i in input().split(" ")]

N = terms[0]
K = terms[1]

tempScore = 1
scoreSet = []

for i in range(N-K+1):
    for j in range(K):
        tempScore *= scores[j+i]
    scoreSet.append(tempScore)
    tempScore = 1

for i in range(len(scoreSet)-1):
    if scoreSet[i] < scoreSet[i+1]:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

terms = [int(i) for i in input().split(" ")]
scores = [int(i) for i in input().split(" ")]

N = terms[0]
K = terms[1]

tempScore = []
scoreSet = []

for i in range(N-K):
    if scores[i] < scores[i+K]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

import numpy as np
N,K = (int(x) for x in input().split())
p1 = np.array(list(map(int, input().split())))
p2 = (p1+1) / 2
p3 = np.array([np.sum(p2[i:i+K]) for i in range(N-K+1)])
print(np.amax(p3))

### FIXED CODE ###

import numpy as np
N,K = (int(x) for x in input().split())
p1 = np.array(list(map(int, input().split())))
s1 = p1.cumsum()
s2 = np.append(0, s1)
p2 = np.array([(s2[i+K] - s2[i]) for i in range(N-K+1)])
max = np.amax(p2)
print((max+K) / 2)
### BUGGY CODE ###

from collections import Counter # 重複個数のカウント: Counter(num_list)
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

    cp_num_list = num_list[:]
    ans = 0

    for i in range(n):
        cp_num_list.pop(i)
        cnt_list = Counter(cp_num_list)
        for v in cnt_list.values():
            if v == 1:
                continue
            ans += comb(v, 2)
        print(ans)
        cp_num_list = num_list[:]
        ans = 0


if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import Counter # 重複個数のカウント: Counter(num_list)

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

    ans_list = [0] * n
    cnt_list = Counter(num_list)
    for k, v in cnt_list.items():
        if v == 1:
            ans_list[k-1] = 0
            continue
        ans_list[k-1] = v * (v-1) // 2
        
    sum_num = sum(ans_list)

    ans = sum_num

    for i in range(n):
        ans -= ans_list[num_list[i]-1]
        if cnt_list[num_list[i]]-1 != 1:
            ans += (cnt_list[num_list[i]]-1) * (cnt_list[num_list[i]]-2) // 2
        print(ans)
        ans = sum_num

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

N = int(input())
char = []
for _ in range(N):
    a = sorted(list(input()))
    char.append("".join(a))

char_count = []
cheack = [0]*N
for i in range(N-1):
    if cheack[i] == 0:
        count = 1
        for k in range(i+1,N):
            if char[i] == char[k]:
                count += 1
                cheack[k] = 1
        if count != 1:
            char_count.append(count)

ans = 0
for hoge in char_count:
    while 0 < hoge:
        hoge -= 1
        ans += hoge 
print(ans)

### FIXED CODE ###

from collections import defaultdict
 
n = int(input())
S = [input() for _ in range(n)]

d = defaultdict(lambda: -1)
for i in range(n):
    s = ''.join(sorted(list(S[i])))
    d[s] += 1
 
ans = 0
for v in d.values():
    ans += v*(v+1)//2
print(ans)