peterverebics/CodeNet_Python_118 huggingface dataset:
n,m=map(int,input().split())
print((n*(n-1)+m*(m-1))//2)
N, M = map(int, input().split())
a = N * (N - 1) / 2
b = M * (M - 1) / 2
print(int(a + b))
#!/usr/bin/env python3

def main():
    N, M = map(int, open(0).read().split())
    T = N * (N-1) / 2 + M * (M-1) / 2
    print(int(T))

main()
from collections import defaultdict,deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))

n, m = inpl()
ans = n * (n - 1)//2 + m * (m - 1)//2
print(ans)
N, M = map(int,input().split())
print((N+M)*(N+M-1)//2-N*M)
n,m = map(int,input().split())

print(int(n*(n-1)/2 + m*(m-1)/2))
# -*- coding: utf-8 -*-
import math

# スペース区切りの整数の入力
b, c = map(int, input().split())
# 文字列の入力
def combinations_count(n, r):
    return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

print(int(combinations_count(b+c, 2)-b*c))
import math
N,M=map(int, input().split())
def comb(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))
try :
    base = comb(N,2)
except:
    base=0
def comb2(M, r):
    return math.factorial(M) // (math.factorial(M - r) * math.factorial(r))
try:
    base2 = comb2(M,2)
except:
    base2=0

print(base+base2)
n, m = map(int, input().split())

