This problem has $T$ cases.
You are given an undirected graph $G$, consisting of $N$ vertices and $M$ edges. The $i$-th edge connects vertex $u_ i$ and $v_ i$. This graph may not be simple.
An eulerian trail of $G$ is a pair of sequence of vertices $(v_ 0,\ldots,v_ M)$ and sequence of edges $(e_ 0,\ldots,e_ {M-1})$ satisfying following conditions.
Determine if an eulerian trail of $G$ exists, and output if it exists.
$T$
$N$ $M$
$u_ 0$ $v_ 0$
$\vdots$
$u_ {M-1}$ $v_ {M-1}$
$N$ $M$
$u_ 0$ $v_ 0$
$\vdots$
$u_ {M-1}$ $v_ {M-1}$
$\vdots$
If there exists no eulerian trail, print No
. Otherwise, print an eulerian trail in the following format.
Yes
$v_ 0$ $\ldots$ $v_ {M}$
$e_ 0$ $\ldots$ $e_ {M-1}$
3 4 7 0 1 0 2 0 2 0 3 1 3 2 3 3 3 4 6 0 1 0 2 0 3 1 2 1 3 2 3 6 10 0 3 1 2 4 0 5 1 4 4 2 3 1 3 3 2 1 4 5 1
Yes 2 0 1 3 0 2 3 3 2 0 4 3 1 5 6 No Yes 1 2 3 0 4 4 1 5 1 3 2 1 7 0 2 4 8 9 3 6 5
4 10 0 10 1 0 1 10 1 4 4 10 2 4 4 5 5
Yes 0 Yes 0 1 0 Yes 4 4 0 No
No. | Testdata Range | Score |
---|