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;
const long long mod = 998244353;
struct Matrix {
  long long n, m, a[2][2];
} t[100002 * 4], f[100002];
struct query {
  long long s, v, op1, op2, x;
} q[100002 * 4];
long long n, m, i, j, k, x[100002], v[100002], p[100002], ans;
long long read() {
  char c = getchar();
  long long w = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    w = w * 10 + c - '0';
    c = getchar();
  }
  return w * f;
}
Matrix operator*(Matrix a, Matrix b) {
  Matrix c;
  c.n = a.n;
  c.m = b.m;
  memset(c.a, 0, sizeof(c.a));
  for (long long i = 0; i <= a.n; i++) {
    for (long long j = 0; j <= b.m; j++) {
      for (long long k = 0; k <= a.m; k++)
        c.a[i][j] = (c.a[i][j] + a.a[i][k] * b.a[k][j] % mod) % mod;
    }
  }
  return c;
}
long long poww(long long a, long long b) {
  long long ans = 1, base = a;
  while (b) {
    if (b & 1) ans = ans * base % mod;
    base = base * base % mod;
    b >>= 1;
  }
  return ans;
}
long long my_comp(const query &a, const query &b) {
  return a.s * b.v < b.s * a.v;
}
void update(long long p) { t[p] = t[p * 2] * t[p * 2 + 1]; }
void build(long long p, long long l, long long r) {
  if (l == r) {
    t[p] = f[l];
    return;
  }
  long long mid = (l + r) / 2;
  build(p * 2, l, mid);
  build(p * 2 + 1, mid + 1, r);
  update(p);
}
void change(long long p, long long l, long long r, long long x) {
  if (l == r) {
    t[p] = f[l];
    return;
  }
  long long mid = (l + r) / 2;
  if (x <= mid)
    change(p * 2, l, mid, x);
  else
    change(p * 2 + 1, mid + 1, r, x);
  update(p);
}
signed main() {
  n = read();
  for (i = 1; i <= n; i++) {
    x[i] = read();
    v[i] = read();
    p[i] = read();
    p[i] = p[i] * poww(100, mod - 2) % mod;
  }
  for (i = 1; i < n; i++) {
    q[++m] = (query){x[i + 1] - x[i], v[i] + v[i + 1], 1, 0, i + 1};
    if (v[i + 1] > v[i])
      q[++m] = (query){x[i + 1] - x[i], v[i + 1] - v[i], 0, 0, i + 1};
    if (v[i] > v[i + 1])
      q[++m] = (query){x[i + 1] - x[i], v[i] - v[i + 1], 1, 1, i + 1};
  }
  sort(q + 1, q + m + 1, my_comp);
  for (i = 1; i <= n; i++) {
    f[i].n = f[i].m = 1;
    f[i].a[0][0] = f[i].a[1][0] = (mod - p[i] + 1) % mod;
    f[i].a[0][1] = f[i].a[1][1] = p[i];
  }
  build(1, 1, n);
  for (i = 1; i <= m; i++) {
    Matrix tmp = f[q[i].x];
    for (j = 0; j <= 1; j++) {
      for (k = 0; k <= 1; k++) {
        if (j != q[i].op1 || k != q[i].op2) f[q[i].x].a[j][k] = 0;
      }
    }
    change(1, 1, n, q[i].x);
    f[q[i].x] = tmp;
    long long res = q[i].s * poww(q[i].v, mod - 2) % mod;
    ans = (ans + res * (t[1].a[0][0] + t[1].a[0][1]) % mod) % mod;
    f[q[i].x].a[q[i].op1][q[i].op2] = 0;
    change(1, 1, n, q[i].x);
  }
  printf("%lld\n", ans);
  return 0;
}