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;
long long n, inv100, num;
bool tag[100005][2][2];
const long long mod = 998244353;
long long x[100005], vi[100005], p[100005][2], ans;
struct SL_tree {
  long long t[100005 << 2][2][2];
  void push_up(int l, int r, int rt) {
    t[rt][0][0] = t[rt][1][0] = t[rt][0][1] = t[rt][1][1] = 0;
    for (int i = 0; i <= 1; i++) {
      for (int j = 0; j <= 1; j++) {
        for (int x = 0; x <= 1; x++) {
          for (int y = 0; y <= 1; y++) {
            t[rt][i][y] += (t[rt << 1][i][j] * t[rt << 1 | 1][x][y] % mod) *
                           (!tag[((l + r) >> 1)][j][x]) % mod;
            t[rt][i][y] %= mod;
          }
        }
      }
    }
  }
  void change(int pos, int l = 1, int r = n, int rt = 1) {
    if (l == r) return;
    if (pos <= ((l + r) >> 1))
      change(pos, l, ((l + r) >> 1), rt << 1);
    else
      change(pos, ((l + r) >> 1) + 1, r, rt << 1 | 1);
    if (l <= pos && pos < r) push_up(l, r, rt);
  }
  void build(int l = 1, int r = n, int rt = 1) {
    if (l == r) {
      t[rt][1][1] = p[l][1], t[rt][0][0] = p[l][0];
      return;
    }
    build(l, ((l + r) >> 1), rt << 1);
    build(((l + r) >> 1) + 1, r, rt << 1 | 1);
    push_up(l, r, rt);
  }
} tree;
long long ksm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
struct node {
  int v, u, dv, du;
  double ti;
  long long val;
} e[300005];
inline bool cmp(node a, node b) { return a.ti < b.ti; }
int main() {
  inv100 = ksm(100, mod - 2);
  scanf("%lld", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld %lld %lld", &x[i], &vi[i], &p[i][1]),
        p[i][1] = p[i][1] * inv100 % mod, p[i][0] = (1 + mod - p[i][1]) % mod;
  }
  tree.build();
  for (int u = 1, v = 2; u < n; u++, v++) {
    if (vi[u] > vi[v]) {
      e[++num].u = u, e[num].v = v, e[num].du = 1, e[num].dv = 1;
      e[num].ti = 1.0 * (x[v] - x[u]) / (vi[u] - vi[v]);
      e[num].val = 1ll * (x[v] - x[u]) * ksm(vi[u] - vi[v], mod - 2) % mod;
    } else if (vi[u] < vi[v]) {
      e[++num].u = u, e[num].v = v, e[num].du = 0, e[num].dv = 0;
      e[num].ti = 1.0 * (x[v] - x[u]) / (vi[v] - vi[u]);
      e[num].val = 1ll * (x[v] - x[u]) * ksm(vi[v] - vi[u], mod - 2) % mod;
    }
    e[++num].u = u, e[num].v = v, e[num].du = 1, e[num].dv = 0;
    e[num].ti = 1.0 * (x[v] - x[u]) / (vi[v] + vi[u]);
    e[num].val = 1ll * (x[v] - x[u]) * ksm(vi[v] + vi[u], mod - 2) % mod;
  }
  sort(e + 1, e + 1 + num, cmp);
  int u, du, dv;
  long long lst = 1, pi;
  for (int i = 1; i <= num; i++) {
    u = e[i].u, du = e[i].du, dv = e[i].dv;
    tag[u][du][dv] = 1;
    tree.change(u);
    pi = (tree.t[1][1][1] + tree.t[1][1][0] + tree.t[1][0][1] +
          tree.t[1][0][0]) %
         mod;
    ans += ((lst - pi + mod) % mod) * e[i].val % mod;
    ans %= mod;
    lst = pi;
  }
  cout << ans;
}