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 int N = 1e5 + 5;
const int mod = 998244353;
using namespace std;
int n, x[N], v[N], p[N], cnt, inv, ans;
struct node {
  int x, v, id, l, r;
} a[N << 2];
struct Matrix {
  int m[2][2];
  Matrix() { m[0][0] = m[1][0] = m[0][1] = m[1][1] = 0; }
} mat[N << 2], tra[N], org;
template <typename T>
inline T read() {
  T x = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * w;
}
Matrix operator*(const Matrix a, const Matrix b) {
  Matrix c;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++)
        c.m[i][j] = (1ll * a.m[i][k] * b.m[k][j] + c.m[i][j]) % mod;
  return c;
}
void pushup(int p) { mat[p] = mat[p << 1] * mat[p << 1 | 1]; }
void build(int p, int l, int r) {
  if (l == r) return (void)(mat[p] = tra[l]);
  int mid = (l + r) >> 1;
  build(p << 1, l, mid), build(p << 1 | 1, mid + 1, r);
  pushup(p);
}
void modify(int p, int l, int r, int k, Matrix x) {
  if (l == r) return (void)(mat[p] = x);
  int mid = (l + r) >> 1;
  if (k <= mid)
    modify(p << 1, l, mid, k, x);
  else
    modify(p << 1 | 1, mid + 1, r, k, x);
  pushup(p);
}
int fpow(int x, int y) {
  int res = 1;
  for (; y; y >>= 1, x = 1ll * x * x % mod)
    if (y & 1) res = 1ll * res * x % mod;
  return res;
}
int get_speed(int i, int l, int r) {
  if (l == 0 && r == 1) return -1;
  if (l == 1 && r == 1) return v[i] - v[i + 1];
  if (l == 0 && r == 0) return v[i + 1] - v[i];
  return v[i + 1] + v[i];
}
void mul(int &x, int &y, Matrix z) {
  int x1 = 0, x2 = 0;
  x1 = (1ll * x * z.m[0][0] + 1ll * y * z.m[1][0]) % mod;
  x2 = (1ll * x * z.m[0][1] + 1ll * y * z.m[1][1]) % mod;
  x = x1, y = x2;
}
bool cmp(node a, node b) { return 1ll * a.x * b.v < 1ll * b.x * a.v; }
int main() {
  n = read<int>(), inv = fpow(100, mod - 2), org.m[0][0] = org.m[1][1] = 1;
  for (int i = 1; i <= n; i++)
    x[i] = read<int>(), v[i] = read<int>(), p[i] = read<int>();
  if (n == 1) {
    puts("0");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    p[i] = 1ll * p[i] * inv % mod, p[i] = (1 - p[i] + mod) % mod;
  for (int tmp, i = 1; i < n; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) {
        if ((tmp = get_speed(i, j, k)) <= 0) continue;
        a[++cnt].x = x[i + 1] - x[i], a[cnt].v = tmp;
        a[cnt].id = i + 1, a[cnt].l = j, a[cnt].r = k;
      }
  for (int i = 2; i <= n; i++) {
    tra[i].m[0][0] = tra[i].m[1][0] = p[i];
    tra[i].m[0][1] = tra[i].m[1][1] = (1 - p[i] + mod) % mod;
  }
  build(1, 2, n), sort(a + 1, a + cnt + 1, cmp);
  for (int t, x, y, id, i = 1; i <= cnt; i++) {
    t = 1ll * a[i].x * fpow(a[i].v, mod - 2) % mod, x = p[1],
    y = (1 - p[1] + mod) % mod, id = a[i].id;
    Matrix tmp;
    tmp.m[a[i].l][a[i].r] = a[i].r ? (1 - p[id] + mod) % mod : p[id],
    modify(1, 2, n, id, tmp);
    tmp = mat[1], mul(x, y, tmp);
    ans = (1ll * (x + y) * t + ans) % mod;
    tra[id].m[a[i].l][a[i].r] = 0, modify(1, 2, n, id, tra[id]);
  }
  printf("%d\n", ans);
  return 0;
}