#K37702. Plant Combinations
Plant Combinations
Plant Combinations
Alice has a collection of plant types and a set of pots. In each combination, every pot can be filled with any one of the available plant types. Given three integers p, q, and s (where s is an extra parameter provided for compatibility but does not affect the outcome), the task is to compute the number of different combinations that can be formed, which is given by \( p^q \) modulo \(10^9+7\).
In other words, you need to calculate:
[ \text{result} = p^q \mod (10^9+7). ]
For example, if p = 3, q = 2, and s = 5, the answer is \( 3^2 = 9 \) (modulo \(10^9+7\)).
inputFormat
The input is read from standard input and begins with an integer T, denoting the number of test cases. Each test case is given on a single line containing three space-separated integers p, q, and s. Although the third parameter s is provided, it does not impact the calculation.
Example:
1 3 2 5
outputFormat
For each test case, output a single line containing the result of \( p^q \) modulo \(10^9+7\).
Example:
9## sample
1
3 2 5
9
</p>