atcoder#ARC113D. [ARC113D] Sky Reflector
[ARC113D] Sky Reflector
Score : points
Problem Statement
In a grid with horizontal rows and vertical columns of squares, we will write an integer between and (inclusive) on each square and define sequences as follows:
- for each , is the minimum value written on a square in the -th row;
- for each , is the maximum value written on a square in the -th column.
Given , find the number of different pairs of sequences that can be , modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of different pairs of sequences that can be , modulo .
2 2 2
7
can be , , , , , , or - there are seven candidates.
1 1 100
100
31415 92653 58979
469486242