Harryxun/stf_run huggingface dataset:
import math
def combi(n,r):
  ans = math.factorial(N) // (math.factorial(n-r) * math.factorial(r))
  return ans

M = int(input())
N = int(input())

ans = 0
ans += combi(M,2)
ans += combi(N,2)
print(ans)


### FIXED CODE ###

import math
def combi(n,r):
  ans = math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
  return ans

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

ans = 0
if N > 1:
  ans += combi(N,2)
if M > 1:
  ans += combi(M,2)
print(ans)
import math
while True:
    n = int(input())
    if n == 0:
        break
    score = [int(i) for i in input().split(" ")]
    average = sum(score) / n
    print("{:.8f}".format(math.sqrt(sum([(x-average) ** 2]) / n )

### FIXED CODE ###

import math
while True:
    n = int(input())
    if n == 0:
        break
    s = [int(i) for i in input().split(" ")]
    m = sum(s) / n
    print("{:.8f}".format(math.sqrt(sum([(x-m) ** 2 for x in s]) / n)))
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        H, W, A, B = map(int, input().split())

        mergin = 0
        ans = [[0] * W for _ in range(H)]
        cnt_h = 0
        check_1 = [0] * W
        check_0 = [0] * W
        for h in range(H):
            cnt_w = 0
            for w in range(W):
                if w < mergin:
                    check_0[w] += 1
                elif cnt_w < A:
                    ans[h][w] = 1
                    check_1[w] += 1
                    cnt_w += 1
                else:
                    check_0[w] += 1
            cnt_h += 1
            if cnt_h == B:
                mergin += A
                cnt_h = 0

        flag = True
        for w in range(W):
            if min(check_0[w], check_1[w]) != B:
                flag = False
        for h in range(H):
            if min(ans[h].count(0), ans[h].count(1)) != A:
                flag = False
        if flag:
            for h in range(H):
                for w in range(W):
                    print(ans[h][w], end='')
                print()
            exit()

        mergin = 0
        ans = [[0] * W for _ in range(H)]
        cnt_h = 0
        check_1 = [0] * H
        check_0 = [0] * H
        for h in range(W):
            cnt_w = 0
            for w in range(H):
                if w < mergin:
                    check_0[w] += 1
                elif cnt_w < B:
                    ans[h][w] = 1
                    check_1[w] += 1
                    cnt_w += 1
                else:
                    check_0[w] += 1
            cnt_h += 1
            if cnt_h == A:
                mergin += B
                cnt_h = 0

        flag = True
        for w in range(H):
            if min(check_0[w], check_1[w]) != A:
                flag = False
        for h in range(W):
            if min(ans[h].count(0), ans[h].count(1)) != B:
                flag = False
        if flag:
            for h in range(H):
                for w in range(W):
                    print(ans[h][w], end='')
                print()
            exit()


# Run main
if __name__ == '__main__':
    AtCoder().main()


### FIXED CODE ###

def main():
    h,w,a,b=map(int,input().split())
    Ans=[[0]*w for _ in range(h)]
    for x in range(h):
        for y in range(w):
            Ans[x][y]=int((x<b)^(y<a))
    for ans in Ans:
        print(*ans,sep='')
    return
    
if __name__=='__main__':
    main()
n,x=map(int,input().suplit.())
a=list(int(input()) for _ range(n))
print(n+(x-sum(a))//min(a))

### FIXED CODE ###

n,x=map(int,input().split())
a=list(int(input()) for _ in range(n))
print(n+((x-sum(a))//min(a)))
# -*- coding: utf-8 -*-
from pprint import pprint
import itertools

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

rui = [0]
tmp = 0
for a in an:
    rui.append(tmp+a)
    tmp += a


sum_list = [] 

for l in range(1,N+1):
    for r in range(l,N+1):
        tmp = rui[r] - rui[l-1]
        sum_list.append(tmp)

bin_list = [[0 for _ in range(30)] for _ in range(len(sum_list))]

for i,s in enumerate( sum_list):
    tmps = str(bin(s))[2:]
    for j,b in enumerate( reversed(tmps)):
        bin_list[i][j] = int(b)

# pprint(bin_list)

sum_bin = []
for j in range(30):
    tmp_bin = 0
    for i in range(len(sum_list)):
        tmp_bin += bin_list[i][j]
    sum_bin.append(tmp_bin)

# pprint(sum_bin)

max_keta = -1
for i,s in enumerate( sum_bin):
    if s >= K:
        max_keta = i

if max_keta == -1:
    print(0)
    exit()

sub_sum_list = [a for a in sum_list if 2**(max_keta) <= a < 2**(max_keta+1)]

# pprint(sub_sum_list)

ans_list = []
for c in itertools.combinations(sub_sum_list, K):
    ans = c[0]
    for s in c[1:K]:
        ans &= s

    ans_list.append(ans)

if len(ans_list) == 0:
    print(0)
else:
    print(max(ans_list))


### FIXED CODE ###

# -*- coding: utf-8 -*-
from pprint import pprint
import itertools

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

rui = [0]
tmp = 0
for a in an:
    rui.append(tmp+a)
    tmp += a

sum_list = [] 

for l in range(1,N+1):
    for r in range(l,N+1):
        tmp = rui[r] - rui[l-1]
        sum_list.append(tmp)

max_val = max(sum_list)
max_2pow = len(bin(max_val)[2:])
ans = 0
# print(ans,max_2pow)
while max_2pow > 0:
    tmp = ans + 2**(max_2pow-1)
    if sum([1 for v in sum_list if v & tmp == tmp]) >= K:
        ans += 2**(max_2pow-1)
    max_2pow -= 1

print(ans)
date = input()
tdate=()
 
for s in date:
  tdate.insert(s)
  
if tdate(5) != "0":
  mon = int(tdate(5) + tdate(6))
else:
  mon = int(tdate(6))
 
if mon <= 4:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

date = input()
tdate=[]
 
for s in date:
  tdate.append(s)
  
if tdate[5] != "0":
  mon = int(tdate[5] + tdate[6])
else:
  mon = int(tdate[6])


if mon <= 4:
  print("Heisei")
else:
  print("TBD")
import numpy as np
K, X = map(int, input().split())

tmp = X + K
tmp2 = X - K + 1

ans = np.arange(tmp2, tmp)
for i, v in enumerate(ans):
    print(f' {v}', end='') if i > 0 else print(f'{v}', end='')
print('')


### FIXED CODE ###

import numpy as np
K, X = map(int, input().split())

tmp = X + K
tmp2 = X - K + 1

ans = np.arange(tmp2, tmp)
for i, v in enumerate(ans):
    print(' {}'.format(v), end='') if i > 0 else print('{}'.format(v), end='')
print('')
# encoding: utf-8
N, M = list(map(int, input().split()))

# TLE
# Amod = [A for A in map(lambda x: int(x) % M , input().split())]
# ans = 0
# for l in range(len(Amod)):
#     acm = 0
#     for r in range(l, len(Amod)):
#         acm = (acm + Amod[r]) % M
#         if acm == 0: ans += 1

Asym = []

sym = 0
cnt_zero = 0
for i, A in enumerate(map(int, input().split())):
    sym = (sym + A) % M
    if sym > 0: Asym.append(sym)
    else: cnt_zero += 1
        
ans = cnt_zero * (cnt_zero + 1)
# for sym in set(Asym):
#     cnt = Asym.count(sym)
#     ans += cnt * (cnt -  1)
        
print(int(ans / 2))

# speed test

# Acnt = [0 for i in range(M)]
# sym = 0
# for A in map(int, input().split()):
#     sym = (sym + A) % M
#     Acnt[sym] += 1

# print(int(Acnt[0] + sum([cnt * (cnt - 1) for cnt in Acnt]) / 2))


### FIXED CODE ###

# encoding: utf-8

n, k = input().split()

if int(n) % int(k) == 0: print(0)
else: print(1)
D = input()
T = input()
S = input()

D = int(D)
T = int(T)
S = int(S)

if D/S <= T:
  print(Yes)
else:
  print(No)
  

### FIXED CODE ###

D,T,S = map(int, input().split())
if D/S <= T:
  print("Yes")
else:
  print("No")
# %%

n, m = list(map(int, input().split()))
ary = list(map(int, input().split())).sort(reverse=True)
bry = list(map(int, input().split())).sort(reverse=True)
mod = 10 ** 9 + 7

# %%

if len(set(ary)) != len(ary) or len(set(bry)) != len(bry):
    print(0)

else:
    cnt = 1
    i = 0
    j = 0
    for num in range(n * m, 0, -1):
        if (num in ary[i:]) & (num in bry[j:]):
            i += 1
            j += 1
        elif (num in ary[i:]) ^ (num in bry[j:]):
            if num in ary[i:]:
                cnt *= len([b for b in bry if num < b]) % mod
                i += 1
            else:
                cnt *= len([a for a in ary if num < a]) % mod
                j += 1
        else:
            nn = len([a for a in ary if num < a])
            nm = len([b for b in bry if num < b])
            cnt *= (nn * nm - (n * m - num)) % mod

    print(cnt % mod)


### FIXED CODE ###

import sys

# %%

n, m = list(map(int, sys.stdin.readline().split()))
ary = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
bry = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
mod = 10 ** 9 + 7

# %%

if len(set(ary)) != len(ary) or len(set(bry)) != len(bry):
    print(0)

else:
    ary.append(0)
    bry.append(0)

    cnt = 1
    i = 0
    j = 0
    for num in range(n * m, 0, -1):

        if (num == ary[i]) and (num == bry[j]):
            i += 1
            j += 1

        elif (num == ary[i]) or (num == bry[j]):
            if num == ary[i]:
                cnt *= len(bry[:j])
                i += 1
            else:
                cnt *= len(ary[:i])
                j += 1

        else:
            # na = len(ary[:i])
            # nb = len(bry[:j])
            cnt *= (i * j - (n * m - num))

        cnt = cnt % mod

    print(cnt)
#include <cstdio>
#include <vector>
using namespace std;

vector<int> divisor(int m) {
    vector<int> divs;
    for (int i = 1; i*i <= m; i++) {
        if (m % i == 0) {
            divs.push_back(i);
            if (m != i*i) {
                divs.push_back(m / i);
            }
        }
    }
    sort(divs.begin(), divs.end());

    return divs;
}

int main() {
    int n, m;

    scanf("%d%d", &n, &m);
    vector<int> divs = divisor(m);

    for (int i = divs.size()-1; i >= 0; i--) {
        if (divs[i] * n <= m) {
            printf("%d\n", divs[i]);
            break;
        }
    }
    return 0;
}


### FIXED CODE ###

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

p = m // n
while m % p != 0:
    p -= 1

print(p)
n = input()
li = list(n)
same = li[0]*len(li)
if int(n) <= int(same):
    print(same)
else:
    print(str(int(li[0]+1))*len(li))

### FIXED CODE ###

n = input()
li = list(n)
same = li[0]*len(li)
if int(n) <= int(same):
    print(same)
else:
    print(str(int(li[0])+1)*len(li))
N = int(input())
ans = 0
for i in range(1, N + 1, 2):
    cnt = 0
    for j in range(1, i + 1):
        if not i % j: cnt += 1
    if cnt == 8: ans += 1
print(ans)


### FIXED CODE ###

A,B=map(int,input().split())
print(A*B-A-B+ 1)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())

if e - a =<  f:
  print('Yay!')
else
  print(':(')

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())

if e - a <=  f:
  print('Yay!')
else:
  print(':(')
#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    X = [0 for i in range(N)]

    if A[0] != 0:
        print(-1)
        return

    count = 0

    for i in range(N - 1, -1, -1):
        X[i] = X[i + 1] - 1
        if A[i] == X[i]:
            continue

        count += A[i]
        X[i] = A[i]

    print(count)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!python
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    X = [0 for i in range(N)]
    A += [0]
    X += [0]

    count = 0

    if A[0] != 0:
        print(-1)
        return

    for i in range(N - 1, -1, -1):
        if A[i - 1] + 1 < A[i]:
            print(-1)
            return

        X[i] = max(0, X[i + 1] - 1)
        if A[i] == X[i]:
            continue

        count += A[i]
        X[i] = A[i]

    print(count)


if __name__ == '__main__':
    main()
def trace(i, j, S, col, num_color):
    next_col = 1 - col
    num_color[col] += 1
    S[i][j] = 2
    if S[i-1][j] == next_col:
        trace(i-1, j, S, next_col, num_color)
    if S[i][j-1] == next_col:
        trace(i, j-1, S, next_col, num_color)
    if S[i+1][j] == next_col:
        trace(i+1, j, S, next_col, num_color)
    if S[i][j+1] == next_col:
        trace(i, j+1, S, next_col, num_color)
    return num_color[0] * num_color[1]

def main():
    H, W = map(int, input().split())
    # 黒0，白1，padding2
    S = [[2] * (W+2)]
    for _ in range(H):
        S.append([2] + [0 if s == '#' else 1 for s in input()] + [2])
    S.append([2] * (W+2))
    num_comb = 0
    for i in range(1, H+1):
        for j in range(1, W+1):
            if S[i][j] == 0:
                num_color = [0, 0]
                num_comb += trace(i, j, S, 0, num_color)
    print(num_comb)

main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

def trace(i, j, S, col, num_color):
    next_col = 1 - col
    num_color[col] += 1
    S[i][j] = 2
    if S[i-1][j] == next_col:
        trace(i-1, j, S, next_col, num_color)
    if S[i][j-1] == next_col:
        trace(i, j-1, S, next_col, num_color)
    if S[i+1][j] == next_col:
        trace(i+1, j, S, next_col, num_color)
    if S[i][j+1] == next_col:
        trace(i, j+1, S, next_col, num_color)
    return num_color[0] * num_color[1]

def main():
    H, W = map(int, input().split())
    # 黒0，白1，padding2
    S = [[2] * (W+2)]
    for _ in range(H):
        S.append([2] + [0 if s == '#' else 1 for s in input()] + [2])
    S.append([2] * (W+2))
    num_comb = 0
    for i in range(1, H+1):
        for j in range(1, W+1):
            if S[i][j] == 0:
                num_color = [0, 0]
                num_comb += trace(i, j, S, 0, num_color)
    print(num_comb)

main()
X=input("年齢を1から9歳までで入力してください")
if X=3 or X=5 or X=7:
	print("Yes")
    
else:
  print("No")

### FIXED CODE ###

x = int(input())

if x==7 or x==5 or x==3 :
    print("YES")

else :
    print("NO")
a = int(input())
b = int(input())
c = int(input())
n = [a,b,c]
d = (a+b+c)/2
if n.count(int(d)) == 1:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b == c or b+c == a or c+a == b:
  print("Yes")
else:
  print("No")
N = input()
a = input().split()
list_i = [int(b) for b in a]

#print(N)
#print(list_i)

for i in range(N):
  list_i.count(i+1)

### FIXED CODE ###

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

C = collections.Counter(A)
#print(C)

for i in range(N):
  #print(A.count(i+1))
  print(C[i+1])
N = int(input())
    S = [input() for i in range(N)]

    a = b = ab = 0
    ans = 0
    for s in S:
        n = len(s)
        for j in range(n-1):
            if s[j] == "A" and s[j+1] == "B":
                ans += 1
        if s[0] == "B" and s[-1] == "A":
            ab += 1
        elif s[0] == "B":
            b += 1
        elif s[-1] == "A":
            a += 1

    if a == 0 and b == 0:
        print(ans+ab-1)
    else:
        print(ans+ab+min(a, b))

### FIXED CODE ###

#! usr/bin/env python
# -*- coding: utf-8 -*-

from collections import deque
import heapq
import math
import bisect


def main():
    N = int(input())
    S = [input() for i in range(N)]

    a = b = ab = 0
    ans = 0
    for s in S:
        n = len(s)
        for j in range(n-1):
            if s[j] == "A" and s[j+1] == "B":
                ans += 1
        if s[0] == "B" and s[-1] == "A":
            ab += 1
        elif s[0] == "B":
            b += 1
        elif s[-1] == "A":
            a += 1

    if ab == 0:
        print(ans+min(a, b))
    elif a == 0 and b == 0:
        print(ans+ab-1)
    else:
        print(ans+ab+min(a, b))


if __name__ == '__main__':
    main()
code = input()

if code == SSS:
    print(0)
elif code == SSR or SRS or RSS or RSR:
    print(1)
elif code == SRR or RRS:
    print(2)
else:
    print(3)

### FIXED CODE ###

x, y ,z = input()
if  x == "S" and y == "S" and z == "S":
    print(0)
elif x =="S" and y=="R" and z=="R":
    print(2)
elif x=="R" and y=="R" and z=="S":
    print(2)
elif x=="R" and y=="R" and z=="R":
    print(3)
else:
    print(1)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N, M = map(int, input().split())
graph = [ [0 for _ in range(M)] for _ in range(M) ]
visited = [False] * M

for i in range(N):
    a, b = map(int, input().split())
    graph[a-1][b-1] = 1
    graph[b-1][a-1] = 1

#print(graph)

# u は 0-index
def dfs(u):
    visited[u] = True
    if False in visited:
        pass
    else:
        return 1

    count = 0
    for i in range(N):
        if graph[u][i] == False: continue
        if visited[i]: continue

        visited[i] = True
        count += dfs(i)
        visited[i] = False

    return count

count = dfs(0)
print(count)

### FIXED CODE ###


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

# N = 頂点の数(= 数字の数)
# M = 辺の数(= aの行数)

N, M = map(int, input().split())
graph = [ [0 for _ in range(N)] for _ in range(N) ]
visited = [False] * N

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1][b-1] = 1
    graph[b-1][a-1] = 1

#print(graph)

# u は 0-index
def dfs(u):
    visited[u] = True
    if False in visited:
        pass
    else:
        return 1

    count = 0
    for i in range(N):
        if graph[u][i] == False: continue
        if visited[i]: continue

        visited[i] = True
        count += dfs(i)
        visited[i] = False

    return count

count = dfs(0)
print(count)
s=input()

if s[3]==s[4] and s[5]==s[6]
	print("sはcoffeeと似ています")
	else
    print("sはcoffeeと似ていません")

### FIXED CODE ###

s = input()

if((s[2]==s[3]) and (s[4]==s[5])):
  	print("Yes")
else:
	print("No")
n = int(input())
a = list(map(int,input().split()))
dist = [0]*max(a)
ans = sum(a)
for i in a:
    dist[i-1] += 1

q = int(input())
for i in range(q):
    b,c = map(int,input().split())
    if dist[b-1] != 0:
        dist[c-1] += dist[b-1]
        ans += dist[b-1] * (c-b)
        dist[b-1] = 0
    print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
dist = [0]*100000
ans = sum(a)
for i in a:
    dist[i-1] += 1

q = int(input())
for i in range(q):
    b,c = map(int,input().split())
    if dist[b-1] != 0:
        dist[c-1] += dist[b-1]
        ans += dist[b-1] * (c-b)
        dist[b-1] = 0
    print(ans)
n = int(input())
wordlist = [input() for i in range(n)]
wordtuple = tuple(set(wordlist))
ans = []
a = len(wordtuple)
for j in range(a) :
    checklist.append(wordlist.count(wordtuple[j]))
anslist = [i for i, v in enumerate(checklist) if v == max(checklist)]
for k in range(len(anslist)) :
    ans.append(wordtuple[k])
ans.sort()
for l in range(len(ans)) :
    print(ans[l])

### FIXED CODE ###

n = int(input())
d = {}
for i in range(n) :
    s = input()
    if s not in d :
        d[s] = 1
    else :
        d[s] += 1
m = max(d.values())
ans = []
for i in d :
    if d[i] == m :
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
n,s = int(raw_input()),map(int,raw_input().split())
s.sort(key = x:-x)
print sum(s[1:n:2]) - sum(s[2:n:2])

### FIXED CODE ###

n,s = int(raw_input()),map(int,raw_input().split())
s.sort(key = lambda x:-x)
print sum(s[0:n:2]) - sum(s[1:n:2])
a,b= input().split("")
if a=="H"and b=="H":
    print("H")
elif a=="H" and b=="D":
    print("D")
elif a=="D" and b=="D":
    print("H")
else:
    print("D")

### FIXED CODE ###

a, b = input().split()
if a == "H"and b == "H":
    print("H")
elif a == "H" and b == "D":
    print("D")
elif a == "D" and b == "D":
    print("H")
else:
    print("D")
def search(node, searched, goal):
  if searched == goal:
    return 1
  v = 0
  for nei in edges[node]:
    if searched & (1 << nei):
      continue
    v += search(nei, searched | (1<<nei), goal)
    
  return v
n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for i in range(n):
  a, b = map(lambda x: int(x) - 1, input().split())
  edges[a].append(b)
  edges[b].append(a)
print(search(0, 1, (1<<n) - 1))


### FIXED CODE ###

def search(node, searched, goal):
  if searched == goal:
    return 1
  v = 0
  for nei in edges[node]:
    if searched & (1 << nei):
      continue
    v += search(nei, searched | (1<<nei), goal)
    
  return v

n, m = map(int, input().split())
edges = [[] for _ in range(n)]
for i in range(m):
  a, b = map(lambda x: int(x) - 1, input().split())
  edges[a].append(b)
  edges[b].append(a)
print(search(0, 1, (1<<n) - 1))
t,x = map(float,input().split())
print(t/x)


### FIXED CODE ###

t,x=map(int,input().split())
print(t/x)
a,b,n = map(int,input().split())
import math
if n < b:
    print(int(math.floor(a*n/b) - a*np.floor(n/b)))
else:
    print(int(math.floor(a*(b-1)/b) - a*np.floor((b-1)/b)))

### FIXED CODE ###

a,b,n = map(int,input().split())
import math
if n < b:
    print(int(math.floor(a*n/b) - a*math.floor(n/b)))
else:
    print(int(math.floor(a*(b-1)/b) - a*math.floor((b-1)/b)))
N, M= map(int, input().split())
zahyo = []
for i in map(int,input().split()):
    zahyo += [i]
sum=0
#マージソート用関数
# merge(p, q): あらかじめソートされた配列 p と q をまとめる。
def merge(p,q):
    result=[]
    i,j=0,0
    #p[i]とq[j]を比べて小さい方をresultに加える。
    while i<len(p) and j<len(q):
        #.appendで加える。小さかった方の数字を一つ進める。
        #これで小さいものから順にresultに加えることができる。
        if p[i] <= q[j]:
            result.append(p[i])
            i+=1
        else:
            result.append(q[j])
            j+=1

    #片方の配列が全て比較済みとなると、そこで上のwhile分は終了してしまう
    #なのでまだ比較していない要素が残っている配列をそのままresultに連結する
    #これは.extendを使う。まだ比較していない要素はスライスで簡単に分けることができる。
    if i<len(p):
        result.extend(p[i:])
    if j<len(q):
        result.extend(q[j:])
    #resultを返して終了
    return result

# mergesort(a): 配列 a をマージソートしたものを返す。
def mergesort(a):
    #要素が一つになるまで分割したらそれ自体を返す。
    if len(a)==1:
        return a
    #最初の半分を切り取ってソート
    p=mergesort(a[:len(a)//2])
    #残りの半分を切り取ってソート
    q=mergesort(a[len(a)//2:])
    #merge関数で連結させる
    return merge(p,q)

mergesort(zahyo)
gap = []
for i in range(M-1):
    gap += [zahyo[i+1]-zahyo[i]] 
mergesort(gap)
if N >= M:
    print(0)
elif N == 1:
    print(zahyo[M-1] - zahyo[0])
else:
    for i in gap[N-1:]:
        sum += i
    print(sum)

### FIXED CODE ###

N, M= map(int, input().split())
zahyo = []
for i in map(int,input().split()):
    zahyo += [i]
sum=0
#マージソート用関数
# merge(p, q): あらかじめソートされた配列 p と q をまとめる。
def merge(p,q):
    result=[]
    i,j=0,0
    #p[i]とq[j]を比べて小さい方をresultに加える。
    while i<len(p) and j<len(q):
        #.appendで加える。小さかった方の数字を一つ進める。
        #これで小さいものから順にresultに加えることができる。
        if p[i] <= q[j]:
            result.append(p[i])
            i+=1
        else:
            result.append(q[j])
            j+=1

    #片方の配列が全て比較済みとなると、そこで上のwhile分は終了してしまう
    #なのでまだ比較していない要素が残っている配列をそのままresultに連結する
    #これは.extendを使う。まだ比較していない要素はスライスで簡単に分けることができる。
    if i<len(p):
        result.extend(p[i:])
    if j<len(q):
        result.extend(q[j:])
    #resultを返して終了
    return result

# mergesort(a): 配列 a をマージソートしたものを返す。
def mergesort(a):
    #要素が一つになるまで分割したらそれ自体を返す。
    if len(a)==1:
        return a
    #最初の半分を切り取ってソート
    p=mergesort(a[:len(a)//2])
    #残りの半分を切り取ってソート
    q=mergesort(a[len(a)//2:])
    #merge関数で連結させる
    return merge(p,q)

if M==1:
    print(0)
else:
    zahyo = mergesort(zahyo)
    gap = []
    for i in range(M-1):
        gap += [zahyo[i+1]-zahyo[i]] 
    gap = mergesort(gap)
    if N >= M:
        print(0)
    else:
        for i in gap[:M-N]:
            sum += i
        print(sum)
import math

S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = (C * D) // math.gcd(C, D)

X = (B//C)-((A-1)//C)
Y = (B//D)-((A-1)//D)
Z = (B//E)-((A-1)//E)

print(B-A+1-X-Y+Z)



### FIXED CODE ###


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

 #最小公倍数


def lcm(a, b):
    return a*b//gcd(a, b)


S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = lcm(C, D)

X = int(B//C)-int((A-1)//C)
Y = int(B//D)-int((A-1)//D)
Z = int(B//E)-int((A-1)//E)

print(B-A+1-X-Y+Z)
n = int(input())
p = list(map(int, input().split()))
p.sort(reverse=True)
a = p[1:]
b = p[0] // 2
print(sum(a, b))

### FIXED CODE ###

D = int(input())
if D == 25:
    print("Christmas")
else:
    E = 25 - D
    print("Christmas" + " " +  "Eve " * E)