NP-Hard Problem
687A1500· specialist2s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
4 21 22 3
Output
1221 3
Sample 2of 2
Input
3 31 22 31 3
Output
-1
58%
687A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…
4 21 22 3
1221 3
3 31 22 31 3
-1