CF1895E.Infinite Card Game
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
The first line contains a single integer t ( 1≤t≤104 ) — the number of test cases.
The first line of each test case contains an integer n ( 1≤n≤3⋅105 ) — the number of cards Monocarp has.
The second line contains n integers ax1,ax2,…,axn ( 1≤axi≤106 ) — the attack values of Monocarp's cards.
The third line contains n integers ay1,ay2,…,ayn ( 1≤ayi≤106 ) — the defence values of Monocarp's cards.
The fourth line contains a single integer m ( 1≤m≤3⋅105 ) — the number of cards Bicarp has.
The fifth line contains m integers bx1,bx2,…,bxm ( 1≤bxj≤106 ) — the attack values of Bicarp's cards.
The sixth line contains m integers by1,by2,…,bym ( 1≤byj≤106 ) — the defence values of Bicarp's cards.
Additional constraints on the input: the sum of n over all test cases doesn't exceed 3⋅105 , the sum of m over all test cases doesn't exceed 3⋅105 .
输入格式
For each test case, print three integers:
- the number of Monocarp's starting moves that result in a win for Monocarp;
- the number of Monocarp's starting moves that result in a draw;
- the number of Monocarp's starting moves that result in a win for Bicarp.
输出格式
无
输入输出样例
输入#1
3 3 8 7 4 7 1 10 2 8 4 5 10 9 8 8 5 5 5 4 4 1 4 2 7 5 2 8 9 7 1 9 10 9 8 7 6 5 5 4 3 2 1 7 1 6 7 5 8 8 4 9 6 1 10 5 1 10 5
输出#1
1 1 1 2 4 3 0 1 0