Basketball
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Basketball is a well known sport that everybody loves it, so does ssw. One day, ssw assembled 2n players. They are told to line up as two teams to practice passing the basketball. For each team, there are n players. They are required to pass the ball to the players of the other team. Because of their different physical ability, they can only pass the ball to the players in a certain range(that depends on themselves). ssw wants to know, with the best strategy, what is the minimum number of the pass that is needed to be made to let the ball passes from the left of two teams to the right(which team to begin with and which team to end with are not important).** **As ssw is a member of NCUST ACM Association, he decided to write a program to solve that.
Input Format
There are T testcases.
The first line contains a positive integer , denoting the amount of testcases.
For each testcase:
The first line of the input contains a positive integer , denoting the amount of the basketball players in one team.
The second line of the input contains positive integer denoting the range that player ,could pass through.
The third line of the input contains positive integer , denoting the range that player could pass through.
It is guarateed that the sum of n will not exceed
Output Format
For each testcase:
You should print the mininum number of the pass in a single line.
1
10
1 2 3 1 1 1 1 1 1 1
2 2 1 1 1 1 1 1 1 1
6