atcoder#MSOLUTIONS2019E. Product of Arithmetic Progression
Product of Arithmetic Progression
Score : points
Problem Statement
Consider the following arithmetic progression with terms:
What is the product of all terms in this sequence? Compute the answer modulo .
You are given queries of this form. In the -th query, compute the answer in case .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines.
In the -th line, print the answer for the -th query.
2
7 2 4
12345 67890 2019
9009
916936
For the first query, the answer is . Don't forget to compute the answer modulo .