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 = 1e5 + 10, mod = 998244353;
const long long inf = 1e18;
int a[maxn], v[maxn], p[maxn][2], ip[maxn][2], n;
vector<pair<pair<int, int>, pair<int, int> > > vec;
int val[4 * maxn][2][2];
int Pow(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) ans = 1ll * ans * a % mod;
  return ans;
}
void mrg(int id, int mid) {
  memset(val[id], 0, sizeof val[id]);
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++)
        val[id][i][k] = (1ll * val[id][i][k] + 1ll * val[2 * id][i][j] *
                                                   val[2 * id + 1][j][k] % mod *
                                                   ip[mid][j]) %
                        mod;
}
void build(int l = 0, int r = n - 1, int id = 1) {
  if (r - l == 1) {
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) val[id][i][j] = 1ll * p[l][i] * p[r][j] % mod;
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, 2 * id);
  build(mid, r, 2 * id + 1);
  for (int a = 0; a < 2; a++)
    for (int b = 0; b < 2; b++)
      for (int c = 0; c < 2; c++)
        for (int d = 0; d < 2; d++)
          val[id][a][d] = (1ll * val[id][a][d] +
                           1ll * val[2 * id][a][b] * val[2 * id + 1][c][d]) %
                          mod;
  mrg(id, mid);
}
void del(int pos, int a, int b, int l = 0, int r = n - 1, int id = 1) {
  if (r - l == 1) {
    val[id][a][b] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos < mid)
    del(pos, a, b, l, mid, 2 * id);
  else
    del(pos, a, b, mid, r, 2 * id + 1);
  mrg(id, mid);
}
int _ask() {
  int ans = 0;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) ans = (ans + val[1][i][j]) % mod;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie();
  int iv = Pow(100, mod - 2);
  cin >> n;
  if (n == 1) return cout << 0 << endl, 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> v[i] >> p[i][0];
    p[i][0] = 1ll * p[i][0] * iv % mod;
    p[i][1] = 1 - p[i][0];
    ip[i][0] = Pow(p[i][0], mod - 2);
    ip[i][1] = Pow(p[i][1], mod - 2);
  }
  for (int i = 0; i < n - 1; i++) {
    vec.push_back({{a[i + 1] - a[i], v[i + 1] + v[i]}, {i, 0}});
    if (v[i] != v[i + 1])
      vec.push_back({{a[i + 1] - a[i], abs(v[i + 1] - v[i])}, {i, 1}});
  }
  sort(vec.begin(), vec.end(),
       [](pair<pair<int, int>, pair<int, int> > a,
          pair<pair<int, int>, pair<int, int> > b) {
         return 1ll * a.first.first * b.first.second <
                1ll * b.first.first * a.first.second;
       });
  build();
  int ans = 0;
  for (auto it : vec) {
    ans = (1ll * ans + 1ll * _ask() * it.first.first % mod *
                           Pow(it.first.second, mod - 2)) %
          mod;
    if (it.second.second == 0) {
      del(it.second.first, 0, 1);
    } else {
      if (v[it.second.first] < v[it.second.first + 1])
        del(it.second.first, 1, 1);
      else
        del(it.second.first, 0, 0);
    }
    ans = (1ll * ans - 1ll * _ask() * it.first.first % mod *
                           Pow(it.first.second, mod - 2)) %
          mod;
  }
  if (ans < 0) ans += mod;
  return cout << ans << endl, 0;
}