cf/mirror

Interesting Problem (Easy Version)

CF
1987F12500· grandmaster2s256 MB⌨ stdin/stdout
#dp

Examples

Sample 1of 1multi-test • hover to link
Input
6
5
1 5 3 2 4
8
2 1 3 4 5 6 7 8
3
1 2 3
4
1 2 4 4
5
4 4 1 3 5
1
1
Output
2
3
1
2
0
0
1987F1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)