#t93. 必杀技选择
必杀技选择
Choosing the Ultimate Skills
Problem Description
You must eliminate the monster that appears each day in another world for consecutive days. Each day you may use exactly one of two ultimate skills, and by the end the two skills must have been used the same number of times. You are given the power each skill consumes on each day; find the minimum total power consumption needed to finish the -day task.
Input Format
The first line contains an integer , the number of days. The following lines each contain two integers separated by a space, representing the power consumed by ultimate skill 1 and ultimate skill 2 on that day, respectively.
Output Format
Output a single line containing one integer: the minimum total power consumption.
Sample Input
4
5 4
3 6
1 8
3 9
Sample Output
14
Sample Explanation
Use ultimate skill 2 on the first and second days, and ultimate skill 1 on the third and fourth days.
Constraints
is even, , , and all values fit within the int range.