Crazy Diamond

2020 VietMX 0

You are given a permutation $p$ of integers from $1$ to $n$, where $n$ is an even number. Your goal is to sort the permutation. […]