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>
#pragma GCC optimize("Ofast")
using namespace std;
char _buf[100000], *_p1 = _buf, *_p2 = _buf;
inline int gi() {
  int x = 0, f = 1;
  char ch = (_p1 == _p2 && (_p2 = (_p1 = _buf) + fread(_buf, 1, 100000, stdin),
                            _p1 == _p2)
                 ? EOF
                 : *_p1++);
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = (_p1 == _p2 && (_p2 = (_p1 = _buf) + fread(_buf, 1, 100000, stdin),
                         _p1 == _p2)
              ? EOF
              : *_p1++);
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = (_p1 == _p2 && (_p2 = (_p1 = _buf) + fread(_buf, 1, 100000, stdin),
                         _p1 == _p2)
              ? EOF
              : *_p1++);
  }
  return (f == 1) ? x : -x;
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
const int mod = 998244353, maxn = 1e5 + 5;
int x[maxn], v[maxn], p[maxn], n;
struct Matrix {
  int a[2][2];
  Matrix(int b = 0, int c = 0, int d = 0, int e = 0) {
    a[0][0] = b, a[0][1] = c, a[1][0] = d, a[1][1] = e;
  }
  inline void clear() { memset(a, 0, sizeof(a)); }
  inline Matrix operator*(const Matrix &b) {
    Matrix c;
    c.clear();
    for (int k = 0; k <= 1; ++k)
      for (int i = 0; i <= 1; ++i)
        for (int j = 0; j <= 1; ++j)
          c.a[i][j] = (c.a[i][j] + 1ll * a[i][k] * b.a[k][j] % mod) % mod;
    return c;
  }
} a[maxn];
struct segmentree {
  static const int maxn = 4e5 + 5;
  Matrix sum[maxn];
  inline void pushup(int u) { sum[u] = sum[u << 1] * sum[u << 1 | 1]; }
  inline void update(int u, int l, int r, int x) {
    if (l == r) return sum[u] = a[l], void();
    int mid = (l + r) >> 1;
    if (x <= mid)
      update(u << 1, l, mid, x);
    else
      update(u << 1 | 1, mid + 1, r, x);
    pushup(u);
  }
  inline void build(int u, int l, int r) {
    if (l == r) return sum[u] = a[l], void();
    int mid = (l + r) >> 1;
    build(u << 1, l, mid), build(u << 1 | 1, mid + 1, r);
    pushup(u);
  }
} tree;
struct state {
  int x, i, j;
  long long val;
  double nval;
  inline bool operator<(const state &b) const { return nval < b.nval; }
} q[maxn * 2];
int tot;
inline int qpow(int x, int k) {
  int ret = 1;
  while (k) {
    if (k & 1) ret = 1ll * x * ret % mod;
    k >>= 1, x = 1ll * x * x % mod;
  }
  return ret;
}
inline void init() {}
inline void input() {
  n = gi();
  int inv = qpow(100, mod - 2);
  for (int i = 1; i <= n; ++i)
    x[i] = gi(), v[i] = gi(), p[i] = gi(), p[i] = 1ll * p[i] * inv % mod;
}
inline void solve() {
  a[1] = Matrix(mod + 1 - p[1], p[1], 0, 0);
  for (int i = 2; i <= n; ++i) {
    a[i] = Matrix(mod + 1 - p[i], p[i], mod + 1 - p[i], p[i]);
    q[++tot] = {i, 1, 0,
                1ll * (x[i] - x[i - 1]) * qpow(v[i] + v[i - 1], mod - 2) % mod,
                (double)(x[i] - x[i - 1]) / (v[i] + v[i - 1])};
    if (v[i] > v[i - 1])
      q[++tot] = {
          i, 0, 0,
          1ll * (x[i] - x[i - 1]) * qpow(v[i] - v[i - 1], mod - 2) % mod,
          (double)(x[i] - x[i - 1]) / (v[i] - v[i - 1])};
    if (v[i] < v[i - 1])
      q[++tot] = {
          i, 1, 1,
          1ll * (x[i] - x[i - 1]) * qpow(v[i - 1] - v[i], mod - 2) % mod,
          (double)(x[i] - x[i - 1]) / (v[i - 1] - v[i])};
  }
  tree.build(1, 1, n);
  sort(q + 1, q + tot + 1);
  int ans = 0;
  for (int j = 1; j <= tot; ++j) {
    int i = q[j].x;
    Matrix temp = a[i];
    a[i].clear();
    int val1 = q[j].i, val2 = q[j].j;
    a[i].a[val1][val2] = val2 ? p[i] : mod + 1 - p[i];
    tree.update(1, 1, n, i);
    ans = (ans +
           1ll * q[j].val * (tree.sum[1].a[0][0] + tree.sum[1].a[0][1]) % mod) %
          mod;
    a[i] = temp;
    a[i].a[val1][val2] = 0;
    tree.update(1, 1, n, i);
  }
  printf("%d\n", ans);
}
int main() {
  int T = 1;
  while (T--) {
    init();
    input();
    solve();
  }
  return 0;
}