Alice and Bob both love playing games. Now, Alice and Bob are playing a cue sport like Nine-ball Pool. Two players move in turn. A move is that one player use the cue ball to hit the target ball for pocketing the target ball. At the beginning of game, there are one cue ball and `n` object balls. Each object ball has a number (a positive integer) on it, and no two object balls have the same number. In a move, the target ball is a object ball still on the table with the smallest number. If the player does the following things in a move, a foul is called and a penalty point is added to the opposite's point:

- Cue ball do not hit any object ball. Penalty: the number of target ball.
- Cue ball is not pocketed and hit at least one ball, but do not hit target ball first or hit more than one object ball first at the same time. Penalty: the largest number of ball in the first hit balls.
- Cue ball is pocketed and hit at least one ball. Penalty: the largest number of ball in the first hit balls.

Now given `n` object balls and `m` moves, Bob wants to write a program to calculate the final points of Alice and him after these `m` moves. Because of *Lady's first Rule*, Alice always moves first.

There are multiple cases. The first line of each case consists of two integers, `n` and `m` (1 ≤ `n` ≤ 1000, 0 ≤ `m` ≤ 1000), as described above. The second line consists of `n` positive integers. Each integer `a _{i}` means the number of i

提交代码