Rising Minds in Informatics (RMI) is a two-day competition aimed at discovering and nurturing young talents in the field of computer science and informatics.
As a participant of RMI, you would like to estimate your final rank before the award ceremony. The overall scoreboard has not been released yet, but you have the scores of all contestants for each day separately, without knowing which score belongs to whom. You also know your own scores for both days.
Task
Your task is to determine:
- Best possible place: The highest rank you could achieve based on the sum of scores, assuming the most favorable pairing of scores for you.
- Worst possible place: The lowest rank you could achieve based on the sum of scores, assuming the least favorable pairing of scores for you.
What are your best and worst possible ranks in the combined total score standings? Ties (draws) are allowed, meaning multiple contestants with the same total score will share the same rank. In other words, if participants have a strictly greater score than you: you will be considered the -th.
Input data
The first line contains 3 integers , , , where is your score for the first day, is your score for the second day and there are participants excluding you.
The second line contains integers , the scores of the other participants for the first contest day (please note that your score is not included in this list).
The third line contains integers , the scores of the other participants for the second contest day (please note that your score is not included in this list).
Output data
You need to write a single line with two integers: your best possible rank and your worst possible rank.
Constraints and clarifications
- for each .
- In each subtask, you can get partial scores. You will get of the points for a subtask if you successfully determine your best possible rank in every test case, but the value of the worst possible rank is incorrect at least once. To obtain the partial score, make sure that the output of your program conforms to the output specification above, otherwise, the checker might reject your solution due to formatting error.
# | Points | Constraints |
---|---|---|
1 | 0 | Examples |
2 | 30 | . for each . |
3 | 20 | . for each . |
4 | 50 | No additional constraints. |
Example 1
stdin
100 200 2
200 200
100 100
stdout
1 1
Explanation
Everyone has a combined score of points. There is a draw in the first place.
Example 2
stdin
200 100 3
100 150 200
200 100 150
stdout
1 3
Explanation
Since , you can be ranked first. But if you are not that lucky, you can end up in the third place as . It can be proven, that you can not finish fourth.
Example 3
stdin
200 100 9
100 150 200 310 0 120 160 140 180
100 150 310 0 80 100 100 140 120
stdout
2 6