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>
const long long N = 1e5 + 5;
const long long mod = 998244353;
using namespace std;
long long po(long long n, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = 1LL * ans * n % mod;
    n = 1LL * n * n % mod;
    k >>= 1;
  }
  return ans;
}
void add(long long& a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
}
struct collision {
  long long s, v, id, dir;
  collision(long long s, long long v, long long id, long long dir)
      : s(s), v(v), id(id), dir(dir) {}
  bool operator<(const collision& a) const {
    if (1LL * s * a.v < 1LL * a.s * v) return true;
    return false;
  }
};
vector<collision> mv;
long long n, x[N], v[N], p[N], it[N << 4][2][2], ans;
bool ck[N][4];
void Merge(long long i, long long l, long long r) {
  long long mid = (l + r) >> 1;
  for (long long a = 0; a < 2; a++)
    for (long long d = 0; d < 2; d++) {
      it[i][a][d] = 0;
      for (long long b = 0; b < 2; b++)
        for (long long c = 0; c < 2; c++) {
          long long dir = b << 1 | c;
          if (ck[mid][dir]) continue;
          it[i][a][d] =
              (it[i][a][d] + 1LL * it[i << 1][a][b] * it[i << 1 | 1][c][d]) %
              mod;
        }
    }
}
void init(long long i, long long l, long long r) {
  if (l == r) {
    it[i][1][1] = p[l];
    it[i][0][0] = 1;
    add(it[i][0][0], -p[l]);
    return;
  }
  long long mid = (l + r) >> 1;
  init(i << 1, l, mid);
  init(i << 1 | 1, mid + 1, r);
  Merge(i, l, r);
}
void update(long long i, long long l, long long r, long long id) {
  long long mid = (l + r) >> 1;
  if (mid > id) update(i << 1, l, mid, id);
  if (mid < id) update(i << 1 | 1, mid + 1, r, id);
  Merge(i, l, r);
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long rev = po(100, mod - 2);
  for (long long i = 1; i <= n; i++)
    cin >> x[i] >> v[i] >> p[i], p[i] = 1LL * p[i] * rev % mod;
  for (long long i = 1; i < n; i++) {
    mv.push_back(collision(x[i + 1] - x[i], v[i + 1] + v[i], i, 2));
    if (v[i] > v[i + 1])
      mv.push_back(collision(x[i + 1] - x[i], v[i] - v[i + 1], i, 3));
    if (v[i] < v[i + 1])
      mv.push_back(collision(x[i + 1] - x[i], v[i + 1] - v[i], i, 0));
  }
  sort(mv.begin(), mv.end());
  init(1, 1, n);
  for (auto x : mv) {
    long long time = 1LL * x.s * po(x.v, mod - 2) % mod, sum = 0;
    for (long long i = 0; i < 2; i++)
      for (long long j = 0; j < 2; j++) add(sum, it[1][i][j]);
    ck[x.id][x.dir] = 1;
    update(1, 1, n, x.id);
    for (long long i = 0; i < 2; i++)
      for (long long j = 0; j < 2; j++) add(sum, -it[1][i][j]);
    add(ans, 1LL * time * sum % mod);
  }
  cout << ans;
}