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 N = 1e5 + 5, MASK = 4, MOD = 998244353, CENT = 100;
int n, x[N], v[N], y[N][MASK], p[N], e[N][MASK];
struct Node {
  int mask[4] = {0, 0, 0, 0};
} st[4 * N];
vector<pair<double, pair<int, int>>> t;
int mul(int i, int j) { return (1LL * i * j) % MOD; }
int add(int i, int j) {
  int tmp = (1LL * i + j) % MOD;
  return (tmp + MOD) % MOD;
}
int inv(int k) {
  int res = 1;
  for (int s = MOD - 2; s; s >>= 1) {
    if (s & 1) res = mul(res, k);
    k = mul(k, k);
  }
  return res;
}
Node merge_node(Node& L, Node& R, int mid) {
  Node res;
  for (int mask_l = 0; mask_l < MASK; mask_l++) {
    for (int mask_r = 0; mask_r < MASK; mask_r++) {
      int ext = (mask_l & 1) | ((mask_r >> 1) << 1),
          jnt = (mask_l >> 1) | ((mask_r & 1) << 1);
      res.mask[ext] =
          add(res.mask[ext], e[mid][jnt] * mul(L.mask[mask_l], R.mask[mask_r]));
    }
  }
  return res;
}
void build(int i, int L, int R) {
  if (L == R) {
    st[i].mask[0] = mul(CENT - p[L], inv(CENT));
    st[i].mask[MASK - 1] = mul(p[L], inv(CENT));
  } else {
    build(i << 1, L, (L + R) / 2);
    build(i << 1 | 1, (L + R) / 2 + 1, R);
    st[i] = merge_node(st[i << 1], st[i << 1 | 1], (L + R) / 2);
  }
}
void update(int i, int L, int R, int k) {
  if (k < L || k > R || L == R) return;
  update(i << 1, L, (L + R) / 2, k);
  update(i << 1 | 1, (L + R) / 2 + 1, R, k);
  st[i] = merge_node(st[i << 1], st[i << 1 | 1], (L + R) / 2);
}
int query() {
  int res = 0;
  for (int i = 0; i < MASK; i++) res = add(res, st[1].mask[i]);
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> v[i] >> p[i];
  for (int i = 0; i < n - 1; i++) {
    for (int mask = 0; mask < MASK; mask++) {
      int det = 0;
      e[i][mask] = 1;
      for (int j = 0, s = 1; j < 2; j++, s *= -1) {
        if (mask & (1 << j)) {
          det += v[i + j] * s;
        } else {
          det -= v[i + j] * s;
        }
      }
      if (det <= 0) continue;
      double meet = (1.0 * (x[i + 1] - x[i])) / det;
      y[i][mask] = mul(x[i + 1] - x[i], inv(det));
      t.push_back({meet, {i, mask}});
    }
  }
  build(1, 0, n - 1);
  sort(t.begin(), t.end());
  int ans = 0;
  for (pair<double, pair<int, int>> z : t) {
    int i = z.second.first, mask = z.second.second, tmp = query(),
        prob = y[i][mask];
    e[i][mask] = 0;
    update(1, 0, n - 1, i);
    ans = add(ans, mul(prob, add(tmp, -query())));
  }
  cout << ans;
}