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 int MAXN = 100010;
const int MOD = 998244353;
inline int add(int a, int b) { return (a += b) >= MOD ? a - MOD : a; }
inline int sub(int a, int b) { return (a -= b) < 0 ? a + MOD : a; }
inline int mul(int a, int b) { return 1ll * a * b % MOD; }
inline int pw(int x, int p) {
  int res = 1;
  for (; p; p >>= 1, x = mul(x, x))
    if (p & 1) res = mul(res, x);
  return res;
}
inline int inv(int x) { return pw(x, MOD - 2); }
const int N = 2;
struct mat {
  int ele[2][2];
  mat() {
    for (int i = 0; i < N; i++)
      for (int j = 0; j < N; j++) ele[i][j] = 0;
  }
  inline void cover(int a, int b, int c, int d) {
    ele[0][0] = a;
    ele[0][1] = b;
    ele[1][0] = c;
    ele[1][1] = d;
  }
  inline int& operator()(const int ix, const int iy) { return ele[ix][iy]; }
  inline friend mat operator*(mat x, mat y) {
    mat res;
    for (int i = 0; i < N; i++)
      for (int j = 0; j < N; j++)
        for (int k = 0; k < N; k++)
          res(i, j) = add(res(i, j), mul(x(i, k), y(k, j)));
    return res;
  }
};
int n;
struct qua {
  int pos, v, p[2];
} a[MAXN];
struct pa {
  int ind, dis, v, x, y;
  pa(int I = 0, int D = 0, int V = 0, int X = 0, int Y = 0)
      : ind(I), dis(D), v(V), x(X), y(Y) {}
  bool operator<(const pa& o) const {
    return 1ll * dis * o.v < 1ll * o.dis * v;
  }
} b[MAXN << 1];
int cnt = 0;
struct node {
  int l, r;
  mat val;
} t[MAXN << 2];
inline void pushUp(int k) { t[k].val = t[k << 1].val * t[k << 1 | 1].val; }
void build(int l, int r, int k) {
  t[k].l = l;
  t[k].r = r;
  if (l == r) {
    t[k].val.cover(a[l].p[0], a[l].p[1], a[l].p[0], a[l].p[1]);
    return;
  }
  int mid = l + r >> 1;
  build(l, mid, k << 1);
  build(mid + 1, r, k << 1 | 1);
  pushUp(k);
}
void update(int pos, int i, int j, int k) {
  if (t[k].l == t[k].r) {
    t[k].val(i, j) = 0;
    return;
  }
  int mid = t[k].l + t[k].r >> 1;
  if (pos <= mid)
    update(pos, i, j, k << 1);
  else
    update(pos, i, j, k << 1 | 1);
  pushUp(k);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int tmp;
    scanf("%d%d%d", &a[i].pos, &a[i].v, &tmp);
    a[i].p[1] = mul(tmp, inv(100));
    a[i].p[0] = sub(1, a[i].p[1]);
  }
  for (int i = 1; i < n; i++) {
    b[++cnt] = pa(i + 1, a[i + 1].pos - a[i].pos, a[i].v + a[i + 1].v, 1, 0);
    if (a[i].v > a[i + 1].v)
      b[++cnt] = pa(i + 1, a[i + 1].pos - a[i].pos, a[i].v - a[i + 1].v, 1, 1);
    if (a[i].v < a[i + 1].v)
      b[++cnt] = pa(i + 1, a[i + 1].pos - a[i].pos, a[i + 1].v - a[i].v, 0, 0);
  }
  sort(b + 1, b + cnt + 1);
  build(1, n, 1);
  int ans = 0;
  for (int i = 1; i <= cnt; i++) {
    int bef = add(t[1].val(0, 0), t[1].val(0, 1));
    update(b[i].ind, b[i].x, b[i].y, 1);
    int aft = add(t[1].val(0, 0), t[1].val(0, 1));
    ans = add(ans, mul(mul(b[i].dis, inv(b[i].v)), sub(bef, aft)));
  }
  printf("%d\n", ans);
  return 0;
}