stones inside the sea. Assume that Gromah and LZR are at position. 1,2,,L1 respectively. So Gromah and LZR can jump on the stones to cross the sea.Unfortunately, the stones are not stable. To ensure safety, Gromah and LZR should go forward at least. positions each time. Formally, if they are at position. currently, they should jump onto the positions not less than. . Moreover, they can't be at positions greater than. in any time, which means that the destination of their last jump should be exactly position. More unfortunately, the Infernos under the sea will attack them. times in total, each attack can be described as a tuple. But fortunately, here comes the farmer and he tells Gromah and LZR all the attack plans, so they can work out some jumping plans according to the information given by the farmer to get to the destination without being attacked.Please help them determine the number of jumping plans satisfying all the restrictions described above. Since the number may be very large, you should report it modulo. Two jumping plans are considered different if there exists at least one
Gromah and LZR have entered the final level. In this level, they need to cross the sea of death to gain the treasures. The sea of death is of width L_{} L , and there are L-1_{} L−1 stones inside the sea. Assume that Gromah and LZR are at position 0_{} initially, that the treasures are at position L_{} L , and that stones are at position 1,2, cdots, L-1 1,2,⋯,L−1 respectively. So Gromah and LZR can jump on the stones to cross the sea. Unfortunately, the stones are not stable. To ensure safety, Gromah and LZR should go forward at least d_{} d positions each time. Formally, if they are at position x_{} x currently, they should jump onto the positions not less than x+d_{} x+d . Moreover, they can't be at positions greater than L_{} L in any time, which means that the destination of their last jump should be exactly position L_{} L , or the treasure keepers will see them and come to eat them. More unfortunately, the Infernos under the sea will attack them m_{} m times in total, each attack can be described as a tuple (t,p)_{} (t,p) , denoting that the stone at position p_{} p will be attacked right after their t_{} t -th jump, which means their destination of t_{} t -th jump can't be position p_{} p . But fortunately, here comes the farmer(mentioned in problem I but not necessary to care in this problem) and he tells Gromah and LZR all the attack plans, so they can work out some jumping plans according to the information given by the farmer to get to the destination without being attacked. Please help them determine the number of jumping plans satisfying all the restrictions described above. Since the number may be very large, you should report it modulo 998244353_{} 998244353 . Two jumping plans are considered different if there exists at least one t_{} t that their positions after t_{} t -th jump are different in two plans.