44. Even Sum and Odd Sum

Acceptance — 0 accepted 0 submissions

Easy
LoopsMath
No companies listed
Two teams play a counting game: Team Even collects all even numbers from 1 to N and Team Odd collects all odd numbers.

Print the total each team collects.

Input Format
A single integer N.

Output Format
Print two numbers separated by a space: the even sum, then the odd sum.

Constraints
• 1 ≤ N ≤ 10^5

Example 1

Input
10
Output
30 25

Explanation Evens: 2+4+6+8+10 = 30. Odds: 1+3+5+7+9 = 25.

Example 2

Input
1
Output
0 1

Explanation Only 1, which is odd.

Example 3

Input
5
Output
6 9

Explanation Evens: 2+4 = 6. Odds: 1+3+5 = 9.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
30 25
No results yet
Run your code to test it against the sample cases.
Problem List