cf/mirror

Special Permutations

CF
1234E2000· candidate master2s256 MB⌨ stdin/stdout
#math

Examples

Sample 1of 3
Input
4 4
1 2 3 4
Output
3 4 6 5
Sample 2of 3
Input
5 5
2 1 5 3 5
Output
9 8 12 6 8
Sample 3of 3
Input
2 10
1 2 1 1 2 2 2 2 2 2
Output
3 3
1234E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)