Factorization of number
WA
Math, GCD
Math, combinatorics
BigInteger division to get remainder
Graph traversal, Floyd-Warshall algorithm for easy implementation