Problem:


Score : 100 points

Problem Statement

We have N+M balls, each of which has an integer written on it.

It is known that:  

The numbers written on N of the balls are even.

The numbers written on M of the balls are odd.

Find the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.

It can be shown that this count does not depend on the actual values written on the balls.

Constraints

0 \leq N,M \leq 100

2 \leq N+M

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N M

Output

Print the answer.

Sample Input 1

2 1

Sample Output 1

1

For example, let us assume that the numbers written on the three balls are 1,2,4.

If we choose the two balls with 1 and 2, the sum is odd;

If we choose the two balls with 1 and 4, the sum is odd;

If we choose the two balls with 2 and 4, the sum is even.

Thus, the answer is 1.

Sample Input 2

4 3

Sample Output 2

9

Sample Input 3

1 1

Sample Output 3

0

Sample Input 4

13 3

Sample Output 4

81

Sample Input 5

0 3

Sample Output 5

3



Sample input:
2 1


Sample output:
1

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())
if n==0:
  c=m*(m-1)
elif m==0:
  c=n*(n-1)
else:
  c=n*(n-1)+m*(m-1)

print(c)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
print(int(N * (N - 1) + M * (M-1)) / 2)

Submission status: Wrong Answer

Solution code:
N, M=map(int, input().split())
print(N*(N-1)//2, M*(M-1)//2)

Submission status: Wrong Answer

Solution code:
N,M = map(int, input().split())
print(((N * (N - 1)) / 2 ) + ((M * (M - 1)) / 2 ))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
print((a * (a - 1) / 2) + (b * (b - 1) / 2))

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())
print((a * (a + 1) / 2) + (b * (b + 1) / 2))

Submission status: Wrong Answer

