cf/mirror

Problem of offices

CF
793E2900· international gm2s256 MB⌨ stdin/stdout

Examples

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