cf/mirror

Median on Segments (Permutations Edition)

CF
1005E11800· expert3s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
5 4
2 4 5 3 1
Output
4
Sample 2of 3
Input
5 5
1 2 3 4 5
Output
1
Sample 3of 3
Input
15 8
1 15 2 14 3 13 4 8 12 5 11 6 10 7 9
Output
48
1005E1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)