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 _ = 1e5 + 5, Mo = 998244353, Inv = 828542813;
int power(int x, int k) {
  int res = 1;
  for (; k; k >>= 1, x = 1ll * x * x % Mo)
    if (k & 1) res = 1ll * res * x % Mo;
  return res % Mo;
}
struct Matrix {
  int a[2][2];
  Matrix() { memset(a, 0, sizeof a); }
  int* operator[](int id) { return a[id]; }
  Matrix operator*(Matrix b) const {
    Matrix ans;
    for (int i = 0; i < 2; ++i)
      for (int j = 0; j < 2; ++j)
        for (int k = 0; k < 2; ++k)
          ans[i][j] = (ans[i][j] + 1ll * a[i][k] * b[k][j] % Mo) % Mo;
    return ans;
  }
} t[_ << 2];
int n, x[_], v[_], P[_];
int cnt;
struct node {
  int x, v, a, b, id;
} o[_ << 1];
int cmp(node a, node b) { return 1ll * a.x * b.v < 1ll * b.x * a.v; }
int lc(int p) { return p << 1; }
int rc(int p) { return p << 1 | 1; }
void pushup(int p) { t[p] = t[lc(p)] * t[rc(p)]; }
void build(int p = 1, int l = 1, int r = n) {
  if (l == r) {
    t[p][0][0] = t[p][1][0] = Mo + 1 - P[l];
    t[p][0][1] = t[p][1][1] = P[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(lc(p), l, mid), build(rc(p), mid + 1, r), pushup(p);
}
void update(int x, int a, int b, int p = 1, int l = 1, int r = n) {
  if (l == r) {
    t[p][a][b] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(x, a, b, lc(p), l, mid);
  else
    update(x, a, b, rc(p), mid + 1, r);
  pushup(p);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d %d %d", x + i, v + i, P + i), P[i] = 1ll * P[i] * Inv % Mo;
  build();
  for (int i = 1; i < n; ++i) {
    o[++cnt] = (node){x[i + 1] - x[i], v[i] + v[i + 1], 1, 0, i + 1};
    if (v[i] > v[i + 1])
      o[++cnt] = (node){x[i + 1] - x[i], v[i] - v[i + 1], 1, 1, i + 1};
    if (v[i] < v[i + 1])
      o[++cnt] = (node){x[i + 1] - x[i], v[i + 1] - v[i], 0, 0, i + 1};
  }
  sort(o + 1, o + cnt + 1, cmp);
  int ans = 0;
  for (int i = 1; i <= cnt; ++i) {
    int tmp = (t[1][0][0] + t[1][0][1]) % Mo;
    update(o[i].id, o[i].a, o[i].b);
    ans = (ans + 1ll * o[i].x * power(o[i].v, Mo - 2) % Mo *
                     (tmp - (t[1][0][0] + t[1][0][1]) % Mo + Mo) % Mo) %
          Mo;
  }
  printf("%d\n", ans);
  return 0;
}