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;
inline int read() {
  int x = 0, f = 1, c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return f == 1 ? x : -x;
}
const int mod = 998244353;
inline int fix(int x) { return x + ((x >> 31) & mod); }
inline int add(int x, int y) { return fix(x + y - mod); }
inline int dec(int x, int y) { return fix(x - y); }
inline int mul(int x, int y) { return (long long)x * y % mod; }
inline void ADD(int &x, int y) { x = fix(x + y - mod); }
inline void DEC(int &x, int y) { x = fix(x - y); }
inline void MUL(int &x, int y) { x = (long long)x * y % mod; }
inline int ksm(int x, int r) {
  int ret = 1;
  for (int i = 0; (1ll << i) <= r; i++) {
    if ((r >> i) & 1) MUL(ret, x);
    MUL(x, x);
  }
  return ret;
}
inline int inv(int x) { return ksm(x, mod - 2); }
const int N = 2e5 + 4;
int n, tot, ans, a[N], v[N], p[N], fa[N];
struct node {
  double tim;
  int val, v1, u2, v2;
} h[N << 1];
inline bool comp(const node &a, const node &b) { return a.tim < b.tim; }
struct matrix {
  int a[2][2];
  inline matrix operator*(const matrix &x) const {
    matrix ret;
    for (int i = 0; i ^ 2; i++)
      for (int j = 0; j ^ 2; j++) {
        ret.a[i][j] = 0;
        for (int k = 0; k ^ 2; k++) ADD(ret.a[i][j], mul(a[i][k], x.a[k][j]));
      }
    return ret;
  }
};
namespace seg {
matrix t[N << 2];
void build(int p, int l, int r) {
  if (l == r) {
    t[p].a[0][0] = t[p].a[1][0] = dec(1, ::p[r]);
    t[p].a[0][1] = t[p].a[1][1] = ::p[r];
    return;
  }
  build((p << 1), l, ((l + r) >> 1));
  build((p << 1 | 1), ((l + r) >> 1) + 1, r);
  t[p] = t[(p << 1)] * t[(p << 1 | 1)];
}
void modify(int p, int l, int r, int x, int v1, int v2) {
  if (l == r) {
    t[p].a[v1][v2] = 0;
    return;
  }
  if (x <= ((l + r) >> 1))
    modify((p << 1), l, ((l + r) >> 1), x, v1, v2);
  else
    modify((p << 1 | 1), ((l + r) >> 1) + 1, r, x, v1, v2);
  t[p] = t[(p << 1)] * t[(p << 1 | 1)];
}
}  // namespace seg
int main() {
  n = read();
  for (int i = 1, iv = inv(100); i <= n; i++) {
    a[i] = read();
    v[i] = read();
    p[i] = mul(read(), iv);
  }
  for (int i = 1; i < n; i++) {
    if (v[i] < v[i + 1]) {
      h[++tot] = (node){1.0 * (a[i + 1] - a[i]) / (v[i + 1] - v[i]),
                        mul((a[i + 1] - a[i]) % mod, inv(v[i + 1] - v[i])), 0,
                        i + 1, 0};
    }
    if (v[i] > v[i + 1]) {
      h[++tot] = (node){1.0 * (a[i + 1] - a[i]) / (v[i] - v[i + 1]),
                        mul((a[i + 1] - a[i]) % mod, inv(v[i] - v[i + 1])), 1,
                        i + 1, 1};
    }
    h[++tot] =
        (node){1.0 * (a[i + 1] - a[i]) / (v[i] + v[i + 1]),
               mul((a[i + 1] - a[i]) % mod, inv(v[i] + v[i + 1])), 1, i + 1, 0};
  }
  sort(h + 1, h + tot + 1, comp);
  seg::build(1, 1, n);
  for (int i = 1, u, v, qwq; i <= tot; i++) {
    qwq = add(seg::t[1].a[0][0], seg::t[1].a[0][1]);
    seg::modify(1, 1, n, h[i].u2, h[i].v1, h[i].v2);
    ADD(ans,
        mul(h[i].val, dec(qwq, add(seg::t[1].a[0][0], seg::t[1].a[0][1]))));
  }
  cout << ans << "\n";
  return (0 - 0);
}