SP22463 SMALLM - Smallest Number (medium)
Description
60 is divisible by 2, 3, 4 and 5. No smaller number than 60 have this property.
Input Format
On the first line, you will be given two integers _T_ (the number of test cases), and _M_ (an integer). Each of the next _T_ lines contains an integer _N_.
Output Format
For each test case, output on one line, the smallest number that is divisible by all integers from 1 to _N_ (inclusive). As the answer may be a big number, output it modulo _M_.