HACKERRANK: Sherlock and GCD

https://www.hackerrank.com/challenges/sherlock-and-gcd