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;
const int maxn = 2e5 + 5, maxv = 2e6 + 5, mod = 998244353;
inline int gi() {
  char c = getchar();
  bool f = 1;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') c = getchar(), f = 0;
  int sum = 0;
  while ('0' <= c && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return f ? sum : -sum;
}
int n, m, x[maxn], v[maxn], p[maxn], q[maxn];
int inv[maxv];
struct matrix {
  int a[2][2];
  matrix() { memset(a, 0, sizeof(a)); }
} t[maxn << 2], b[maxn];
matrix operator*(const matrix &a, const matrix &b) {
  matrix ans;
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 2; ++j)
      for (int k = 0; k < 2; ++k)
        ans.a[i][j] = (ans.a[i][j] + (long long)a.a[i][k] * b.a[k][j]) % mod;
  return ans;
}
struct node {
  int s, v, Id;
  int *p;
} a[maxn * 3];
void build(int s, int l, int r) {
  if (l == r) return t[s] = b[l], void();
  build((s << 1), l, ((l + r) >> 1));
  build((s << 1 | 1), ((l + r) >> 1) + 1, r);
  t[s] = t[(s << 1)] * t[(s << 1 | 1)];
}
void modify(int s, int l, int r, int p) {
  if (l == r) return t[s] = b[l], void();
  if (p <= ((l + r) >> 1))
    modify((s << 1), l, ((l + r) >> 1), p);
  else
    modify((s << 1 | 1), ((l + r) >> 1) + 1, r, p);
  t[s] = t[(s << 1)] * t[(s << 1 | 1)];
}
int calc() {
  return ((long long)(mod + 1 - p[1]) * (t[1].a[0][0] + t[1].a[0][1]) +
          (long long)p[1] * (t[1].a[1][0] + t[1].a[1][1])) %
         mod;
}
int main() {
  inv[1] = 1;
  for (int i = 2; i <= 2000000; ++i)
    inv[i] = (long long)(mod - mod / i) * inv[mod % i] % mod;
  n = gi();
  if (n == 1) return puts("0"), 0;
  for (int i = 1; i <= n; ++i)
    x[i] = gi(), v[i] = gi(), p[i] = (long long)gi() * inv[100] % mod;
  for (int i = 1; i < n; ++i) {
    for (int j = 0; j < 2; ++j)
      for (int k = 0; k < 2; ++k)
        b[i].a[j][k] = k ? p[i + 1] : mod + 1 - p[i + 1];
    a[++m] = (node){x[i + 1] - x[i], v[i] + v[i + 1], i, &b[i].a[1][0]};
    if (v[i] > v[i + 1])
      a[++m] = (node){x[i + 1] - x[i], v[i] - v[i + 1], i, &b[i].a[1][1]};
    if (v[i] < v[i + 1])
      a[++m] = (node){x[i + 1] - x[i], v[i + 1] - v[i], i, &b[i].a[0][0]};
  }
  build(1, 1, n - 1);
  for (int i = 1; i <= m; ++i) q[i] = i;
  sort(q + 1, q + m + 1, [](int x, int y) {
    return (long long)a[x].s * a[y].v < (long long)a[y].s * a[x].v;
  });
  int ans = 0;
  for (int i = 1; i <= m; ++i) {
    int x = calc();
    *a[q[i]].p = 0;
    modify(1, 1, n - 1, a[q[i]].Id);
    ans = (ans +
           (long long)a[q[i]].s * inv[a[q[i]].v] % mod * (x - calc() + mod)) %
          mod;
  }
  printf("%d\n", ans);
  return 0;
}