cf/mirror

Monotone Monochrome Matrices (Easy Version)

CF
2202G12500· grandmaster4s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
2
3 9
2 2
3 3
2 3
3 1
3 2
1 1
1 2
2 1
1 3
5 17
2 1
4 5
4 1
3 3
3 1
3 5
1 3
1 5
1 1
5 3
5 5
5 1
1 4
5 2
5 4
1 2
2 5
Output
YES
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
YES
NO
NO
YES
NO
NO
YES
NO
NO
YES
YES
NO
YES
YES
YES
2202G1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)