题目描述
Problem Description
During the XXXXth NOI, to enhance the exchange among contestants from different provinces, the organizing committee decided to host an inter-provincial e-sports competition. Each provincial team consists of $n$ players, competing in the universally popular online game Bubble Battle. Before each match, the coaches of both sides submit a list of players to the organizing committee, determining the order of players' appearances. Once confirmed, this order cannot be modified. The match consists of $n$ games, with the first player of each side, the second player, and so on up to the $n$th player, engaging in one-on-one battles. Each win earns 2 points, each draw earns 1 point, and each loss earns no points. The total score is the sum of the individual game scores, and the team with the higher total score advances (in case of a tie, the result is determined by drawing lots).
As the leader of the Zhejiang team, you have already thoroughly understood the Bubble Battle skills of all players from every province and quantified them with a strength value. To simplify the problem, we assume that players are not affected by any external factors during the game; that is, a stronger player will always defeat a weaker player, and two players of equal strength will always draw. Since you have no idea what strategies your opponents might use to determine their lineup, all teams adopt a strategy of completely randomizing their lineup.
Of course, you don't want to proceed with the competition blindly. You want to know in advance the best and worst possible scores for the Zhejiang team.
Input Format
The first line of the input file contains an integer $n$, representing the number of players on each team.
The next $n$ lines each contain an integer describing the strength values of the $n$ players from the Zhejiang team.
The following $n$ lines each contain an integer describing the strength values of the $n$ players from your opponent's team.
Output Format
The output file should include two integers separated by a space, representing the best and worst possible scores for the Zhejiang team, respectively. Do not output any extra whitespace at the end of the line.
Sample Input and Output
Sample Input #1
2
1
3
2
4
Sample Output #1
2 0
Sample Input #2
6
10000000
10000000
10000000
10000000
10000000
10000000
0
0
0
0
0
0
Sample Output #2
12 12
Notes
Sample Explanation 1: We label the four players as $A, B, C, D$. There are four possible matchups, with the best case scoring 2 points and the worst case scoring 0 points.
| Zhejiang | Opponent | Result | Zhejiang | Opponent | Result | Zhejiang | Opponent | Result | Zhejiang | Opponent | Result | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| First | A | C | Loss | A | D | Loss | B | C | Win | B | D | Loss |
| Second | B | D | Loss | B | C | Win | A | D | Loss | A | C | Loss |
| Score | 0 | 2 | 2 | 0 |
Sample Explanation 2: The opponents are good students who don't play games. No matter how they arrange their lineup, they will always be defeated. The Zhejiang team will always win all matches.
- For 20% of the data, $1 \leq n \leq 10$.
- For 40% of the data, $1 \leq n \leq 100$.
- For 60% of the data, $1 \leq n \leq 1000$.
- For 100% of the data, $1 \leq n \leq 100000$, and all players' strength values range from 0 to 10000000.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分