cf/mirror

Permutation of Rows and Columns

CF
1980E1600· expert3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
7
1 1
1
1
2 2
1 2
3 4
4 3
2 1
2 2
1 2
3 4
4 3
1 2
3 4
1 5 9 6
12 10 4 8
7 11 3 2
1 5 9 6
12 10 4 8
7 11 3 2
3 3
1 5 9
6 4 2
3 8 7
9 5 1
2 4 6
7 8 3
2 3
1 2 6
5 4 3
6 1 2
3 4 5
1 5
5 1 2 3 4
4 2 5 1 3
Output
YES
YES
NO
YES
YES
NO
YES
1980E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)