← ALL NOTES
Math

3658. GCD of Odd and Even Sums

Given an integer n. Compute the GCD of two quantities: sumOdd — the sum of the first n positive odd numbers, and sumEven — the sum of the first n positive even numbers. Constraint: 1 ≤ n ≤ 1000.

Loading…