Problem Statement
You are given sequences of positive integers of length $N$: $A=(A_1,A_2,\ldots,A_N),B=(B_1,B_2,\ldots,B_N)$.
Determine whether there exists an integer sequence $X=(X_1,X_2,\ldots,X_N)$ that satisfies all the following conditions, and if it exists, find one.
$-10^8\le X_i\le 10^8$$(1\le i\le N)$$\displaystyle \sum_{i=1}^N A_iX_i > 0$$\displaystyle \sum_{i=1}^N B_iX_i < 0$
You are given $T$ test cases, so find the answer for each.
Constraints
$1\le T\le 2\times 10^5$$1\le N\le 2\times 10^5$$1\le A_i,B_i\le 10^5$- The sum of
$N$over all test cases is at most$2\times 10^5$. - All input values are integers.
Input
The input is given from Standard Input in the following format:
T
\text{case}_1
\text{case}_2
\vdots
\text{case}_T
Each test case is given in the following format:
N
A_1 A_2 \ldots A_N
B_1 B_2 \ldots B_N
Output
Output your solutions for the test cases in order, separated by newlines.
For each test case, if there is no $X$ that satisfies all conditions, output No.
Otherwise, output an $X$ that satisfies all conditions in the following format:
Yes
X_1 X_2 \ldots X_N
If there are multiple $X$ that satisfy the conditions, you may output any of them.
样例
3
3
3 1 4
1 5 1
3
4 4 4
7 7 7
4
20 25 6 15
31 41 59 26
Yes
4 -5 1
No
Yes
45 -10 -40 11
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。