Hacker Rank : Algorithms : Number Theory : Reverse Game