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 long long read() {
  long long f = 1, x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int sta[20];
template <typename T>
inline void write(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (!x) {
    putchar('0');
    return;
  }
  int top = 0;
  while (x) sta[++top] = x % 10, x /= 10;
  while (top) putchar(sta[top--] + '0');
}
template <typename T>
inline void pr1(T x) {
  write(x);
  putchar(' ');
}
template <typename T>
inline void pr2(T x) {
  write(x);
  putchar('\n');
}
const int MAXN = 100005;
const int mod = 998244353;
int pow_mod(int a, int b) {
  int ret = 1;
  for (; b; b >>= 1, a = 1LL * a * a % mod)
    if (b & 1) ret = 1LL * ret * a % mod;
  return ret;
}
void ad(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
void dl(int &x, int y) {
  x -= y;
  if (x < 0) x += mod;
}
struct matrix {
  int m[2][2];
  matrix() { memset(m, 0, sizeof(m)); }
  friend matrix operator*(matrix u, matrix v) {
    matrix ret;
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++)
        for (int k = 0; k < 2; k++)
          ad(ret.m[i][k], 1LL * u.m[i][j] * v.m[j][k] % mod);
    return ret;
  }
};
int p[MAXN], X[MAXN], V[MAXN], n;
struct segtree {
  matrix mat[MAXN * 4];
  void buildtree(int now, int l, int r) {
    if (l == r) {
      if (l != 1) {
        mat[now].m[0][0] = mat[now].m[1][0] = (1 - p[l] + mod) % mod;
        mat[now].m[0][1] = mat[now].m[1][1] = p[l];
        return;
      } else {
        mat[now].m[0][0] = (1 - p[l] + mod) % mod;
        mat[now].m[0][1] = p[l];
        return;
      }
    }
    int mid = (l + r) / 2;
    buildtree(now << 1, l, mid);
    buildtree(now << 1 | 1, mid + 1, r);
    mat[now] = mat[now << 1] * mat[now << 1 | 1];
  }
  void modify(int now, int l, int r, int p, int o1, int o2) {
    if (l == r) {
      mat[now].m[o1][o2] = 0;
      return;
    }
    int mid = (l + r) / 2;
    if (p <= mid)
      modify(now << 1, l, mid, p, o1, o2);
    else
      modify(now << 1 | 1, mid + 1, r, p, o1, o2);
    mat[now] = mat[now << 1] * mat[now << 1 | 1];
  }
} seg;
struct node {
  int l, o1, o2, T, D, V;
  node() {}
  node(int _l, int _o1, int _o2, int _T, int _D, int _V) {
    l = _l;
    o1 = _o1;
    o2 = _o2;
    T = _T;
    D = _D;
    V = _V;
  }
} w[3 * MAXN];
int len;
bool cmp(node n1, node n2) { return 1LL * n1.D * n2.V < 1LL * n1.V * n2.D; }
int main() {
  n = read();
  if (n == 1) return pr2(0), 0;
  int inver = pow_mod(100, mod - 2);
  for (int i = 1; i <= n; i++)
    X[i] = read(), V[i] = read(), p[i] = 1LL * read() * inver % mod;
  seg.buildtree(1, 1, n);
  for (int i = 2; i <= n; i++) {
    int dis = X[i] - X[i - 1], v1 = V[i - 1], v2 = V[i];
    w[++len] = node(i, 1, 0, 1LL * dis * pow_mod(v1 + v2, mod - 2) % mod, dis,
                    v1 + v2);
    if (v1 < v2)
      w[++len] = node(i, 0, 0, 1LL * dis * pow_mod(v2 - v1, mod - 2) % mod, dis,
                      v2 - v1);
    else if (v1 > v2)
      w[++len] = node(i, 1, 1, 1LL * dis * pow_mod(v1 - v2, mod - 2) % mod, dis,
                      v1 - v2);
  }
  sort(w + 1, w + 1 + len, cmp);
  int ans = 0;
  for (int i = 1; i <= len; i++) {
    int PI = (seg.mat[1].m[0][0] + seg.mat[1].m[0][1]) % mod;
    ad(ans, 1LL * (w[i].T - w[i - 1].T + mod) * PI % mod);
    seg.modify(1, 1, n, w[i].l, w[i].o1, w[i].o2);
  }
  int PI = (seg.mat[1].m[0][0] + seg.mat[1].m[0][1]) % mod;
  dl(ans, 1LL * PI * w[len].T % mod);
  pr2(ans);
  return 0;
}