SP22412 DIVFACT3 - Divisors of factorial (hard)

Description

Factorial numbers are getting big very soon, you'll have to compute the number of divisors of such highly composite numbers.

Input Format

The first line contains an integer _T_, the number of test cases. On the next _T_ lines, you will be given two integers _N_ and _M_.

Output Format

Output _T_ lines, one for each test case, with the number of divisors of the factorial of _N_. Since the answer can get very big, output it modulo _M_.