cf/mirror

Colored Cubes

CF
1025E2700· international gm1s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
2 1
1 1
2 2
Output
2
1 1 1 2
1 2 2 2
Sample 2of 4
Input
2 2
1 1
2 2
1 2
2 1
Output
2
2 2 2 1
1 1 1 2
Sample 3of 4
Input
2 2
2 1
2 2
2 2
2 1
Output
4
2 1 1 1
2 2 2 1
1 1 1 2
1 2 2 2
Sample 4of 4
Input
4 3
2 2
2 3
3 3
3 2
2 2
2 3
Output
9
2 2 1 2
1 2 1 1
2 3 2 2
3 3 2 3
2 2 1 2
1 1 2 1
2 1 3 1
3 1 3 2
1 2 2 2
1025E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)