num = n * (n - 1) // 2
num += m * (m - 1) // 2
print(num)
n,m = [int(x) for x in input().split(" ")]
ans = (n*(n-1)//2) + (m*(m-1)//2)
print (ans)
N, M = map(int, input().split())
print( int((N * (N - 1) + M * (M - 1)) * 0.5))
a = input().split()
N = int(a[0])
M = int(a[1])

answer = (N*(N-1) / 2) + (M*(M-1) / 2)

print(int(answer))
import math
N, M = map(int, input().split())
print(int(math.factorial(N+M)/(math.factorial(N+M-2)*2)-N*M))
n, m = (int(i) for i in input().split())

tot = n * (n - 1) // 2 + m * (m - 1) // 2

print(tot)
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N, M = map(int, input().split())
print(N * (N - 1) // 2 + M * (M - 1) // 2)
n,m = map(int,input().split())

od_od = n*(n-1)/2
ev_ev = m*(m-1)/2
print(int(od_od+ev_ev))
N,M = list(map(int,input().split()))
print(N*(N-1)//2+M*(M-1)//2)
n,m=map(int,input().split())
ans=0
ans+=n*(n-1)//2
ans+=m*(m-1)//2
print(ans)
N, M = map(int, input().split())

P = 0

if N >= 2:
    for i in range(N - 1):
        for j in range(N - 1 - i):
            P = P + 1

if M >= 2:
    for i in range(M - 1):
        for j in range(M - 1 - i):
            P = P + 1

print(P)
n, m = map(int, input().split())
print((n*(n-1) + m*(m-1))//2)
import math
import itertools
N,M = input().split()
N1=int(N)
M1=int(M)
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if N1>=2:
    n=combinations_count(N1,2)
else:
    n=0
if M1>=2:
    m=combinations_count(M1,2)
else:
    m=0
print(n+m)
N, M = list(map(int, input().split()))

print(int(N*(N-1)/2 + M*(M-1)/2))
n, m = map(int, input().split())
a=(n*(n-1))/2+(m*(m-1))/2
a=int(a)
print(a)
[N,M] = list(map(int,input().split()))

if N<=1:
    countN = 0

    if M <=1:
        countM = 0
    else:
        countM = (M*(M-1))/2


elif N>=2:
    countN = (N*(N-1))/2

    if M <=1:
        countM = 0
    else:
        countM = (M*(M-1))/2

print(int(countN + countM))
import sys
X,Y = map(int,input().split())
if(X == 1 and Y == 1):
    print(0)
    sys.exit()
elif(Y == 1):
    print(int(X/2))
    sys.exit()
elif(X == 0 and Y ==2):
    print(1)
    sys.exit()
print(int((X * (X-1))/2 + Y))
n,m = map(int,input().split())
print(n*(n-1)/2+m*(m-1)/2)
s = input()
n = len(s)
if(s==s[::-1] and s[:(n-1)//2]==s[:(n-1)//2][::-1]): print('Yes')
else: print('No')
N,M=map(int,input().split())
print(N*(N-1)/2+M*(M-1)/2)
N,M=map(int, input().split())
print((N+M)*(N+M-1)/2-N*M)
N,M = map(int, input().split())
print(((N * (N - 1)) / 2 ) + ((M * (M - 1)) / 2 ))
N,M = map(int,input().split())
print(N*(N-1)/2+M*(M-1)/2)
n,m=map(int, input().split())

num1=n*(n-1)*0.5
num2=m*(m-1)*0.5
import math
a=0
b=3
answer = 0

#偶数2
if a != 0:
    answer += math.factorial(a) / (math.factorial(a - 2)*2)

#奇数2
if b != 0:
    answer += math.factorial(b) / (math.factorial(b - 2)*2)

print(int(answer))
import sys
input = sys.stdin.readline

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

print(N*(N-1) + M*(M-1))
n,m=map(int,input().split())
x=n*(n-1)/2+m*(m-1)/2
print(x)
N, M = map(int, input().split())
result = (N+M)*(N+M-1)/2 - N*M
print(result)
n,m=map(int,input().split())

if n<2 and m<2:
  print(0)
else:
  print(n*(n-1)/(2)+m*(m-1)/2)
val = input().split(' ')
n = int(val[0])
m = int(val[1])

result = n * (n-1) / 2 + m * (m-1) / 2

print(result)
n,m=map(int,input().split())
if(n+m>=2):

    print((n*(n-1)/2)+(m*(m-1)/2))
n,m = map(int,input().split())
n=n*(n-1)
m=m*(m-1)
print(n/2+m/2)
N,M=map(int,input().split())

print('{}'.format((N*(N-1)/2+(M*(M-1))/2)))
N,M=map(int,input().split())
print(((N*(N-1))/2)+((M*(M-1))/2))
N,M=input().split()
N=int(N)
M=int(M)
print((N*(N-1)/2)+(M*(M-1)/2))
from scipy.misc import comb
N,M = map(int,input().split())
even = comb(N,2)
odd = comb(M,2)
print(int(even + odd))
n, m = map(int, input().split(" "))
print((n*n-1+m*m-1)/2)
from sys import stdin
N, M = [int(x) for x in stdin.readline().rstrip().split()]

#全ての組み合わせのうち、奇数になるもの（奇数 + 偶数）を除く

total = ((N+M)*(N+M-1))/2
odd = N*M

print(total - odd)
N,M= list(map(int,input().split()))
print(N*(N-1)/2+M*(M-1)/2)
N, M = map(int, input().split())

# 偶偶　奇奇

if N != 0 and M != 0:
    ans = int(N * (N - 1) / 2) + int(M * (M - 1) / 2)
elif N == 0:
    ans = M * (M - 1)
elif M == 0:
    ans = N * (N - 1)
print(int(ans))
N,M=map(int,input().split())

if N==1 and M==1:
    print(0)
elif N == 1:
    print(M*(M-1)/2)
elif M == 1:
    print(N*(N-1)/2)
else:
    print(int((M*(M-1)+N*(N-1))/2))
#abc159 a
n,m=map(int,input().split())
ans=n*(n-1)/2+m*(m-1)/2
print(ans)
n,m = list(map(int,input().split()))
output = n*(n-1)/2+m*(m-1)/2
print(output)
a = list(input().split())
a1 = "".join(a)
c = reversed(a)
c1 = "".join(c)


def b():
    if len(a1) <= 5:
        return 0
    if a1 == c1:
        return 1
    else:
        return 0


if b() == 0:
    print("No")
else:
    print("Yes")
n, m = map(int, input().split())
 
ln = [2*i for i in range(1, n+1)]
lm = [2*i+1 for i in range(m)]
 
c = 0
for i in ln:
  for j in lm:
    if (i+j)%2==0:
      c+=1
c+= n*(n-1)/2
c+= m*(m-1)/2
print(c)
N, M=map(int, input().split())
print(N*(N-1)//2, M*(M-1)//2)
N,M=map(int,input().split())
if N >= 2 or M >= 2:
  print(N*(N-1)/2+M*(M-1)/2)
else:
  print(0)
n,m = map(int, input().split())
print(int(((n+m)*(n+m-1)-n*m)/2))
a,b =map(int,input().split())
print(a*(a-1)/2 + b*(b-1)/2)
n, m = list(map(int, input().split()))
lis = []
for i in range(n):
  lis.append(1)
  for i in range(m):
    lis.append(2)
    count = 0
    for i in range(len(lis)):
      for j in range(i + 1, len(lis)):
        if (lis[i] + lis[j]) % 2 == 0:
          count += 1
          print(count)
a, b  = [int(i) for i in input().split()]
x = 0
x = a*(a-1)/2+b*(b-1)/2
print(x)
S=list(input())
countA=0
countB=0
for i in range(3):
    if S[i]=="A":
        countA+=1
    else:
        countB+=1
if countA!=0 and countB!=0:
    print("Yes")
else:
    print("No")
N,M = map(int,input().split())
# ue,sita,uee,sitaa = 0,0,0,0
# tmpN,tmpM = 0,0
# if N != 2:
#     for i in range(N+1):
#         ue *= N-i
#         sita *= N-2-i
#     tmpN = ue/sita
# if M != 2:
#     for i in range(M+1):
#         uee *= N-i
#         sitaa *= N-2-i
#     tmpM = uee/sitaa

# print(tmpN+tmpM)

ans = N*int(N/2) + M*int(M/2)
print(ans)
n,m=map(int,input().split())

if n==1 and m==1:
  print("0")
if n==1 and not m==1:
  print(m*(m-1)/2)
if m==1 and not n==1:
  print(n*(n-1)/2)
if not m==1 and not n==1:
    print(n*(n-1)/2+m*(m-1)/2)
N,M = map(int,input().split())
cnt = 0
cnt += ((N * N-1) / 2)
cnt += ((M * M-1) / 2)
print(cnt)
n,m=map(int,input().split())

print((n+m)*(n+m-1)/2-n*m)
#A
n,m=map(int,input().split())
if n<=1:
    n_ans=0
else:
    n_ans=n*(n-1)/2

if m<=1:
    m_ans=0
else:
    m_ans=m*(m-1)/2
    

print(n_ans+m_ans)
N, M = map(int, input().split())

print(N*(N-1)+M*(M-1))
s = input()
n = len(s)
t = s[:n // 2]
k = s[-n//2+1:]
if s == s[::-1] and t == t[::-1]:
    print('Yes')
else:
    print('No')
n,m=map(int,input().split())
if n==0: 
    print((n*(n-1))/2)
elif m==0:
    print((m*(m-1))/2)
else:
    print((n*(n-1))/2+(m*(m-1))/2)
N,M=map(int,input().split())
print((N**2-N)/2 + (M**2-M)/2)
x = input().split()
n = int(x[0])
m = int(x[1])
if n == 0:
  print(m * (m -1) /2)
elif m == 0:
  print(n * (n - 1) / 2)
else:
  k = m * (m -1) /2 + n * (n - 1) / 2
  print(k)
a,b=map(int,input().split())
c=0
while a>1 or b>1:
  a=a-2
  b=b-2
  c=c+1
print(c)
N, M = map(int, input().split())
print(N*M-M)
def tmp(n):
    return n * (n - 1) / 2


def main():
    line = input().strip()
    n, m = [int(v) for v in line.split(' ')]

    ans_n = tmp(n) if n > 1 else 0
    ans_m = tmp(m) if m > 1 else 0
    ans = ans_n + ans_m
    print(ans)


if __name__ == '__main__':
    main()
n, m = map(int,input(). split())
answer = (n+m)*(n+m-1)/2 - n*m
print(answer)
n,m=map(int,input().split())

print(n*(n-1)/2+m*(m-1)//2)
import math
 
def combinations_count(n, r):
    if n == 1 or n == 0:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
if __name__ == '__main__':
    a,b=map(int,input().split())
    e_2 = combinations_count(a,2)
import math

a = list(map(int,input().split()))
N = a[0]
M = a[1]

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N < 2:
  N = 0
elif N == 2:
  N == 1
else:
  N = comb(N,2)

if M < 2:
  M = 0
elif M == 2:
  M = 1
  
ans = N + M

print(ans)
a,b = input().split()
a = int(a)
b = int(b)
A = (a*a-1)/2
B = (b*b-1)/2
if a <= 2 and b <= 2:
  print(0)
elif a <=2 and b >= 1:
  print(B)
elif a >= 1 and b <= 2:
  print(A)
elif a>= 1 and b >=1:
  print(A+B)
a, b = list(map(int, input().strip().split())) # 2整数を受け取った
s1 = a * (a - 1) /2 #偶どうし
s2 = b * (b - 1) /2 #奇どうし
# 出力
print(s1 + s2)
n,m = map(int,raw_input().split(' '))
print n*(n-1) + m*(m-1)
n,m = map(int,input().split())
print(n*(n-1) / 2 + m*(m-1) / 2)

#選んだ 2 つのボールに書かれている数の和が偶数になるのは、 
#2つのボールに書かれた数が共に偶数or共に奇数である場合に限ります。
#そのようなボールの選び方の数を求めればよいです。これは、
# nC2 + mC2通りです。
N,M=map(int, input().split()) 
if M == 1:
    answer = N * N-1
elif N == 1:
    answer = M * M-1
else:
    answer = (N * (N-1))//2 + (M * (M-1))//2
print(answer)
n, m = map(int, input().split())
print((n + 1) * (m // 2 + 1))
N, M = map(int, input().split())
print( N * (N-1) / 2 + M * (M-1) / 2 )
N,M = map(int,input().split())
print(N/2+M/2)
N,M=map(int,input().split())
a=N*N/4+M*M/4
b=N+M
if int(b)>2:
  print(int(a))
else:
  print(0)
N, M = map(int, input().split())

if N==0:
  N=1
if M==0:
  M=1
print(N*(N-1)/2+M*(M-1)/2)
import math
import sys
n, m = map(int, input().split())

def combinations_count(n, r):
    C = math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
    return C

if n <= 1 and m >= 2:
    print(combinations_count(m, 2))
    sys.exit()
elif n >= 2 and m <= 1:
    print(combinations_count(n, 2))
    sys.exit()
elif n == m == 1:
    print(1)
    sys.exit()
elif n == m == 0:
    print(0)
    sys.exit()
else:
    print(combinations_count(n, 2) + combinations_count(m, 2))
a = list(map(int, input().split()))
if a[0]==1:
  n=0
else:
  n=a[0]*(a[0]-1)/2

if a[1]==1:
  m=0
else:
  m=a[1]*(a[1]-1)/2
 
print(n+m)
n,m=map(int,input().split())
print(int((n*(n-1)/2 + m*(m-1)*2)))
N, M = map(int,input().split())
X = N*(N+1)/2 + M*(M+1)/2
print(X)
def main():
 n,m = map(int,input().split())
 print(n * (n - 1) / 2 + m * (m - 1) / 2)
main()
N, M = map(int, (input().split()))
ans = N * (N - 1) / 2 + M * (M - 1) / 2
print(ans)
data = input().split(" ")

N = int(data[0])
M = int(data[1])

ans = N*(N-1)/2
ans += M*(M-1)/2

print(ans)
N, M = map(int, input().split())
print(N*(N-1)+M*(M-1))
n, m = map(int, input().split())
print(n*(n-1)/2+m*(m-1)/2)
n,m=map(int,input().split())
print((n*(n-1)//2)*(m*(m-1)//2))
n,m=map(int,input().split())
print(n//2+m//2)
M,N=map(int,input().split())
print(M//2+N)
from scipy.special import comb
n, m = map(int, input().split())
print(n * m + comb(n, 1, exact=True) + comb(m, 1, exact=True))
def checkKaibun(str):
    for i in range(int((len(str) - 1) / 2)):
        if str[i] != str[-i - 1]:
            return False
    return True
 
s = input()
n = len(s)
c2e = int((n - 1) / 2)
c3s = int((n + 3) / 2)
if not checkKaibun(s):
    print('No')
elif not checkKaibun(s[0:c2e]):
    print('No')
elif not checkKaibun(s[c3s:n]):
    print('No')
else :
    print('Yes')
n,m=map(int,input().split())
ans=n*(n-1)/2+m*(m-1)/2
print(ans)
N,M = map(int,input().split())
print(int(N*(N+1)/2+M*(M+1)/2))
n,m = map(int,input().split())
if n <= 1:
  n = 0
else:
  n = n * (n-1) / 2
if m <= 1:
  m = 0
else:
  m = m * (m-1) / 2
print(n+m)
N, M = map(int,input().split())

n = N-1
m = M-1

Even = N*n
Odd = M*m

print((Even+Odd)/2)
a, b = map(int, input().split())
print(a * (a + 1) / 2 + b)
import math
N, M = list(map(int, input().split()))
if N==M==1:
    print(1)
elif M < 2:
    print(int(math.factorial(N)/math.factorial(2)/math.factorial(N-2)))
elif N==0:
    print(int(math.factorial(M)/math.factorial(2)/math.factorial(M-2)))
else:
    print(int(math.factorial(N)/math.factorial(2)/math.factorial(N-2) +  math.factorial(M)/math.factorial(2)/math.factorial(M-2)))
n,m=map(int,input().split())

print(n*(n-1)/2+m*(m-1)/2)
n,m=map(int,input().split())

print((n//2)+(m//2))
a,b=list(map(int, input().split()))
ct=(a*(a-1))//2
ct+=b
print(ct)
from scipy.misc import comb

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

print(int(comb(N, 2)) + int(comb(M, 2)))
n,m = map(int, input().split())
print(int((n+m)*(n+m-1)-n*m))
s= input()
l = list(s)
ans= "Yes"
for i in range(0,(len(s)//2)):
  if(l[i]!=l[-1-i]):
    ans = "No"
print(ans)
N,M=map(int,input().split())
if N>1 and M>1:
  print(int((N*(N-1)/2)+(M*(M-1)/2)))
elif N<=1:
    if M<=1:
      print(0)
    print(int(M*(M-1)/2))
else:
  print(int(N*(N-1)/2))
# ここにコード書く
n, m = map(int, input().split())
# combination nC2 mC2
ans = n * (n - 1) / 2 + m * (m - 1) / 2
print(ans)
o =input().split()
(n,m) = map(int,o)
a = []
b = []
count = 0
for i in range(n):
    a.append(1)
print(a)
for j in range(m):
    b.append(2)
print(b)
for k in a:
    for p in b:
        if (k + p) % 2 == 0:
            count = count + 1
            print(count)
S = input()
N = len(S)

def is_palindrome(s):
  return s == s[::-1]

if is_palindrome(S) \
and is_palindrome(S[:int((N-1)/2)]) \
and S[:int((N-1)/2)] == S[int((N+3)/2-1):]:
  print('Yes')
else:
  print('No')
N, M = tuple(map(int, input().split()))

import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if N < 2 and N < 2:
    print(0)
elif M < 2:
    print(comb(N,2))
elif N < 2:
    print(comb(M,2))
else:
    print(comb(N,2) + comb(M, 2))
def main():
    n, m = map(int, input().split())
    n -= 1
    m -= 1
    e = 0
    while n > 0:
        e += n
        print(n)
        n -= 1
    while m > 0:
        e += m
        m -= 1
    print(e)
 
main()
N, M = map(int, input().split())
ans = ((N * (N - 1)) / 2) + ((M * (M - 1)) / 2)
print(ans)
N, M = map(int, input().split())
print(N * (N-1) / 2 + M * (M-1) / 2)
a, b=input().split()
a=int(a)
b=int(b)
if a<=1:
  k=b*(b-1)//2
  print(k)
elif b<=1:
  k=a*(a-1)//2
  print(k)
elif a<=1 and b<=1:
  print("0")
else:
  k=a*(a-1)*b*(b-1)//4
  print(k)
n, m = map(int, input().split())
print((n+m)*(n+m+1)/2-n*m/2)
N, M = map(int, input().split())
x = N + M
print(x * (x - 1) // 2 - (N * (N - 1)//2) * (M * (M - 1)//2))
N, M = (int(x) for x in input().split())
ans=0
if N>=2:
  ans+=N*(N-1)/2
if M>=2:
  ans+=M*(M-1)/2
print(ans)
N,M = map(int,input().split())

print(N*(N-1)/2)
from itertools import combinations

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

a = len(list(combinations(range(n),2)))

if (n == 2 and m == 0) or (n == 0 and m == 2):
    print(2)
    exit()

if m == 1:
    print(a + m -1)
    exit()
else:
    print(a + m)
    exit()
n,m=map(int,input().split())
print(n*(n-1)/2+m*(m-1)/2)
a, b = map(int, input().split())
print(a * (a - 2 * b) + b)
n,m=map(int,input().split())
print(n*(n+1)//2+m*(m+1)//2)
N,M = map(int,input().split())
print((N*(N-1)+M*(M-1))/2)
from math import factorial as f
def t(x): return f(x)/(f(2)*f(x-2))
n,m = [int(i) for i in input().split()]
#if m%2==0: m-=1
if m>=2 and n>=2:
    ans = t(m)+t(n)
elif n==0 and m>=2: ans = t(m)
else: #os dois iguais
    if m == 1: ans =0
    else: ans=2
    
print(int(ans))
N,M=map(int,input().split())

print(N*(N-1)+M*(M-1))
n,m=(int(x) for x in input().split());
print(n);
print(m);

even = n * (n-1) / 2 ;
odd = m * (m-1) /2
n, m = map(int,input().split())

print((n*(n-1)+m*(m-1))/2)
from math import factorial

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

if N <= 1 and M <= 1:
    print(0)
elif M <= 1:
    print(int(factorial(N) / factorial(2) / factorial(N - 2)))
elif N <= 1:
    print(int(factorial(M) - factorial(2) / factorial(M - 2)))
else:
    print(int(
            (factorial(N) / factorial(2) / factorial(N - 2))
            + (factorial(M) / factorial(2) / factorial(M - 2))
        )
    )
N,M= map(int,input().split())
print(N*(N-1)/2+M*(M-1)/2)
import math
e,o = map(int,input().split())
if e < 2:
    e_cases = 0
else:
    e_cases = math.factorial(e)/math.factorial(e-2)/2
if o < 2:
    o_cases = 0
else:
    o_cases = math.factorial(o)/math.factorial(o-2)/2
print(e_cases+o_cases)
from math import factorial
n, m = map(int, input().split())
def combinations_count(n, r):
  if n<=1:return n
  else:return factorial(n) // (factorial(n - r) * factorial(r))
print(combinations_count(n, 2)+combinations_count(m, 2))
n, m = map(int, input().split())

if n >= 2:
  even = n * (n-1) /2
else:
  even = 0

if m >= 2:  
  odd = m * (m-1) /2
else:
  odd = 0
print(even + odd)
n,m = [int(x) for x in input().split()]
print(n * (n-1) / 2 + m * (m-1) / 2)
s1 = str(input())
s2 = ''
for i in range(len(s1)):
    s2 += s1[- i - 1]
if s1 != s2:
    print('No')
    exit()

t1 = s1[0 : ((len(s1)) - 1) // 2]
t2 = ''
for i in range(len(t1)):
    t2 += t1[- i - 1]
if t1 != t2:
    print('No')
    exit() 

u1 = s1[(len(s1) + 3) // 2 - 1:]
u2 = ''
for i in range(len(u1)):
    u2 += u1[- i - 1]
if u1 != u2:
    print('No')
    exit() 
print('Yes')
#A
n,m=map(int,input().split())
ans=(n*(n-1)+m*(m-1))/2
print(ans)
from itertools import combinations

def resolve():
    N, M = map(int, input().split())
    n = len(list(combinations(range(N), 2)))
    if M >= 2:
        m = len(list(combinations(range(M), 2)))
    else:
        m = 0
    return print(n+m)
import math

def combinations_count(n, r):
    if n == 1:
        return 0
    if n == 0:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 

a,b=map(int,input().split())
e_2 =  combinations_count(a,2)
import math 
def ncr(m,n):
    return((math.factorial(m))/((math.factorial(n))*(math.factorial(m-n))))
nm=list(map(int,input().split()))
if(nm[0]<2 and nm[1]>=2):
    print(ncr(nm[1],2))
elif(nm[0]>=2 and nm[1]<2):
    print(ncr(nm[0],2))
elif(nm[0]<2 and nm[1]<2):
    print(0)
else:
    print(int(ncr(nm[0],2)+ncr(nm[1],2)))
import itertools

new_list = []

k = 0
j = 0
y = 0
n , m = map(int,input().split())
for i in range(1,100):
    if i%2==0 :
        k = k + 1
        if k <= n:
            new_list.append(i)
    else:
        j = j +1
        if j <= m:
            new_list.append(i)
for x in itertools.combinations(new_list , 2):
    if sum(x) % 2 == 0:
        y = y + 1
print(y)
N, M = map(int, input().split())

print(N*(N-1)/2 + M*(M-1)/2)
n, m = map(int, input().split())

if n <= 2:
  n_even = 0
else:
  n_even = n * (n-1) / 2
if m <= 2:
  m_even = 0
else:
  m_even = m * (m-1) / 2

even = n_even + m_even
print(int(even))
n,m = map(int,input().split())

print(int(n//2 + m//2))
o =input().split()
(n,m) = map(int,o)
a = []
b = []
count = 0
for i in range(n):
    a.append(1)
print(a)
for j in range(m):
    b.append(2)
print(b)
for k in a:
    for p in b:
        if (k + p) % 2 == 0 or (k+k) % 2 == 0 or (p+p)%2==0:
            count = count + 1
print(count)
N,M=map(int,input().split())
if N > 1:
  n = 0
else:
  n = N*(N-1) / 2
if M > 1:
  m = 0
else:
  m = M*(M-1) / 2
print(n+m)
N, M = map(int, input().split())
print(N*(N-1)/2 + M*(M-1)/2)
import math

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

print(N*(N-1)/2 + M*(M-1)/2)
n, m = [int(x) for x in input().split()]
print(int((n*(n-1))/2)+((m*(m-1))/2))
import math
def com(a):
    if a == 0 or a == 1:
        return 0
    elif a == 2:
        return 1
    else:
        return math.factorial(a)/2/math.factorial(a-2)
A = list(map(int, input().split()))
result  = com(A[0])+com(A[1])
print (result)
from scipy.misc import comb

N, M = [int(i) for i in input().split()]

n_comb = comb(N, 2)
m_comb = comb(M, 2)

output = int(n_comb + m_comb)

print(output)
n, m = map(int, input().split())
c = 0
if n >= 2:
  c += n*(n-1) /2
if m >= 2:
  c += n*(n-1) /2
print(c)
n, m = map(int, input().split())
nb = 0
def combin(n, k):
    """Nombre de combinaisons de n objets pris k a k"""
    if k > n//2:
        k = n-k
    x = 1
    y = 1
    i = n-k+1
    while i <= n:
        x = (x*i)//y
        y += 1
        i += 1
    return x
if m > 1:
  nb = m + combin(n,2) 
elif m == 1:
  nb = combin(n,2)
else:
  nb = 0
print(nb)
def checkKaibun(str):
    for i in range(int((len(str) - 1) / 2)):
        if str[i] != str[-i - 1]:
            return False
    return True
 
s = input()
n = len(s)
c2e = int((n - 1) / 2)
c3s = int((n + 3) / 2) - 1
if not checkKaibun(s):
    print('No')
elif not checkKaibun(s[0:c2e]):
    print('No')
elif not checkKaibun(s[c3s:n]):
    print('No')
else :
    print('Yes')
data = input().split()

a = int(data[0])
b = int(data[1])

print(a*(a-1)/2+b*(b-1)/2)
letters = input()

def kaibun_check(letters):
    count = 0
    if len(letters)%2 == 0 or len(letters)<1:
        return False
    for _ in range(len(letters)//2):
        count += 1
        if letters[count-1] != letters[-count]:
            return False
    return True

if kaibun_check(letters) and kaibun_check(letters[:(len(letters)-1)//2]) and kaibun_check(letters[(len(letters)+3)//2-1:]):
    print('Yes')
else:
    print('No')
N, M = map(int, input().split())
print((N*(N-1)/2)+(M*(M-1)/2))
n,m = map(int, input().split())
print(n*(n-1)/2+m*(m-1)/2)
n, m = map(lambda i: int(i), input().split())

if n == 1 and m ==1:
    print(0)

print(int(n*(n-1)/2 + m*(m-1)/2))
N, M = map(int, input().split())
print(N*(N-1)/2+M*(M-1)/2)
#-String Palindrome
import math
character = input()
re_character = character[::-1]
 
num = int(len(character))
middle = math.ceil(num/2.0)

if (character[0:num] == re_character[0:num]):
  if (character[0:middle-1] == re_character[middle:num]):
      print("Yes")
else:
  print("No")
S = input()
N = len(S)
list_a = []
count = 0

for i in range(0, N):
    list_a.append(S[i])

for i in range(0, N):
    if list_a[i] == list_a[N-1-i]:
        count += 1
    else:
        pass

for j in range(0, int(N//2)):
    if list_a[j] == list_a[int((N-3-j)/2)] and list_a[int((N+1+j)/2)] == list_a[N-1-j]:
        count += 1
    else:
        pass

if count > N:
    print("Yes")
else:
    print("No")
def combination(M,N):
    return M*(M-1)/2+N*(N-1)/2
M,N=map (int,input().split())
x=combination(M,N)
print(x)
from math import factorial
N, M = map(int,input().split())
combination = 2*factorial(N+M) / factorial(N) / factorial(M)
print(int(combination))
n,m=map(int,input().split())
ans=((n*(n-1))/2)+(m*(m-1))/2
print(ans)
n, m = map(int, input().split())

print(
  n * (n - 1) + m * (m - 1) // 2
)
a,b = map(int,input().split())
print((a * (a - 1) / 2) + (b * (b - 1) / 2))
from math import factorial

inputted = list(map(int, input().split()))
N = inputted[0]
M = inputted[1]

nPk = lambda n, k: 0 if n - k <= 0 else factorial(n) / (factorial(k) * factorial(n - k))

answer = nPk(N, 2) +  nPk(M, 2)
answer = int(answer)

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

print(n*(n-1)/2 + m*(m-1)/2)
N,M=map(int,input().split())
res=(N*(N-1)+M*(M-1))/2
print(res)