AmazonOA #243
Group 1 Win Count
估计中等可在线判题
Each of two teams has n people. For each same-index pair i<j, the first team wins if the skill sum of its two people is strictly greater than that of the corresponding two people on the second team; a tie is not a win. Count the wins modulo 1000000007.
输入格式
The first line contains n, the second line the first team's skills, and the third line the second team's skills. 2≤n≤100000; all skills are in 1..10^9.
输出格式
Output a single integer, the answer.
样例 1
输入:
3
1 2 3
3 2 1
输出:
1
样例 2
输入:
2
5 5
5 5
输出:
0
样例 3
输入:
3
2 2 2
1 1 1
输出:
3
样例说明
The answers are 1, 0 and 3. You cannot sort the two teams separately and then subtract.