cf/mirror

Klever Permutation

CF
1927E1400· specialist2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
2 2
3 2
10 4
13 4
7 4
Output
2 1
1 3 2
1 8 4 10 2 7 5 9 3 6
4 10 1 13 5 9 2 12 6 8 3 11 7
1 6 3 7 2 5 4
1927E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)