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;
const int mod = 998244353;
void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
void sub(int &a, int b) {
  a -= b;
  if (a < 0) a += mod;
}
int mul(int a, int b) { return 1ll * a * b % mod; }
int inv(int a, int p) { return a == 1 ? 1 : p - 1ll * p * inv(p % a, a) / a; }
int Pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = mul(ans, a);
    a = mul(a, a);
    b >>= 1;
  }
  return ans;
}
struct Event {
  int a, b;
  int idx;
  Event(int _a = 0, int _b = 0, int _i = 0) : a(_a), b(_b), idx(_i) {}
};
int x[N];
int v[N];
int p[N];
vector<vector<int> > operator*(const vector<vector<int> > &a,
                               const vector<vector<int> > &b) {
  vector<vector<int> > c(2, vector<int>(2, 0));
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      add(c[i][j], mul(a[i][0], b[0][j])), add(c[i][j], mul(a[i][1], b[1][j]));
  return c;
}
vector<Event> vec;
vector<vector<int> > tr[N << 2];
void build(int i, int l, int r) {
  if (l == r) {
    tr[i].assign(2, vector<int>(2, 0));
    for (int a = 0; a < 2; ++a)
      for (int b = 0; b < 2; ++b) {
        int spd = 0;
        int prb = 1;
        if (a)
          spd += v[l - 1];
        else
          spd -= v[l - 1];
        if (b)
          spd -= v[l], prb = mul(prb, p[l]);
        else
          spd += v[l], prb = mul(prb, mod + 1 - p[l]);
        tr[i][a][b] = prb;
        if (spd > 0) vec.emplace_back(x[l] - x[l - 1], spd, l * 4 + a * 2 + b);
      }
    return;
  }
  int m = (l + r) / 2;
  build(i << 1, l, m);
  ++m;
  build(i << 1 | 1, m, r);
  tr[i] = tr[i << 1] * tr[i << 1 | 1];
}
void update(int i, int l, int r, int p, int a, int b) {
  if (l > p || r < p) return;
  if (l == r) {
    tr[i][a][b] = 0;
    return;
  }
  int m = (l + r) / 2;
  update(i << 1, l, m, p, a, b);
  ++m;
  update(i << 1 | 1, m, r, p, a, b);
  tr[i] = tr[i << 1] * tr[i << 1 | 1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    cin >> x[i];
    cin >> v[i];
    cin >> p[i];
    p[i] = mul(p[i], inv(100, mod));
  }
  build(1, 2, n);
  sort(vec.begin(), vec.end(), [&](const Event &F1, const Event &F2) {
    return 1ll * F1.a * F2.b < 1ll * F2.a * F1.b;
  });
  int Sum = 0;
  int ans = 0;
  add(Sum, mul(tr[1][0][0] + tr[1][0][1], mod + 1 - p[1]));
  add(Sum, mul(tr[1][1][0] + tr[1][1][1], p[1]));
  for (Event E : vec) {
    int index = E.idx;
    int b = index % 2;
    index /= 2;
    int a = index % 2;
    index /= 2;
    update(1, 2, n, index, a, b);
    int nxt_Sum = 0;
    add(nxt_Sum, mul(tr[1][0][0] + tr[1][0][1], mod + 1 - p[1]));
    add(nxt_Sum, mul(tr[1][1][0] + tr[1][1][1], p[1]));
    sub(Sum, nxt_Sum);
    add(ans, mul(mul(Sum, E.a), inv(E.b, mod)));
    Sum = nxt_Sum;
  }
  cout << ans << endl;
}