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 mod = 998244353, Iv100 = 828542813;
int n, m, X[100005], V[100005], p[100005][2], ans;
int Pow(int a, int b) {
  int s = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod) b & 1 && (s = 1ll * s * a % mod);
  return s;
}
struct node {
  int s, v, p, a, b;
  bool operator<(const node &p) const { return 1ll * s * p.v < 1ll * p.s * v; }
} q[100005 << 2];
struct Mat {
  int s[2][2];
  Mat() { memset(s, 0, sizeof s); }
  void init(int *p) { s[0][0] = s[1][0] = p[0], s[0][1] = s[1][1] = p[1]; }
  Mat operator*(const Mat &B) const {
    Mat ret;
    ret.s[0][0] = (1ll * s[0][0] * B.s[0][0] + 1ll * s[0][1] * B.s[1][0]) % mod,
    ret.s[0][1] = (1ll * s[0][0] * B.s[0][1] + 1ll * s[0][1] * B.s[1][1]) % mod,
    ret.s[1][0] = (1ll * s[1][0] * B.s[0][0] + 1ll * s[1][1] * B.s[1][0]) % mod,
    ret.s[1][1] = (1ll * s[1][0] * B.s[0][1] + 1ll * s[1][1] * B.s[1][1]) % mod;
    return ret;
  }
} M[100005], t[100005 << 2];
void build(int i, int l, int r) {
  if (l == r) return void(t[i] = M[l]);
  int mid = (l + r) >> 1;
  build(i << 1, l, mid), build(i << 1 | 1, mid + 1, r);
  t[i] = t[i << 1] * t[i << 1 | 1];
}
void ins(int i, int l, int r, int x) {
  if (l == r) return void(t[i] = M[x]);
  int mid = (l + r) >> 1;
  x <= mid ? ins(i << 1, l, mid, x) : ins(i << 1 | 1, mid + 1, r, x);
  t[i] = t[i << 1] * t[i << 1 | 1];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d", &X[i], &V[i], &p[i][1]),
        p[i][1] = 1ll * p[i][1] * Iv100 % mod, p[i][0] = 1 + mod - p[i][1];
  for (int i = 1, v; i < n; i++)
    for (int a = 0; a < 2; a++)
      for (int b = 0; b < 2; b++) {
        v = !a && b    ? 0
            : !a && !b ? V[i + 1] - V[i]
            : a && b   ? V[i] - V[i + 1]
                       : V[i] + V[i + 1];
        if (v <= 0) continue;
        q[++m] = (node){X[i + 1] - X[i], v, i, a, b};
      }
  sort(q + 1, q + 1 + m);
  for (int i = 1; i <= n; i++) M[i].init(p[i]);
  build(1, 1, n);
  for (int i = 1; i <= m; i++) {
    int x = q[i].p + 1;
    Mat tmp = M[x];
    M[x] = Mat(), M[x].s[q[i].a][q[i].b] = p[x][q[i].b], ins(1, 1, n, x);
    ans = (ans + 1ll * q[i].s * Pow(q[i].v, mod - 2) % mod *
                     (t[1].s[0][0] + t[1].s[0][1])) %
          mod;
    M[x] = tmp, M[x].s[q[i].a][q[i].b] = 0, ins(1, 1, n, x);
  }
  printf("%d\n", ans);
}