EasyRating 800
Alternating Sum
Print a₁ − a₂ + a₃ − a₄ + …
Input
n, then n integers.
Output
The alternating sum.
Sample 1
Input
4 1 2 3 4
Output
-2
Sample 2
Input
1 5
Output
5
Output appears heren, then n integers.
The alternating sum.
4 1 2 3 4
-2
1 5
5
Output appears here