cf/mirror

Is It Flower?

CF
1811F2100· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
5
 
9 12
1 2
3 1
2 3
1 6
4 1
6 4
3 8
3 5
5 8
9 7
2 9
7 2
 
8 12
1 2
3 1
2 3
1 6
4 1
6 4
3 8
3 5
5 8
8 7
2 8
7 2
 
4 3
1 2
4 2
3 1
 
6 8
6 3
6 4
5 3
5 2
3 2
3 1
2 1
2 4
 
5 7
2 4
2 5
3 4
3 5
4 1
4 5
1 5
Output
YES
NO
NO
NO
NO
Sample 2of 2multi-test • hover to link
Input
4
 
2 1
1 2
 
8 9
1 2
8 4
8 2
6 4
6 5
4 7
3 2
3 7
2 5
 
9 12
2 9
2 8
6 9
6 8
6 5
6 1
9 8
9 3
9 1
8 3
8 7
5 7
 
3 3
1 2
1 3
2 3
Output
NO
NO
NO
NO
1811F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…