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;
struct node {
  int v[2][2];
} tr[400005];
struct frac {
  int x, y;
  bool operator<(const frac& z) const { return 1ll * x * z.y < 1ll * y * z.x; }
  frac() {}
  frac(int ux, int uy) {
    x = ux;
    y = uy;
  }
};
struct eve {
  frac tp;
  int id, ty0, ty1;
  eve() {}
  eve(frac trp, int x, int y, int z) : tp(trp), id(x), ty0(y), ty1(z) {}
  bool operator<(const eve& y) const { return tp < y.tp; }
} ap[300005];
int cnt = 0, n, pre, pos, tmp, ans = 0, pr[100005][2], x[100005], v[100005],
    mat[100005][2][2], inv;
const int mod = 998244353;
node operator*(node a, node b) {
  node c;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      c.v[i][j] =
          (1ll * a.v[i][0] * b.v[0][j] + 1ll * a.v[i][1] * b.v[1][j]) % mod;
  return c;
}
int mypow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return ans;
}
void iden(int id, int ty0, int ty1, int x, int y) {
  if (y <= 0) return;
  ap[++cnt] = eve(frac(x, y), id, ty0, ty1);
}
void build(int p, int l, int r) {
  int mid;
  if (l == r) {
    tr[p].v[0][0] = tr[p].v[0][1] = pr[l][0];
    tr[p].v[1][0] = tr[p].v[1][1] = pr[l][1];
    return;
  }
  mid = (l + r) / 2;
  build(2 * p, l, mid);
  build(2 * p + 1, mid + 1, r);
  tr[p] = tr[2 * p] * tr[2 * p + 1];
}
void modify(int p, int l, int r) {
  int mid;
  if (l == r) {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        tr[p].v[i][j] = (mat[l][i][j] == 0 ? pr[l][i] : 0);
    return;
  }
  mid = (l + r) / 2;
  if (pos <= mid)
    modify(2 * p, l, mid);
  else
    modify(2 * p + 1, mid + 1, r);
  tr[p] = tr[2 * p] * tr[2 * p + 1];
}
int val(frac x) { return 1ll * x.x * mypow(x.y, mod - 2) % mod; }
int M(int x) { return x >= mod ? x - mod : x; }
int nw() {
  int ans = 0;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      ans = (1ll * ans + 1ll * tr[1].v[i][j] * pr[n][j]) % mod;
  return ans;
}
int main() {
  inv = mypow(100, mod - 2);
  scanf("%d", &n);
  if (n == 1) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", &x[i], &v[i], &pr[i][1]);
    pr[i][1] = 1ll * pr[i][1] * inv % mod;
    pr[i][0] = (mod + 1 - pr[i][1]) % mod;
  }
  for (int i = 1; i < n; i++) {
    iden(i, 0, 0, x[i + 1] - x[i], v[i + 1] - v[i]);
    iden(i, 1, 0, x[i + 1] - x[i], v[i] + v[i + 1]);
    iden(i, 1, 1, x[i + 1] - x[i], v[i] - v[i + 1]);
  }
  sort(ap + 1, ap + cnt + 1);
  build(1, 1, n - 1);
  pre = 1;
  for (int i = 1; i <= cnt; i++) {
    mat[ap[i].id][ap[i].ty0][ap[i].ty1] = 1;
    pos = ap[i].id;
    modify(1, 1, n - 1);
    ans = (1ll * ans + 1ll * val(ap[i].tp) * (pre - (tmp = nw())) % mod + mod) %
          mod;
    pre = tmp;
  }
  printf("%d\n", ans);
  return 0;
}