#abc297f. [abc297_f]Minimum Bounding Box 2
[abc297_f]Minimum Bounding Box 2
Problem Statement
We have a grid with rows and columns.
We choose cells in this grid uniformly at random. The score is the number of cells in the minimum rectangle (whose edges are parallel to the axes of the grid) that contains all of the chosen cells.
Find the expected score modulo .
What is rational number modulo ? We can prove that the sought expected value is always a rational number. Moreover, under the Constraints of this problem, when the value is represented as by two coprime integers and , we can prove that there is a unique integer such that and . Find such .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2 2
Sample Output 1
665496238
The score equals in the following two cases: if cells and are chosen, or cells and are chosen. The other four cases yield a score of .
Thus, the expected score equals $\\frac{4 \\times 2 + 2 \\times 4} {6} = \\frac{8}{3}$. Since , you should print .
Sample Input 2
10 10 1
Sample Output 2
1
Sample Input 3
314 159 2653
Sample Output 3
639716353