#P1286D. LCC

    ID: 5160 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>data structuresmathmatricesprobabilities*3100

LCC

No submission language available for this problem.

Description

An infinitely long Line Chillland Collider (LCC) was built in Chillland. There are nn pipes with coordinates xix_i that are connected to LCC. When the experiment starts at time 0, ii-th proton flies from the ii-th pipe with speed viv_i. It flies to the right with probability pip_i and flies to the left with probability (1pi)(1 - p_i). The duration of the experiment is determined as the time of the first collision of any two protons. In case there is no collision, the duration of the experiment is considered to be zero.

Find the expected value of the duration of the experiment.

Illustration for the first example

The first line of input contains one integer nn — the number of pipes (1n1051 \le n \le 10^5). Each of the following nn lines contains three integers xix_i, viv_i, pip_i — the coordinate of the ii-th pipe, the speed of the ii-th proton and the probability that the ii-th proton flies to the right in percentage points (109xi109,1v106,0pi100-10^9 \le x_i \le 10^9, 1 \le v \le 10^6, 0 \le p_i \le 100). It is guaranteed that all xix_i are distinct and sorted in increasing order.

It's possible to prove that the answer can always be represented as a fraction P/QP/Q, where PP is an integer and QQ is a natural number not divisible by 998244353998\,244\,353. In this case, print PQ1P \cdot Q^{-1} modulo 998244353998\,244\,353.

Input

The first line of input contains one integer nn — the number of pipes (1n1051 \le n \le 10^5). Each of the following nn lines contains three integers xix_i, viv_i, pip_i — the coordinate of the ii-th pipe, the speed of the ii-th proton and the probability that the ii-th proton flies to the right in percentage points (109xi109,1v106,0pi100-10^9 \le x_i \le 10^9, 1 \le v \le 10^6, 0 \le p_i \le 100). It is guaranteed that all xix_i are distinct and sorted in increasing order.

Output

It's possible to prove that the answer can always be represented as a fraction P/QP/Q, where PP is an integer and QQ is a natural number not divisible by 998244353998\,244\,353. In this case, print PQ1P \cdot Q^{-1} modulo 998244353998\,244\,353.

Samples

Sample Input 1

2
1 1 100
3 1 0

Sample Output 1

1

Sample Input 2

3
7 10 0
9 4 86
14 5 100

Sample Output 2

0

Sample Input 3

4
6 4 50
11 25 50
13 16 50
15 8 50

Sample Output 3

150902884