cf/mirror

Princesses and Princes

CF
1327B1200· pupil2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
5
4
2 2 3
2 1 2
2 3 4
1 3
2
0
0
3
3 1 2 3
3 1 2 3
3 1 2 3
1
1 1
4
1 1
1 2
1 3
1 4
Output
IMPROVE
4 4
IMPROVE
1 1
OPTIMAL
OPTIMAL
OPTIMAL
1327B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…