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 + 23;
const int mod = 998244353;
struct Matrix {
  int a[2][2];
  Matrix operator*(const Matrix &rhs) const {
    Matrix res;
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        res.a[i][j] =
            (1ll * a[i][0] * rhs.a[0][j] + 1ll * a[i][1] * rhs.a[1][j]) % mod;
    return res;
  }
};
int qpow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * a * ans % mod;
    b >>= 1;
    a = 1ll * a * a % mod;
  }
  return ans;
}
struct Event {
  int x, y, id, a, b;
};
bool operator<(const Event &a, const Event &b) {
  return 1ll * a.x * b.y < 1ll * b.x * a.y;
}
int n;
int x[maxn], v[maxn], p[maxn];
vector<Event> e;
Matrix st[maxn << 2];
void pushup(int o) { st[o] = st[o << 1] * st[o << 1 | 1]; }
void build(int o, int l, int r) {
  if (l == r) {
    st[o].a[0][0] = st[o].a[0][1] = (1 - p[l] + mod) % mod;
    st[o].a[1][0] = st[o].a[1][1] = p[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  pushup(o);
}
void modify(int o, int l, int r, int x, int a, int b) {
  if (l == r) {
    st[o].a[a][b] = 0;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    modify(o << 1, l, mid, x, a, b);
  else
    modify(o << 1 | 1, mid + 1, r, x, a, b);
  pushup(o);
}
int main() {
  int inv = qpow(100, mod - 2);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", x + i, v + i, p + i);
    p[i] = 1ll * p[i] * inv % mod;
  }
  for (int i = 2; i <= n; i++) {
    e.push_back(Event{x[i] - x[i - 1], v[i] + v[i - 1], i - 1, 1, 0});
    if (v[i] > v[i - 1])
      e.push_back(Event{x[i] - x[i - 1], v[i] - v[i - 1], i - 1, 0, 0});
    if (v[i - 1] > v[i])
      e.push_back(Event{x[i] - x[i - 1], v[i - 1] - v[i], i - 1, 1, 1});
  }
  sort(e.begin(), e.end());
  long long ans = 0;
  build(1, 1, n);
  int last = 0;
  for (Event i : e) {
    int p = (st[1].a[0][0] + st[1].a[1][0]) % mod;
    ans = (ans + 1ll * p * (1ll * i.x * qpow(i.y, mod - 2) % mod - last + mod) %
                     mod) %
          mod;
    modify(1, 1, n, i.id, i.a, i.b);
    last = 1ll * i.x * qpow(i.y, mod - 2) % mod;
  }
  ans = (ans - 1ll * (st[1].a[0][0] + st[1].a[1][0]) * last % mod + mod) % mod;
  cout << ans;
}