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 N = 1e5 + 10;
const int mod = 998244353;
const int inv100 = 828542813;
int qpow(int a, int b) {
  int ans = 1;
  for (; b >= 1; b >>= 1, a = (long long)a * a % mod)
    if (b & 1) ans = (long long)ans * a % mod;
  return ans;
}
struct mat {
  int a[2][2];
  mat operator*(const mat &b) {
    mat ans;
    ans.a[0][0] =
        ((long long)a[0][0] * b.a[0][0] + (long long)a[0][1] * b.a[1][0]) % mod;
    ans.a[0][1] =
        ((long long)a[0][0] * b.a[0][1] + (long long)a[0][1] * b.a[1][1]) % mod;
    ans.a[1][0] =
        ((long long)a[1][0] * b.a[0][0] + (long long)a[1][1] * b.a[1][0]) % mod;
    ans.a[1][1] =
        ((long long)a[1][0] * b.a[0][1] + (long long)a[1][1] * b.a[1][1]) % mod;
    return ans;
  }
};
int n, x[N], v[N], p[N], q[N];
int calc(int u, int s, int t) {
  if (!s && !t) return v[u] >= v[u + 1] ? -1 : v[u + 1] - v[u];
  if (!s && t) return -1;
  if (s && !t) return v[u] + v[u + 1];
  return v[u] <= v[u + 1] ? -1 : v[u] - v[u + 1];
}
mat w[N * 4], s[N];
void build(int u, int l, int r) {
  if (l == r) {
    for (int i = 0; i <= 1; ++i)
      for (int j = 0; j <= 1; ++j) w[u].a[i][j] = j ? p[l] : q[l];
    s[l] = w[u];
    return;
  }
  int mid = (l + r) >> 1;
  build(u << 1, l, mid);
  build(u << 1 | 1, mid + 1, r);
  w[u] = w[u << 1] * w[u << 1 | 1];
}
namespace Q {
int u;
mat w;
}  // namespace Q
void modify(int u, int l, int r) {
  if (l == r) {
    w[u] = Q::w;
    return;
  }
  int mid = (l + r) >> 1;
  Q::u <= mid ? modify(u << 1, l, mid) : modify(u << 1 | 1, mid + 1, r);
  w[u] = w[u << 1] * w[u << 1 | 1];
}
struct node {
  int u, x, v, s, t;
  bool operator<(const node &b) const {
    return (long long)x * b.v < (long long)b.x * v;
  }
};
vector<node> crash;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d%d", x + i, v + i, p + i);
    p[i] = (long long)p[i] * inv100 % mod;
    q[i] = mod + 1 - p[i];
  }
  build(1, 1, n);
  for (int i = 1; i <= n - 1; ++i) {
    for (int s = 0; s <= 1; ++s)
      for (int t = 0; t <= 1; ++t) {
        int v0 = calc(i, s, t);
        if (!~v0) continue;
        crash.push_back({i, x[i + 1] - x[i], v0, s, t});
      }
  }
  sort(crash.begin(), crash.end());
  int res = 0;
  for (node &cur : crash) {
    int u = cur.u + 1;
    Q::u = u;
    mat tmp = s[u];
    for (int s = 0; s <= 1; ++s)
      for (int t = 0; t <= 1; ++t)
        Q::w.a[s][t] = s == cur.s && t == cur.t ? (t ? p[u] : q[u]) : 0;
    modify(1, 1, n);
    res = (res + (w[1].a[0][0] + w[1].a[0][1]) * (long long)cur.x % mod *
                     qpow(cur.v, mod - 2)) %
          mod;
    Q::w = tmp;
    Q::w.a[cur.s][cur.t] = 0;
    s[u] = Q::w;
    modify(1, 1, n);
  }
  printf("%d\n", res);
  return 0;
}