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>
#pragma GCC optimize(3)
using namespace std;
void read(int &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -f;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  x *= f;
}
void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (!x) return;
  print(x / 10), putchar(x % 10 + 48);
}
void write(int x) {
  if (!x)
    putchar('0');
  else
    print(x);
  putchar('\n');
}
const int maxn = 2e5 + 10;
const int inf = 2e9 + 20;
const double eps = 1e-8;
const int mod = 998244353;
struct asd09123jdf02i3h {
  int x, a, b, p, t;
  double res;
} a[maxn << 2];
int r[maxn], v[maxn], p[maxn], n, cnt;
int qpow(int a, int x) {
  int res = 1;
  for (; x; x >>= 1, a = 1ll * a * a % mod)
    if (x & 1) res = 1ll * res * a % mod;
  return res;
}
void update(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
struct segment_tree {
  int t[maxn << 2][2][2];
  void aaaupdate(int p) {
    for (int i = 0; i <= 1; i++)
      for (int j = 0; j <= 1; j++) {
        t[p][i][j] = 1ll * t[p << 1][i][0] * t[p << 1 | 1][0][j] % mod;
        update(t[p][i][j], 1ll * t[p << 1][i][1] * t[p << 1 | 1][1][j] % mod);
      }
  }
  void modify(int p, int l, int r, int x, int a, int b, int v) {
    if (l == r) return t[p][a][b] = v, void();
    if (x <= ((l + r) >> 1))
      modify(p << 1, l, ((l + r) >> 1), x, a, b, v);
    else
      modify(p << 1 | 1, ((l + r) >> 1) + 1, r, x, a, b, v);
    aaaupdate(p);
  }
} T;
vector<int> s[maxn];
void add(int x) { T.modify(1, 1, n - 1, a[x].x, a[x].a, a[x].b, a[x].p); }
void del(int x) { T.modify(1, 1, n - 1, a[x].x, a[x].a, a[x].b, 0); }
int get_ans() {
  int ans = 0;
  for (int i = 0; i <= 1; i++)
    ans = (ans + 1ll * T.t[1][i][1] * p[n] % mod) % mod;
  for (int i = 0; i <= 1; i++)
    ans = (ans + 1ll * T.t[1][i][0] * (1 - p[n] + mod) % mod) % mod;
  return ans;
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++)
    read(r[i]), read(v[i]), read(p[i]),
        p[i] = 1ll * p[i] * qpow(100, mod - 2) % mod;
  for (int i = 1; i < n; i++) {
    int x = 1ll * (r[i + 1] - r[i]) * qpow(v[i] + v[i + 1], mod - 2) % mod;
    double res = 1.0 * (r[i + 1] - r[i]) / (v[i] + v[i + 1]);
    a[++cnt] = (asd09123jdf02i3h){i, 1, 0, p[i], x, res};
    if (v[i] > v[i + 1])
      x = 1ll * (r[i + 1] - r[i]) * qpow(v[i] - v[i + 1], mod - 2) % mod,
      res = 1.0 * (r[i + 1] - r[i]) / (v[i] - v[i + 1]);
    else
      x = inf, res = inf;
    a[++cnt] = (asd09123jdf02i3h){i, 1, 1, p[i], x, res};
    if (v[i] < v[i + 1])
      x = 1ll * (r[i + 1] - r[i]) * qpow(v[i + 1] - v[i], mod - 2) % mod,
      res = 1.0 * (r[i + 1] - r[i]) / (v[i + 1] - v[i]);
    else
      x = inf, res = inf;
    a[++cnt] = (asd09123jdf02i3h){i, 0, 0, 1 - p[i] + mod, x, res};
    a[++cnt] = (asd09123jdf02i3h){i, 0, 1, 1 - p[i] + mod, inf, 1.0 * inf};
  }
  sort(a + 1, a + cnt + 1,
       [&](asd09123jdf02i3h x, asd09123jdf02i3h y) { return x.res > y.res; });
  int ans = 0;
  for (int i = 1; i <= cnt; i++) {
    int x = a[i].x;
    for (auto v : s[x]) del(v);
    add(i);
    if (a[i].t != inf) ans = (ans + 1ll * get_ans() * a[i].t % mod) % mod;
    for (auto v : s[x]) add(v);
    s[x].push_back(i);
  }
  write(ans);
  return 0;
}