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 long long mod = 998244353;
void upd(int& a, const int& b) {
  a += b;
  a %= mod;
}
long long add(const long long& a, const long long& b) {
  return (a + mod + b) % mod;
}
long long mul(const long long& a, const long long& b) { return (a * b) % mod; }
long long pwr(const long long& a, const long long& b) {
  if (!b) return 1;
  long long h = pwr(a, b >> 1);
  return mul(mul(h, h), (b & 1) ? a : 1);
}
const int maxn = 1 << 17;
struct zrazka {
  long long x, v, p;
  int i, m0, m1;
};
bool cmp(const zrazka& a, const zrazka& b) { return a.x * b.v > a.v * b.x; }
vector<array<array<int, 2>, 2>> t(maxn * 2);
array<array<int, 2>, 2> merge(array<array<int, 2>, 2>& a,
                              array<array<int, 2>, 2>& b) {
  array<array<int, 2>, 2> res;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      res[i][j] = add(mul(a[i][0], b[0][j]), mul(a[i][1], b[1][j]));
  return res;
}
int query() {
  return add(add(t[0][0][0], t[0][0][1]), add(t[0][1][0], t[0][1][1]));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> x(n), v(n), p(n);
  for (int i = 0; i < n; i++) cin >> x[i] >> v[i] >> p[i];
  t[maxn - 1][0][0] = p[0], t[maxn - 1][1][1] = 100 - p[0];
  vector<zrazka> z;
  for (int i = 1; i < n; i++) {
    for (int m0 = 0; m0 < 2; m0++)
      for (int m1 = 0; m1 < 2; m1++) {
        int vi = (m0 ? -v[i - 1] : v[i - 1]) + (m1 ? v[i] : -v[i]),
            pi = m1 ? 100 - p[i] : p[i];
        if (vi <= 0)
          upd(t[maxn - 1 + i][m0][m1], pi);
        else
          z.push_back({x[i] - x[i - 1], vi, pi, i, m0, m1});
      }
  }
  for (int i = maxn - 1 + n; i < maxn * 2; i++)
    for (int j = 0; j < 2; j++) t[i][j][j] = 1, t[i][j][j ^ 1] = 0;
  for (int i = maxn - 2; i >= 0; i--) t[i] = merge(t[i * 2 + 1], t[i * 2 + 2]);
  sort(z.begin(), z.end(), cmp);
  int ans = 0, lastp = query();
  for (const zrazka& i : z) {
    int vr = maxn - 1 + i.i;
    upd(t[vr][i.m0][i.m1], i.p);
    while (vr) {
      vr = (vr - 1) / 2;
      t[vr] = merge(t[vr * 2 + 1], t[vr * 2 + 2]);
    }
    long long now = query(), t = mul(i.x, pwr(i.v, mod - 2));
    upd(ans, mul(t, add(now, -lastp)));
    lastp = now;
  }
  cout << mul(ans, pwr(pwr(100, mod - 2), n)) << "\n";
  return 0;
}