Vitalii and Bohdan have a total of cards, each uniquely numbered from to . Vitalii receives of these cards, while Bohdan gets the remaining cards.
They play a game called "Drunkard," where they shuffle their decks and draw the top card in each round. The player with the higher card value wins that round and scores a point. They continue playing until all cards have been used, resulting in rounds.
Your task is to determine the minimum and maximum number of points Vitalii can score.
The first line contains a single integer (1 \le n \le 10^5), representing the number of cards each player holds.
The second line lists distinct integers a_1, a_2, \dots, a_n (1 \le a_i \le 2n), which are the values of Vitalii's cards.
Output two integers: the minimum and maximum number of points Vitalii can score.
Example 1
Example 2
Consider the first example where Vitalii's cards are , and Bohdan's cards are . Here are two possible outcomes:
Vitalii plays , Bohdan plays . Bohdan scores because 1 < 6.
Vitalii plays , Bohdan plays . Vitalii scores because 4 > 2.
Vitalii plays , Bohdan plays . Vitalii scores because 5 > 3.
Vitalii scores two points.
In another scenario:
Vitalii plays , Bohdan plays . Bohdan scores because 1 < 2.
Vitalii plays , Bohdan plays . Bohdan scores because 4 < 6.
Vitalii plays , Bohdan plays . Vitalii scores because 5 > 3.
Vitalii scores one point.
By examining all possible outcomes, it is evident that Vitalii cannot score fewer than one point or more than two points.
In the second example, Vitalii's cards are , and Bohdan's cards are . Here, every card Vitalii plays is greater than any card Bohdan plays, so Vitalii scores exactly points in every scenario.
Solutions that correctly handle the constraints 1 \le n \le 2\,000 will earn of the total points.