AtCoder Beginner Contest 159: Complete Editorial and Solutions
A - The Number of Even Pairs
Given (n) even numbers and (m) odd numbers, count the number of ways to choose two distinct numbers such that their sum is even. A sum is even only if both numbers have the same parity. The number of ways to pick two evens is (\binom{n}{2} = n(n-1)/2), and for two odds its (\binom{m}{2} = m(m-1)/2). The total is the ...
Posted on Sun, 19 Jul 2026 16:34:57 +0000 by mc2007