#B4129. Sum of Odd and Even Numbers
Sum of Odd and Even Numbers
Sum of Odd and Even Numbers
Given a positive integer \(n\), compute the sum of all odd numbers and even numbers in the sequence \(1, 2, 3, \ldots, n\). The formulas are as follows:
\[ \text{Odd Sum} = \sum_{i=1}^{n} \text{if } i \% 2 = 1, \ i \]
\[ \text{Even Sum} = \sum_{i=1}^{n} \text{if } i \% 2 = 0, \ i \]
Output the two sums separated by a space.
inputFormat
The input contains a single positive integer \(n\) (e.g., \(1 \leq n \leq 10^9\)).
outputFormat
Output two integers separated by a space: the sum of all odd numbers and the sum of all even numbers from 1 to \(n\), respectively.
sample
1
1 0