TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
n, m = map(int, input().split())
print(n(n-1)/2 + m(m-1)/2)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
M=int(input())
N=int(input())

count=0

if M >= 2:
    x=M*(M-1)
    print("M",x)
    count=x/2

if N >= 2:
    x=N*(N-1)
    print("N",x)
    count=x/2 + count

print(int(count))

IN=input()
M=int(IN.split(" ")[0])
N=int(IN.split(" ")[1])

count=0

if M >= 2:
    x=M*(M-1)
    count=x/2

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

print(int(count))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import decimal

L=int(input())

#decimal.getcontext().prec = 6
x = decimal.Decimal(L / 3)

V=decimal.Decimal(x*x*x)

print("{:.24f}".format(V))

import math


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



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

#main
if N <=1 and M <= 1:
  print(0)

elif N <= 1 and M>=2:
  print(combinations_count(M,2))

elif M <=1 and N>=2:
  print(combinations_count(N,2))
  
elif N >=2 and M >=2:
  print(combinations_count(N,2)+combinations_count(M,2))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,m=map(int,input().split())
def num(x):
  if x<2:
    return 0
  else:
    return int(x*(x-1)/2)
 print(num(n)+num(m))

n,m=map(int,input().split())
def num(x):
  if x<2:
    return 0
  else:
    return int(x*(x-1)/2)
print(num(n)+num(m))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
l = int(input())
print((l/3) ** 3)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,m = map(int, input().split(" "))
result = 0
print(n,m)
if n > 1:
    for i in range(n):
        result += n-1
        n -= 1
if m > 1:
    for t in range(m):
        result += m-1
        m -= 1
print(result)


n,m = map(int, input().split(" "))
result = 0
if n > 1:
    for i in range(n):
        result += n-1
        n -= 1
if m > 1:
    for t in range(m):
        result += m-1
        m -= 1
print(result)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n, m = map(int, input().split())
ans = (n * (n -1)) + (m * (m - 1))
print(ans)

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)


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

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

print(ans)


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

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

print(ans)


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")


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

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

print(int(ans))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
str = list(input())

def isKaibun(src):
  rev = src[:]
  rev.reverse()

  return src == rev


N = len(str)

def num(N):
  return N-1

s1 = num(1)
e1 = (num(N)-1) // 2 + 1
s2 = (num(N) + 3) // 2
e2 = num(N) + 1

if isKaibun(str) and isKaibun(str[s1:e1]) and isKaibun(str[s2:e2]):
  print('Yes')
else:
  print('No')


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

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

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-
import numpy as np
import math

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

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
print(comb(N, 2)+comb(M, 2))

# -*- coding: utf-8 -*-
import numpy as np
import math

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

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

# -*- coding: utf-8 -*-
import numpy as np
import math
 
N, M = map(int, input().split())
 
def comb(n, r):
    return int(math.factorial(n) / (math.factorial(n - r) * math.factorial(r)))
  
print(comb(N, 2)+comb(M, 2))

# -*- coding: utf-8 -*-
import numpy as np
import math
 
N, M = map(int, input().split())
 
def comb(n, r):
    if n < r:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
print(comb(N, 2)+comb(M, 2))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,m=map(int,input().split())
  count=n*(n-1)//2
  countt=m*(m-1)//2
print(count+countt)


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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import itertools

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

if N == 1:
    c1 = 0
else:
    c1 = len(list(itertools.combinations(N, 2)))

if M == 1:
    c2 = 0
else:
    c2 = len(list(itertools.combinations(M, 2)))

c3 = c1 + c2
print(c3)

from scipy import special

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

if N == 1:
    c1 = 0
else:
    c1 = special.comb(N, 2)

if M == 1:
    c2 = 0
else:
    c2 = special.comb(M, 2)

c3 = c1 + c2
print(c3)

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

if N == 1:
    c1 = 0
else:
    c1 = N! / (2! * (N - 2)!)

if M == 1:
    c2 = 0
else:
    c2 = M! / (2! * (M - 2)!)

print(c1 + c2)

from scipy.special import comb

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

if N == 1:
    c1 = 0
