cf/mirror

Reindeer Games

CF
1615H3000· legendary gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
7 6
3 1 4 9 2 5 6
1 2
2 3
3 4
4 5
5 6
6 7
Output
1 1 4 4 4 5 6
Sample 2of 3
Input
4 6
6 5 8 2
3 1
4 1
3 2
1 2
2 3
3 1
Output
6 6 6 2
Sample 3of 3
Input
10 18
214 204 195 182 180 176 176 172 169 167
1 2
3 2
4 2
5 2
6 2
7 2
8 2
9 2
10 2
6 1
6 2
6 3
6 4
6 5
6 7
6 8
6 9
6 10
Output
204 204 195 182 180 167 176 172 169 167
1615H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…