F. Flow++
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Examples
Input
2
2 5
2 1 2 4
0 2 4 5
2 5
0 1 5 4
0 4 5 1
Output
YES
1 2 1 2 4
4 0 2 1 2 1 0.5 4 0.5 4 5
NO
Input
1
3 8
2 0 6 7
4 0 4 8
6 0 2 7
Output
YES
4 2 0 2 6 3 6 3 7 6 7
9 4 0 4 6.5 6.5 6.5 6.5 7.25 2.5 7.25 2.5 6.5 1 6.5 1 7.75 4 7.75 4 8
5 6 0 6 6 7 6 7 7.5 2 7.5 2 7