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>
const int MAXN = 1e5 + 10;
const long long P = 998244353;
int n, cnta;
long long x[MAXN], v[MAXN], pro[MAXN][2], ans, ys[MAXN], inv;
bool book[MAXN][2][2];
struct node {
  int u, d1, d2;
  long long x, v;
} a[MAXN << 1];
struct node2 {
  int l, r;
  long long p[2][2];
} tree[MAXN << 2];
int Read() {
  int sum = 0, fh = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar()) fh -= (ch == '-') << 1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    sum = (sum << 3) + (sum << 1) + (ch ^ 48);
  return sum * fh;
}
int Max(int fir, int sec) { return (fir > sec) ? fir : sec; }
int Min(int fir, int sec) { return (fir < sec) ? fir : sec; }
long long ksm(long long aa, long long bb, long long P) {
  long long ans = 1 % P;
  for (; bb; bb >>= 1, aa = aa * aa % P)
    if (bb & 1) ans = ans * aa % P;
  return ans;
}
bool cmp(const node &fir, const node &sec) {
  return (fir.x * sec.v) < (sec.x * fir.v);
}
void Update(int p) {
  int mid = (tree[p].l + tree[p].r) >> 1;
  for (int firx = 0; firx < 2; ++firx)
    for (int firy = 0; firy < 2; ++firy) {
      tree[p].p[firx][firy] = 0;
      for (int secx = 0; secx < 2; ++secx)
        for (int secy = 0; secy < 2; ++secy)
          if (!book[mid][secx][secy])
            ((tree[p].p[firx][firy] += tree[p << 1].p[firx][secx] *
                                       tree[p << 1 | 1].p[secy][firy] % P) >= P)
                ? (tree[p].p[firx][firy] %= P)
                : 0;
    }
}
void build(int p, int l, int r) {
  tree[p].l = l, tree[p].r = r;
  if (l == r) {
    tree[p].p[0][0] = pro[l][0];
    tree[p].p[1][1] = pro[l][1];
    return;
  }
  int mid = (l + r) >> 1;
  ys[mid] = p;
  build(p << 1, l, mid);
  build(p << 1 | 1, mid + 1, r);
  Update(p);
}
int main() {
  n = Read();
  inv = ksm(100, P - 2, P);
  for (int i = 1; i <= n; ++i) {
    x[i] = Read(), v[i] = Read();
    pro[i][1] = Read() * inv % P;
    pro[i][0] = (1 - pro[i][1] + P) % P;
  }
  for (int i = 1; i < n; ++i) {
    ++cnta;
    a[cnta] = (node){i, 1, 0, x[i + 1] - x[i], v[i + 1] + v[i]};
    if (v[i] > v[i + 1]) {
      ++cnta;
      a[cnta] = (node){i, 1, 1, x[i + 1] - x[i], v[i] - v[i + 1]};
    } else if (v[i] < v[i + 1]) {
      ++cnta;
      a[cnta] = (node){i, 0, 0, x[i + 1] - x[i], v[i + 1] - v[i]};
    }
  }
  std::sort(a + 1, a + cnta + 1, cmp);
  build(1, 1, n);
  long long Last = 1;
  for (int i = 1; i <= cnta; ++i) {
    book[a[i].u][a[i].d1][a[i].d2] = 1;
    for (int j = ys[a[i].u]; j; j >>= 1) Update(j);
    long long now = (tree[1].p[0][0] + tree[1].p[1][0] + tree[1].p[0][1] +
                     tree[1].p[1][1]) %
                    P;
    ((ans += a[i].x * ksm(a[i].v, P - 2, P) % P * (Last - now + P) % P) >= P)
        ? (ans %= P)
        : 0;
    Last = now;
  }
  printf("%lld\n", ans);
  return 0;
}