Codechef Push The Flow

[2020-2021 集训队作业] Yet Another Permutation Problem