Loading...
The Split
Time: 2 s
Memory: 125 MB
Levi is playing an exciting game where he collects points and distributes them into two different bags based on their type:
 
  • Red Bag: If the collected point is odd, it is placed in the red bag.
  • Blue Bag: If the collected point is even, it is placed in the blue bag.
 
Red Pill Blue Pill Meme Template


Levi has collected n points in total, and he wants to know the total number of points he has in each bag. Can you help him?
Input
An integer \( N \) the number of points collected.
A sequence of N integers \(a_1, a_2,...a_n \) \(-\)the points Levi has collected.
Constraint
\(1\leq n \leq 10^5\)
\(1 \leq a_i \leq 10^5\)
 
Output
Output two integers:

The total points in the red bag.
The total points in the blue bag.
Examples
Input
Output
7
2 20 5 40 10 28 55
60 100
Input
Output
5
1 5 2 7 4
13 6
Problem Info
Problem ID 381
Time Limit 2000 ms
Memory Limit 128000 KB
Moderators meheraj_hossain_ , lauhemahfus , tafsiruzzaman , refred1 , sagorahmedmunna , osama_bq , amirhozaifa , Dr_KeK , Rakib , fahimcp495
Statistics
Submit
You need to Login or Registration for submit your solution