#K12036. Sum of Two Lists
Sum of Two Lists
Sum of Two Lists
You are given two lists of integers chosen by Alice and Bob over m rounds. For each round, Alice selects one integer and Bob selects one integer. Your task is to calculate the total sum for Alice and the total sum for Bob.
Formally, let \(a_i\) denote the number chosen by Alice in round \(i\) and \(b_i\) denote the number chosen by Bob in the same round. You need to compute:
[ S_A = \sum_{i=1}^{m} a_i, \quad S_B = \sum_{i=1}^{m} b_i ]
Output these two sums separated by a space.
inputFormat
The input is read from stdin
and consists of three lines:
- The first line contains a single integer m which represents the number of rounds.
- The second line contains m space-separated integers, representing the numbers chosen by Alice.
- The third line contains m space-separated integers, representing the numbers chosen by Bob.
outputFormat
Output a single line to stdout
containing two space-separated integers: the sum of Alice's numbers and the sum of Bob's numbers.
3
1 3 5
6 4 2
9 12
</p>