P8279 "MCOI-08" Fill In REMATCH
Description
Dream has an integer array $a_1,a_2,\dots,a_n$ of length $n$ ($1\le n\le 10^5$). For $i=1,2,\dots,n$, it holds that $0\le a_i
Input Format
This problem contains multiple test cases. The first line contains a positive integer $t$, the number of test cases. Then follow $t$ test cases. For each test case:
The first line contains a positive integer $n$ ($1\le n\le 10^5$).
The next line contains $n$ integers $p_1,p_2,\dots,p_n$.
The next line contains $n$ integers $s_1,s_2,\dots,s_n$.
Output Format
For each test case:
Output $n$ non-negative integers $a_1,a_2,\dots,a_n$ that satisfy the above conditions.
Explanation/Hint
For $100\%$ of the testdata, $1\le n,\sum n\le 10^5$, $\sum [p_i=-1]+\sum [s_i=-1]=n$, and **a valid solution is guaranteed to exist.**
- Subtask 1 (10 pts): $n\le 4$, $p_i,s_i