else:
    c1 = comb(N, 2, exact = False)

if M == 1:
    c2 = 0
else:
    c2 = comb(M, 2, exact = False)

c3 = c1 + c2
print(c3)

import itertools

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

if N == 1:
    c1 = 0
else:
    c1 = len(list(itertools.combinations(N, 2)))

if M == 1:
    c2 = 0
else:
    c2 = len(list(itertools.combinations(M, 2)))

c3 = c1 + c2
print(c3)

import itertools

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

if N == 1:
    c1 = 0
else:
    c1 = len(list(itertools.combinations(range(N), 2)))

if M == 1:
    c2 = 0
else:
    c2 = len(list(itertools.combinations(range(M), 2)))

c3 = c1 + c2
print(c3)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, m = map(int, input().split())
a = n * (n - 1) // 2
b = m*(m-1)//2
print(a*b)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
#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)

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

#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(int(n_ans+m_ans))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = list(map(int,input().split()))
b = a[0]+a[1]

c = ((a[0]*(a[0]-1))+(a[1]*(a[1]-1)))/2
print(c)

a = list(map(int,input().split()))
b = a[0]+a[1]

c = ((a[0]*(a[0]-1))+(a[1]*(a[1]-1)))/2
print(int(c))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math

data = input()
data = data.split()
n = data[0]
m = data[1]

