apple pie's submission of Permutation GCD | CodeChef