You are given two integers and . You need to find the value of
As the value of this equation may be large, you need to find its remainder modulo ().
The first line will contain an integer (), the number of test cases.
Each of the next lines will contain two integers and ().
Find the value of the aforementioned product modulo ().
Input | Output |
---|---|
2 1 2 100 100 | 8 409005006 |