cf/mirror

Permutations

CF
736D2800· international gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
2 3
1 1
1 2
2 2
Output
NO
YES
NO
Sample 2of 3
Input
3 3
1 1
2 2
3 3
Output
NO
NO
NO
Sample 3of 3
Input
3 7
3 3
3 1
1 3
1 1
2 2
1 2
2 1
Output
YES
NO
NO
NO
YES
NO
NO
736D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)