apple pie's submission of Non Coprime Neighbours | CodeChef