cf/mirror

Magic multisets

CF
981G2500· grandmaster4s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
4 4
1 1 2 1
1 1 2 2
1 1 4 1
2 1 4
Output
10
Sample 2of 2
Input
3 7
1 1 1 3
1 1 1 3
1 1 1 2
1 1 1 1
2 1 1
1 1 1 2
2 1 1
Output
4
8
981G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)