v = (math.factorial(int(n)) // (math.factorial(int(n) - 2) * math.factorial(2)))+(math.factorial(int(m)) // (math.factorial(int(m) - 2) * math.factorial(2)))

print(v)

import math

data = input()
data = data.split()
n = data[0]
m = data[1]
v1 = 0
v2 = 0

if int(n) > 1:
	v1 = (math.factorial(int(n)) // (math.factorial(int(n) - 2) * math.factorial(2)))

if int(m) > 1:
    v2 = (math.factorial(int(m)) // (math.factorial(int(m) - 2) * math.factorial(2)))

print(v1+v2)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
m, n=map(int,input().split())
print((m-1)*m/2+(n-1)*n/2)

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n.m=map(int,input().split())

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

L=int(input())
print((L/3)**3)

n=input()
m=input()

print(n+m)

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

L=int(input())
print((L/3)**3)

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

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")

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

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')

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")

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")

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,m = map(int, input().split())

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

s = list(input())
n = len(s)
if s==s[::-1] and s[0:int((n-1)/2)]==s[0:int((n-1)/2)][::-1] and s[int((n+3)/2-1):n]==s[int((n+3)/2-1):n][::-1]:
  print('Yes')
else:
  print('No')


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

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
S = input().split()
M = int(S[0])
N = int(S[1])
a = (M*(M-1)/2) + (N*(N-1)/2)
print(a)

S = input().split()
M = int(S[0])
N = int(S[1])
a = int((M*(M-1)/2) + (N*(N-1)/2))
print(a)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
def combination(n, r):
    if n <= 0:
        return 0
    return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))

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

print(combination(n, 2) + combination(m,2))

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

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

print(combination(n, 2) + combination(m,2))

import math
def combination(n, r):
    if n <= 0 or n is 1:
        return 0
    return math.factorial(n) // (math.factorial(r) * math.factorial(n - r))

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

print(combination(n, 2) + combination(m,2))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
l = float(input())
print((l/3)**3)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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")


S = input().split()
N = int(S[0])
M = int(S[1])

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
nm = input()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = n1 + n2

print(ans)

nm = input().split()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = n1 + n2

print(ans)

nm = input().split()
n = int(nm[0])
m = int(nm[1])

ans = 0

n1 = n*(n-1)/2

n2 = m*(m-1)/2

ans = int(n1 + n2)

print(ans)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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 = input()
m = input()
print(math.factorial(n+m))

import math
n,m = map(int,input().split())
if n is 0 or n is 1:
  print(math.factorial(m)/math.factorial(m-2)/2)
if m is 0 or m is 1:
  print(math.factorial(n)/math.factorial(n-2)/2)
else:
  print(math.factorial(n+m)/math.factorial(n+m-2)/2)

n = input()
m = input()
if n=0 or n=1:
  print(math.factorial(m))
if m=0 or m=1:
  print(math.factorial(n))
else:
  print(math.factorial(n+m))

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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

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

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

from math import factorial as f
n,m=map(int,input().split())
comb_n=f(n)//(f(2)*f(n-2)) if n>1 else 0
comb_m=f(m)//(f(2)*f(m-2)) if m>1 else 0
print(comb_n+comb_m)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, m = map(int, input().split())
print(n*(n-1) + m*(m-1))

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


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N,M=map(int,input().split())

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

print(c)

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

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

print(int(c))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N, M = map(int,input().split())
X = N*(N-1)/2 + M*(M-1)/2
print(X)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,m=map(int,input().split())
print(int(n*(n+1)/2+m*(m+1)/2))

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
M = int(input())
answer = (N*(N-1) / 2) + (M*(M-1) / 2)

print(int(answer))

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

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

print(int(answer))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n,m = map(int,input().split())
oddsum = n*(n-1)/2 + m*(m-1)/2
print(oddsum)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N,M=input().split( )
N=int(N)
M=int(M)

M2=(M*(M-1))/2 #MC2
N2=(N*(N-1))/2
A=M2+N2
A

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

M2=(M*(M-1))/2 #MC2
N2=(N*(N-1))/2
A=M2+N2
A=int(A)

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

M2=(M*(M-1))/2 #MC2
N2=(N*(N-1))/2
A=M2+N2
A=int(A)
print(A)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
A = list(map(int, input().split()))
result  = math.factorial(A[0])/2/math.factorial(A[0]-2)+math.factorial(A[1])/2/math.factorial(A[1]-2)
print (result)

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  = int(com(A[0])+com(A[1]))
print (result)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N,M = map(int,input().split)
print(((N * (N-1)) + (M *(M-1))/2)

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

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


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


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


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
list = input().rstrip().split(" ")
kisu = int(list[1])
gusu = int(list[0])

kiki = kisu * (kisu - 1


even, odd = map(int,input().split())
print((even*~-even // 2) + (odd*=~-odd // 2))

even, odd = map(int,input().split())
print((even*~-n // 2) + (odd*=~-odd // 2))

even, odd = map(int,input().split())
print((even*~-even // 2) + (odd*~-odd // 2))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n, m = map(int, (input().split()))
resp = (n*(n-1))/2 + (m*(m-1))/2
print(resp)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
o, e = input().split()
o = int(o);
e = int(e);

num1 = o * (o-1) / 2;
num2 = e * (e-1) / 2;

print(num1+num2)

o, e = input().split()
o = int(o);
e = int(e);

num1 = o * (o-1) / 2;
num2 = e * (e-1) / 2;

print(int(num1+num2))


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

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(int(N * (N - 1) / 2 + M * (M - 1) / 2))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math

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

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

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

import math

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

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

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

import math

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
A,B = list(map(int,input().split()))
import math
def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
C = combinations_count(A, 2)
D = combinations_count(B, 2)
print(C+D)

A,B = list(map(int,input().split()))
import math
def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if A == 0:
  D = combinations_count(B, 2)
  print(D)
  exit()
elif B == 0:
  C = combinations_count(A, 2)
  exit()
C = combinations_count(A, 2)
D = combinations_count(B, 2)
print(C+D)

if A != 0 and B == 0:
  C = math.factorial(A-2)
  E = math.factorial(A) // 2// C
  print(E)
  exit()
if A == 0 and B == 0:
  print(0)
  exit()
elif A == 1 and B != 1:
  D = math.factorial(B-2)
  F = math.factorial(B) // 2// D
  print(F)
  exit()
elif A != 1 and B == 1:
  C = math.factorial(A-2)
  E = math.factorial(A) // 2// C
  print(E)
  exit()
elif A == 1 and B == 1:
  print(0)
  exit()
C = math.factorial(A-2)
D = math.factorial(B-2)
E = math.factorial(A) // 2// C
F = math.factorial(B) // 2// D
print(E+F)

def combinations_count(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
if A == 0:
  D = combinations_count(B, 2)
  print(D)
  exit()
elif B == 0:
  C = combinations_count(A, 2)
  exit()
C = combinations_count(A, 2)
D = combinations_count(B, 2)
print(C+D)

A,B = list(map(int,input().split()))
import math
if A == 0 and B != 0:
  D = math.factorial(B-2)
  F = math.factorial(B) // 2// D
  print(F)
  exit()
if A != 0 and B == 0:
  C = math.factorial(A-2)
  E = math.factorial(A) // 2// C
  print(E)
  exit()
if A == 0 and B == 0:
  print(0)
  exit()
C = math.factorial(A-2)
D = math.factorial(B-2)
E = math.factorial(A) // 2// C
F = math.factorial(B) // 2// D
print(E+F)

A,B = list(map(int,input().split()))
import math
if A == 0 and B != 0:
  D = math.factorial(B-2)
  F = math.factorial(B) // 2// D
  print(F)
  exit()
if A != 0 and B == 0:
  C = math.factorial(A-2)
  E = math.factorial(A) // 2// C
  print(E)
  exit()
if A == 0 and B == 0:
  print(0)
  exit()
elif A == 1 and B != 1:
  D = math.factorial(B-2)
  F = math.factorial(B) // 2// D
  print(F)
  exit()
elif A != 1 and B == 1:
  C = math.factorial(A-2)
  E = math.factorial(A) // 2// C
  print(E)
  exit()
elif A == 1 and B == 1:
  print(0)
  exit()
C = math.factorial(A-2)
D = math.factorial(B-2)
E = math.factorial(A) // 2// C
F = math.factorial(B) // 2// D
print(E+F)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
list_input_str = input().split(' ')
n, m = map(int, list_input_str)


def p(_n, _r):
    
    ret = 1
    for i in range(_r):
        ret = ret * (_n - i)
    return ret


def c(_n, _r):
    over = p(_n, _r)
    under = p(_r, _r)
    return over / under


print(c(n, 2) + c(m, 2))


from operator import mul  
from functools import reduce  

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


def p(_n, _r):
    
    return reduce(mul, list(range(_n, _n - _r, -1)))  


def c(_n, _r):
    
    over = p(_n, _r)
    under = p(_r, _r)
    return over / under


print(int((c(n, 2)) + c(m, 2)))


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,m=map(int,input())
print(n*(n-1)//2+m*(m-1)//2)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
L = int(input())
print((L/3)**3)

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# 200322 A
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
    
if __name__ == "__main__":
    N,M = list(map(int,input().split()))
    print(cmb(N,2)+cmb(M,2))



        
    


# 200322 A

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]
    
if __name__ == "__main__":
    N,M = list(map(int,input().split()))
    print(cmb(N,2)+cmb(M,2))



        
    


# 200322 A

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

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

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

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

    return result

if __name__ == "__main__":
    N,M = list(map(int,input().split()))
    print(cmb(N,2)+cmb(M,2))



        
    


# 200322 A

nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

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

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



        
    


# 200322 A

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

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

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

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

    return result

if __name__ == "__main__":
    N,M = list(map(int,input().split()))
    
    if N <= 1:
        Nc = 0
    else:
        Nc = cmb(N,2)
    
    if M < 2:
        Mc = 0
    else:
        Mc = cmb(M,2)
    print(Nc + Mc)



        
    


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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*(N-1)/2+M*(M-1)/2))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n,m=map(int,input().split())
a=(n*(n-1))/2
a+=(m*(m-1))/2
print (a)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N, M = map(int, input().split())
print(N*(N-1)/2 + M*(M-1)/2)

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math

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

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

  su = combinations_count(n+m, 2)
  mm = n*m
  ans = su-mm

  print(str(ans))

import math

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  
n,m = map(int,input().split())

su = combinations_count(n+m, 2)
mm = n*m
ans = su-mm

print(str(ans))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):

from functools import lru_cache
print(0)

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
I = input().split()

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

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


I = input().split()

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N, M = map(int, input().split())
ans = 0
if N > 1:
    ans += N*(N-1)/2
if M > 1:
    ans += M*(M-1)/2
print(ans)


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


Verdicts: Wrong Answer

Accepted