Solution code:
s=input()
l=s[:(len(s)-1)//2]
r=s[(len(s)+3)//2-1:]
#print(l)
#print(r)
for i in range((len(s)-1)//2):
  if s[i]==s[-i-1] and l[i]==r[i]:
    if i==(len(s)-1)//2-1:
      print("Yes")
      exit()
    continue
  else:
    print("No")
    break

Submission status: Wrong Answer

Solution code:
s=input()
l=s[:int(len(s)/2)+1]
r=s[int(len(s)/2):]
#print(l)
#print(r)
for i in range(int(len(s)/2)+1):
  if s[i]==s[-i-1] and l[i]==r[i]:
    if i==int(len(s)/2):
      print("Yes")
      exit()
    continue
  else:
    print("No")
    break

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
if n == 1:
  if m == 1:
    print(0)
  else:
    print((m * (m-1) / 2))
elif m == 1:
  print((n * (n-1) / 2))
else:
  print((n * (n-1) / 2) + (m * (m-1) / 2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
t = s[:(n-1)//2]
u = s[(n+3)//2-1:]
if s==s[::-1] and t==t[::-1] and u==u[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N,M= list(map(int,input().split()))
print(N*(N-1)/2+M*(M-1)/2)

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
ans = 0
for i in range(2):
    if N[i] == 0:
        pass
    else:
        ans += (N[i] * (N[i]-1))/2
print(ans)

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
ans = 0
for i in range(2):
    if N[i] == 0:
        pass
    else:
        ans += N[i]*(N[i]-1)/2
print(ans)

Submission status: Wrong Answer

Solution code:
N = list(map(int,input().split()))
ans = 0
for i in range(2):
    ans += N[i]*(N[i]-1)/2
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int, input().split(" "))
n = a + b
print(n*(n-1)//2 - b * (b-1)//2)

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())

print(n*(n-1)/2+m*(m-1)/2)

Submission status: Wrong Answer

Solution code:
# number of even balls, number of odd balls
N, M = list(map(int, input().split()))

total_choice = 0
if N == 1:
    total_choice += 1

if N > 1:
    total_choice += N*(N-1)/2

if M > 1:
    total_choice += M*(M-1)/2

print(int(total_choice))

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
#-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")

Submission status: Wrong Answer

Solution code:
S = list(input())
N1 = int(len(S))
N2 = int((N1-1)/2)

if S[:N2] == S[N2-1::-1] or N1 == 1:
	if S == S[::-1]:
		print("Yes")
else:
	print("No")

Submission status: Wrong Answer

Solution code:
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
  
N, M = map(int, input().split())

if N < 2:
	if M < 2:
		print(0)
	else:
		print(ncr(M,2))
elif M < 2:
	print(ncr(N,2))
else:
	print(int(ncr(N,2)+ncr(M,2)))

Submission status: Wrong Answer

Solution code:
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
  
N, M = map(int, input().split())

if N == 0:
	if M ==0:
		print(0)
	else:
		print(M)
elif M == 0:
	print(N)
else:
	print(int(ncr(N,2)+ncr(M,2)))

Submission status: Wrong Answer

Solution code:
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom

N, M = map(int, input().split())
print(int(ncr(N,2)+ncr(M,2)))

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
t = s[0:(n+3)//2]
u = s[-1:-(n+1)//2]
if t == u:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
m,n=(int(x) for x in input().split());
even = m*(m-1)/2;
odd = n*(n-1)/2;

result = even + odd;
print(result);

Submission status: Wrong Answer

Solution code:
m,n=(int(x) for x in input().split());
even = m*(m-1)/2;
odd = n*(n-2)/2;

result = even + odd;
print(result);

Submission status: Wrong Answer

Solution code:
n,m=(int(x) for x in input().split());
print(n);
print(m);

even = n * (n-1) / 2 ;
odd = m * (m-1) /2

Submission status: Wrong Answer

Solution code:
N,M=input().split()
N=int(N)
M=int(M)
print((N*(N-1)/2)+(M*(M-1)/2))

Submission status: Wrong Answer

Solution code:
N, M = (int(x) for x in input().split())
A = N * (N - 1) / 2
B = M * (M - 1) / 2
print(A+B)

Submission status: Wrong Answer

Solution code:
N, M = (int(x) for x in input().split())
A = N * (N-1)/2 + M*(M-1)/2
print(A)

Submission status: Wrong Answer

Solution code:
N,M = map(int , input().split())
result = N+M
if result % 2 == 1:
    print(result)

Submission status: Wrong Answer

Solution code:
N,M = map(int , input().split())
result = N+M
if result % 2 == 1:
    print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr  4 19:20:51 2020

@author: Kanaru Sato
"""

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

if n <= 1:
    ans1 = 0
else:
    ans1 = n*(n-1)/2

if m <= 1:
    ans2 = 0
else:
    ans2 = m*(m-1)/2
    
ans = ans1+ans2
print(ans)

Submission status: Wrong Answer

Solution code:
i = list(map(int, input().split()))
N = i[0]
M = i[1]

guusuu = (N * N-1) // 2
kisuu = (M * M-1) // 2

print(guusuu + kisuu)

Submission status: Wrong Answer

Solution code:
S = input()
L = list(S)
len = int(len(L))

L1 = L[:(len-1)//2]
L1_r = L1[::-1]
L2 = L[(len+3)//2-1:]
L2_r = L2[::-1]

if(L1==L1_r and L2==L2_r):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = list(input())
N = len(S)
s1 = S[:int((N-1)/2):]
s2 = S[int(((N+3)/2)-1):int(N):]
if S == S[::-1] :
    if s1 == s1[::-1] and s2 == s2[::-1] :
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input().lower()
 
n = int((len(S)-1)/2)
 
if S == S[::-1]:
  if S[:n] == S[:n][::-1]:
    if S[n+1:] == S[n+1:][::-1]:
      print('Yes')
      
else:
  print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

a = N * (N-1) / 2
b = M * (M-1) / 2

print(a+b)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N, M = map(int, input().split()) 

print((N*(N-1))/2 + (M*(M-1))/2)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N, M = map(int, input().split()) 

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

print(total - odd)

Submission status: Wrong Answer

Solution code:
from sys import stdin
N, M = map(int, input().split()) 

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

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

print(total - odd)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
print(N/2+M/2)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

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

print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())

if n >= 2 and m >= 2 :
    ans = (n * (n - 1))  / 2 + (m * (m - 1) / 2)

elif n <= 1 and m >= 2 :
    ans = n + (m * (m - 1) / 2)

elif n >= 2 and m <= 1 :
    ans = (n * (n - 1)) / 2 + m

else :
    ans = n + m

print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())

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

print(ans)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
ans = (n * (n -1)) + (m * (m - 1))
print(ans)

Submission status: Wrong Answer

Solution code:
from scipy.misc import comb
 
n,m = map(int, input().split())
 
if n>1:
  even = comb(n,2)
else:
  even = 0
 
if m>1:
  odd = comb(m,2)
else:
  odd = 0
 
ans = even + odd
print(str(int(ans)))

Submission status: Wrong Answer

Solution code:
from scipy.misc import comb

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

if n>1:
  even = comb(n,2)
else:
  even = 0

if m>1:
  odd = comb(m,2)
else:
  odd = 0

ans = even + odd
print(str(ans))

Submission status: Wrong Answer

Solution code:
i = input().split()
n = int(i[0])
m = int(i[1])

sum = 0

if n > 2:
    sum += 2 ** (n // 2)
elif n == 2:
    sum += 1

if m > 2:
    sum += 2 ** (m // 2)
elif m == 2:
    sum += 1

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
print(n*(n-1) + m*(m-1))

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
ans = ((N * (N - 1)) / 2) + ((M * (M - 1)) / 2)
print(ans)

Submission status: Wrong Answer

Solution code:
n, m = [int(i) for i in input().split()]
print((n*(n-1)+m*(m-1))/2)

Submission status: Wrong Answer

Solution code:
from math import factorial
N, M = map(int,input().split())
combination = 2*factorial(N+M) / factorial(N) / factorial(M)
print(int(combination))

Submission status: Wrong Answer

Solution code:
n, m = (int(i) for i in input().split());
res = (n * (n - 1) + m * (m - 1)) / 2;
print(res);

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
m, n = map(int,input().split())
print(m*n)

Submission status: Wrong Answer

Solution code:
n,m = map(int,input().split())
if n == 0:
  print(m*(m-1)/2)
elif n == 1:
  if m == 1:
    print('0')
  else:
    print(m*(m-1)/2)
elif m == 0:
  print(n*(n-1)/2)
elif m == 1 and n>=2:
  print(n*(n-1)/2)
else:
  print(m*(m-1)/2 + n*(n-1)/2)

Submission status: Wrong Answer

Solution code:
m, n = input("").split()
m = int(m)
n = int(n)
total = 0
if m > 1:
    total += m*(m-1)/2
if n > 1:
    total += n*(n-1)/2
print(total)

Submission status: Wrong Answer

Solution code:

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)

Submission status: Wrong Answer

Solution code:

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)

Submission status: Wrong Answer

Solution code:
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)))

Submission status: Wrong Answer

Solution code:
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 < 2:
    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)))

Submission status: Wrong Answer

Solution code:
n,m = input().split()
n=int(n)
m=int(m)

nout =n* (n-1)/2
mout =m* (m-1)/2

print(nout+mout)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())
p=n//2
q=0
for i in range(m):
    q = q + i
print(p + q)

Submission status: Wrong Answer

Solution code:
s=input();print('YNeos'[s.count(s[:len(s)//2])<2::2])

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
result = (N+M)*(N+M-1)/2 - N*M
print(result)

Submission status: Wrong Answer

Solution code:
# ここにコード書く
n, m = map(int, input().split())
# combination nC2 mC2
ans = n * (n - 1) / 2 + m * (m - 1) / 2
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

def choose2(x):
    return x * (n - 1) // 2

n, m = map(int, sys.stdin.readline().split())

def main():
    res = choose2(n) + choose2(m)
    print(res)

if __name__ ==  '__main__':
    main()

Submission status: Wrong Answer

Solution code:
str1 =str(input())
s1 = str1.split(' ')
m = int(s1[0])
n = int(s1[1])
x = (m*(m+1))//2
y = (n*(n+1))//2
print(x+y)

Submission status: Wrong Answer

Solution code:
a,b=map(int,input().split())
if a<=1 and b<=1:
    print(0)
if a<1 and 1<b:
    print((b*(b-1))//2)
if 1<a and b<1:
    print((a*(a-1))//2)
if 1<a and 1<b:
    print(((a*(a-1))//2)+((b*(b-1))//2))

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split()) 
ans = (N-1)*N/2
ans =ans + (M-1)*M/2
print(ans)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

if N==0 or N ==1:
  if M ==0 or M == 1:
    print(0)
  else:
    print(M*(M-1)/2)
else:
  if M ==0 or M == 1:
    print(N*(N-1)/2)
  else:
    print(N*(N-1)/2+M*(M-1)/2)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

if N==0 or N ==1:
  if M ==0 or M == 1:
    print(0)
  else:
    print(M*(M-1)/2)
else:
  if M ==0 or M == 1:
    print(N*(N-1)/2)
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

if N==0 or N ==1:
  if M ==0 or M == 1:
    print(0)
  else:
    print(M*(M-1)/2)
else:
  if M ==0 or M == 1:
    print(N*(N-1))
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
if N <2:
  N=1

if M<2:
  M=1

print(N*(N-1)/2+M*(M-1)/2)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
print(N*(N-1)/2+M*(M-1)/2)

Submission status: Wrong Answer

Solution code:
N,M=input().split()
n=int(N)
m=int(M)
a=(n*(n-1))/2
b=(m*(m-1))/2
print(a+b)

Submission status: Wrong Answer

Solution code:
N,M=input().split()
n=int(N)
m=int(M)
a=n*(n-1)
b=m*(m-1)
print(a+b)

Submission status: Wrong Answer

Solution code:
n,m=input().split()
n=int(n)
m=int(m)
a=n*(n-1)+m*(m-1)
print(a)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
print((N*(N-1))/2+(M*(M-1))/2)

Submission status: Wrong Answer

Solution code:
N,M=map(int, input().split())
A=N*(N-1)/2
B=M*(M-1)/2
print(A+B)

Submission status: Wrong Answer

Solution code:
def main():
  N, M = map(int, input().split()) 
  print((N*(N-1)/2 + (M*(M+1))/2))
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print((N * (N-1)/2) + (M *(M-1)/2))

Submission status: Wrong Answer

Solution code:
#abc159 a
n,m=map(int,input().split())
ans=n*(n-1)/2+m*(m-1)/2
print(ans)

Submission status: Wrong Answer

Solution code:
#abc159 a
n,m=map(int,input().split())
ans=n*(n-1)/2+(m-1)/2
print(ans)

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())

if N == 0 or M == 0:
    print(1)
else:
    print(int(((M * (M - 1)) + (N * (N - 1))) / 2))

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
def checkKaibun(str):
    print(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')

Submission status: Wrong Answer

Solution code:
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')

Submission status: Wrong Answer

Solution code:
line = input().split()
n = int(line[0])
m = int(line[1])

# 偶数と偶数の方法の数
eeCount = n * (n - 1)

# 奇数と奇数の方法の数
ooCount = m * (m - 1)

print(eeCount + ooCount)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

print(a//2 + b//2)

Submission status: Wrong Answer

Solution code:
a, b = map(int, input().split())

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

Submission status: Wrong Answer

Solution code:
from heapq import heappop,heappush
n=input()
h=[]
heappush(h,10)

Submission status: Wrong Answer

Solution code:
import math
def main():
    # arg = getInput(input())
    arg = getInput(1024)
    ans = process(arg)
    print(ans)
    
def process(arg):
    yen500 = math.floor(arg / 500)
    amari = arg % 500
    yen5 = math.floor(amari / 5)
    ans = 1000 * yen500
    ans = ans + yen5 * 5

    return ans

def getInput(input):
    # 行数
    n = 1
    # 戻り値
    ret = None

    if n == 1:
        pass
        # ret = input
        # ret = list(input)
        ret = int(input)
        # ret = input.split()
        # ret = list(map(int, input.split()))
        # ret = input.split('T')
    else:
        for x in range(n):
            # 取得したい形式に変換
            ret = input[x]

    return ret

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

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

print(ans)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

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

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
print(N * (N-1) / 2 + M * (M-1) / 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
print(int((n+m)*(n+m-1)-n*m))

Submission status: Wrong Answer

Solution code:
n,m = map(int, input().split())
print(int((n+m)*(n+m-1))-n*m)

Submission status: Wrong Answer

Solution code:
import functools

@functools.lru_cache(maxsize=None)
def factorial(N):
    if N == 0:
        return 1
    if N == 1:
        return 1
    else:
        return N * factorial(N - 1)


def c(n, r):
    if n < r:
        return 0
    return int(factorial(n) / factorial(r) / factorial(n-r))


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

print(
    c(N, 2) + c(M, 2)
)

Submission status: Wrong Answer

Solution code:
num = input("")
num = num.split(" ")
N = int(num[0])
M = int(num[1])
a = N*(N-1) if N*(N-1) >= 0 else 0
b = M*(M-1) if M*(M-1) >= 0 else 0
print(a + b)

Submission status: Wrong Answer

Solution code:
# N Mを受け取って

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

ans = 0
# even + even
if N>0:
	ans += N*(N-1)/2
# odd + odd
if M>0:
	ans += M*(M-1)/2

print(ans)

Submission status: Wrong Answer

Solution code:
a, b = list(map(int, input().strip().split())) # 2整数を受け取った
s1 = a * (a - 1) /2 #偶どうし
s2 = b * (b - 1) /2 #奇どうし
# 出力
print(s1 + s2)

Submission status: Wrong Answer

Solution code:
# スペース区切りの整数の入力
a, b = input().strip().split()
a, b = [int(a), int(b)]
s1 = a * (a - 1) / 2 #偶どうし
s2 = b * (b - 1) / 2 #奇どうし
# 出力
print(s1 + s2)

Submission status: Wrong Answer

Solution code:
# スペース区切りの整数の入力
a, b = map(int, input().split())
s1 = a * (a - 1) / 2 #偶どうし
s2 = b * (b - 1) / 2 #奇どうし
# 出力
print(s1 + s2)

Submission status: Wrong Answer

Solution code:
# スペース区切りの整数の入力
a, b = map(int, input().split())
s1 = a * (a - 1) #偶どうし
s2 = b * (b - 1) #奇どうし
# 出力
print(s1 + s2)

Submission status: Wrong Answer

Solution code:
def fact(n):
    if n < 0:
        return 0
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fact(n-1)

def combination(n, k):
    if n < k:
        return 0
    return fact(n) / ( fact(n-k) * fact(k))

n, m = [int(x) for x in input().split()]
answer = combination(n, 2) + combination(m, 2)
print(answer)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

# スペース区切りの整数の入力
N, M = map(int, input().split())
# 組み合わせ

if N < 2:
  print("0")
elif N == 2:
  print("1")
else:
  A = ((N*(N-1))/2)+M
  print("{}".format(int(A)))

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
S1=S[:int((N-1)/2)]
S2=S[int((N+1)/2):]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
S1=S[:int((N+1)/2)]
S2=S[int((N+3)/2):]
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
N,M = map(int,input().split())
if N <= 1:
  N = 2
if M <= 1:
  M = 2
print(int(N*(N-1)/2+M*(M-1)/2))

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
NM=(N*(N-1)+M*(M-1))/2
print(NM)

Submission status: Wrong Answer

Solution code:
N,M=map(int,input().split())
print((N*(N-1)/2)+(M*(M-1)/2))

Submission status: Wrong Answer

Solution code:
import sys
from math import factorial

line = input()
N, M = (int(s) for s in line.split(' '))

total = 0
if N > 1:
  total += factorial(N) / factorial(N - 2) / 2
if M > 1:
  total += factorial(M) / factorial(M - 2) / 2

print(total)

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
print((N//2) + (M // 2))

Submission status: Wrong Answer

Solution code:
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))

Submission status: Wrong Answer

Solution code:
#A
NM = input().split(' ')
N = int(NM[0])
M = int(NM[1])
print(N * M - M)

Submission status: Wrong Answer

Solution code:
n, m = map(int, input().split())

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

print(ans)

Submission status: Wrong Answer

Solution code:
s=input().split()
print(s[1])

Submission status: Wrong Answer

Solution code:
n,m=map(int, input().split())

print(n*(n-1)/2+m*(m-1)/2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
S = input()
Y_A = []
N_A = []
for i in S:
    if i == "s":
        Y_A.append("Yes")
    else:
        N_A.append("No")

if Y_A:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())
print((N*(N-1) + M*(M-1))/2)

Submission status: Wrong Answer

Solution code:
n,m = list(map(int,input().split()))
res = 0
if n >= 2:
  res += (n * (n - 1)) / 2
if m >= 2:
  res += (m * (m - 1)) / 2
print(res)

Submission status: Wrong Answer

Solution code:
n,m = list(map(int,input().split()))
res = 0
if n >= 2:
  res += n * (n - 1) / 2
if m >= 2:
  res += m * (m - 1) / 2
print(res)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
T = list(S)
M = ((N-1)/2)-1
i = 0
j = int(M)

if (j+1)%2 == 1:
    while i == j:
        if T[i] != T[j]:
            j = -1
            break
        i += 1
        j -= 1
else :
    while i+1 == j:
        if T[i] != T[j]:
            j = -1
            break
        i += 1
        j -= 1
        
P = int((N+3)/2)-1
i = 0
while P < N:
    if T[i] != T[P]:
        j = -1
        break
    i += 1
    P += 1

if j != -1:
    print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
print(1)

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
T = list(S)
M = ((N-1)/2)-1
i = 0
j = int(M)

while i == j:
    if T[i] != T[j]:
        j = -1
        break
    i += 1
    j -= 1

P = int((N+3)/2)-1
i = 0
while P < N:
    if T[i] != T[P]:
        j = -1
        break
    i += 1
    P += 1

if j != -1:
    print('Yes')
else :
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
X = N*(N-1)/2 + M*(M-1)/2
print(X)

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())
X = N*(N+1)/2 + M*(M+1)/2
print(X)

Submission status: Wrong Answer

Solution code:
x, y = map(int, input().split())
result1 = x * (x - 1) // 2
result2 = y * (y - 1) // 2
result = result1 + result2
print(result1)

Submission status: Wrong Answer

Solution code:
n, m = map(int,input().split())

print((n*(n-1))/2 + ((m*(m-1))/2))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
 
flag=True
 
for i in range(n):
  if(s[i]!=s[n-1-i]):
    flag=False
 
for i in range((n-1)//2):
  if(s[i]!=s[(n-1)//2-1-i]):
    flag=False
  if(s[(n-1)//2+1+i]!=s[n-1-i]):
    flag=False
    
if(flag==True):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
 
flag=True
 
for i in range(n):
  if(s[i]!=s[n-1-i]):
    flag=False
 
for i in range((n-1)//2):
  if(s[i]!=s[(n-1)//2-1-i]):
    flag=False
  if(s[(n-1)//2+1+i]!=s[n-1-i]):
    flag=False
    
if(flag):
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)

flag=True

for i in range(n):
  if(s[i]!=s[n-1-i]):
    flag=False

for i in range((n-1)//2):
  if(s[i]!=s[(n-1)//2-1-i]):
    flag=False
  if(s[(n-1)//2+1+i]!=s[n-1-i]):
    flag=False
    
if(flag):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

s = input()

def is_kaibun(aaa):
    str_len = len(aaa)
    half_str_len = str_len // 2

    str_mae = aaa[:half_str_len]
    str_ato = aaa[half_str_len+1:]

    if str_mae == str_ato:
        return(True)
    else:
        return(False)
    

if is_kaibun(s):
    s_len = len(s)
    half_s_len = s_len // 2
    mae = s[:half_s_len]
    ato = s[half_s_len+1:] 
    if is_kaibun(mae) and is_kaibun(ato):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N, M = map(int, input().split())

if N != 0 and M != 0:
  answer = N*(N-1)/2 + M*(M-1)/2
  print(answer)
elif N == 0:
  answer = M*(M-1)/2
  print(answer)
else:
  answer = N*(N-1)/2
  print(answer)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
print(int(a[0]*(a[0]-1)+a[1]*(a[1]-1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print('a')

Submission status: Wrong Answer

Solution code:
def main():
  
  strInput = input()
  
  if len(strInput) < 3 or len(strInput) > 99 \
  	or strInput.isupper() or (strInput.isalpha() == False):
    return print('No\n')
  
  if len(strInput) % 2 != 0:
    return print('No\n')
  
  strInputReverse = ''.join(list(reversed(strInput)))
  
  if strInput == strInputReverse:
    return print('Yes\n')
  else:
    return print('No\n')

if __name__ == '__main__':
  main()

Submission status: Wrong Answer

Solution code:
N, M = map(int,input().split())

print(N*(N-1)/2 + M*(M-1)/2)

Submission status: Wrong Answer

Solution code:
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)