Problem: An infinitely long Line Chillland Collider (LCC) was built in Chillland. There are n pipes with coordinates x_i that are connected to LCC. When the experiment starts at time 0, i-th proton flies from the i-th pipe with speed v_i. It flies to the right with probability p_i and flies to the left with probability (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.

<image>Illustration for the first example

Input

The first line of input contains one integer n — the number of pipes (1 ≤ n ≤ 10^5). Each of the following n lines contains three integers x_i, v_i, p_i — the coordinate of the i-th pipe, the speed of the i-th proton and the probability that the i-th proton flies to the right in percentage points (-10^9 ≤ x_i ≤ 10^9, 1 ≤ v ≤ 10^6, 0 ≤ p_i ≤ 100). It is guaranteed that all x_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/Q, where P is an integer and Q is a natural number not divisible by 998 244 353. In this case, print P ⋅ Q^{-1} modulo 998 244 353.

Examples

Input


2
1 1 100
3 1 0


Output


1


Input


3
7 10 0
9 4 86
14 5 100


Output


0


Input


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


Output


150902884

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int N;
int n, p[400005], c[400005], sx[400005], ty[400005], px[400005], py[400005],
    cnt, rtm[400005];
int x[400005], v[400005];
double TM[400005];
bool cmp(const int &u, const int &v) { return TM[u] < TM[v]; }
int Pow(int b, int k) {
  int r = 1;
  for (; k; k >>= 1, b = 1ll * b * b % 998244353)
    if (k & 1) r = 1ll * r * b % 998244353;
  return r;
}
struct mat {
  int a[2][2];
  mat(int d = 0) {
    memset(a, 0, sizeof a);
    for (int i = (0), LIM = (1); i <= LIM; i++) a[i][i] = d;
  }
  mat operator*(const mat &B) const {
    mat r;
    r.a[0][0] =
        (1ll * a[0][0] * B.a[0][0] + 1ll * a[0][1] * B.a[1][0]) % 998244353;
    r.a[0][1] =
        (1ll * a[0][0] * B.a[0][1] + 1ll * a[0][1] * B.a[1][1]) % 998244353;
    r.a[1][0] =
        (1ll * a[1][0] * B.a[0][0] + 1ll * a[1][1] * B.a[1][0]) % 998244353;
    r.a[1][1] =
        (1ll * a[1][0] * B.a[0][1] + 1ll * a[1][1] * B.a[1][1]) % 998244353;
    return r;
  }
} tr[400005];
int main() {
  scanf("%d", &n);
  int iv = Pow(100, 998244353 - 2);
  for (int i = (1), LIM = (n); i <= LIM; i++)
    scanf("%d%d%d", &x[i], &v[i], &p[i]), p[i] = 1ll * p[i] * iv % 998244353;
  for (N = 1; N < n; N <<= 1)
    ;
  for (int i = (1), LIM = (N); i <= LIM; i++)
    for (int j = (0), LIM = (1); j <= LIM; j++)
      for (int k = (0), LIM = (1); k <= LIM; k++)
        tr[N + i - 1].a[j][k] = (k ? p[i] : 1 - p[i]);
  for (int i = (N - 1), LIM = (1); i >= LIM; i--)
    tr[i] = tr[i << 1] * tr[i << 1 | 1];
  for (int i = (2), LIM = (n); i <= LIM; i++)
    for (int j = (0), LIM = (1); j <= LIM; j++)
      for (int k = (0), LIM = (1); k <= LIM; k++) {
        int vx = j ? v[i - 1] : -v[i - 1], vy = k ? v[i] : -v[i];
        if (vx <= vy) continue;
        sx[++cnt] = i - 1, ty[cnt] = i;
        px[cnt] = j, py[cnt] = k;
        TM[cnt] = 1.0 * (x[i] - x[i - 1]) / (vx - vy);
        rtm[cnt] =
            (x[i] - x[i - 1]) * 1ll * Pow(vx - vy, 998244353 - 2) % 998244353;
        c[cnt] = cnt;
      }
  sort(c + 1, c + 1 + cnt, cmp);
  int ans = 0;
  for (int i = (1), LIM = (cnt); i <= LIM; i++) {
    int u = c[i];
    mat tmp = tr[ty[u] + N - 1];
    tr[ty[u] + N - 1] = mat();
    tr[ty[u] + N - 1].a[px[u]][py[u]] = tmp.a[px[u]][py[u]];
    for (int p = (ty[u] + N - 1) >> 1; p; p >>= 1)
      tr[p] = tr[p << 1] * tr[p << 1 | 1];
    ans = (ans + 1ll * rtm[u] * (tr[1].a[0][0] + tr[1].a[0][1])) % 998244353;
    tmp.a[px[u]][py[u]] = 0;
    tr[ty[u] + N - 1] = tmp;
    for (int p = (ty[u] + N - 1) >> 1; p; p >>= 1)
      tr[p] = tr[p << 1] * tr[p << 1 | 1];
  }
  printf("%d\n", (ans + 998244353) % 998244353);
}