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 MOD = 998244353, inv2 = (MOD + 1) / 2;
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, -1, 1};
int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
long long readll() {
  long long v = 0, f = 1;
  char c = getchar();
  while (c < 48 || 57 < c) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (48 <= c && c <= 57) v = (v << 3) + v + v + c - 48, c = getchar();
  return v * f;
}
long long x[100000 + 10], v[100000 + 10], p[100000 + 10][2],
    ans[100000 + 10 << 2];
struct Ma {
  int n, m;
  long long a[2][2];
  Ma() {
    n = m = 2;
    memset(a, 0, sizeof(a));
  }
  void init() {
    n = m = 2;
    memset(a, 0, sizeof(a));
  }
  Ma operator+(Ma b) const {
    Ma c;
    c.n = n;
    c.m = m;
    for (int i = (int)0; i <= (int)n - 1; i++)
      for (int j = (int)0; j <= (int)m - 1; j++)
        c.a[i][j] = a[i][j] + b.a[i][j];
    return c;
  }
  Ma operator-(Ma b) const {
    Ma c;
    c.n = n;
    c.m = m;
    for (int i = (int)0; i <= (int)n - 1; i++)
      for (int j = (int)0; j <= (int)m - 1; j++)
        c.a[i][j] = a[i][j] - b.a[i][j];
    return c;
  }
  Ma operator*(Ma b) const {
    Ma c;
    c.init();
    c.n = n;
    c.m = b.m;
    for (int i = (int)0; i <= (int)n - 1; i++)
      for (int j = (int)0; j <= (int)b.m - 1; j++)
        for (int k = (int)0; k <= (int)m - 1; k++)
          c.a[i][j] = (c.a[i][j] + a[i][k] * b.a[k][j] % MOD) % MOD;
    return c;
  }
} t[100000 + 10 << 4], c[100000 + 10];
struct Q {
  long long x, y;
  int id, op1, op2;
} q[100000 + 10 << 2];
bool cmp(Q a, Q b) { return a.x * b.y > a.y * b.x; }
void pushup(int p) { t[p] = t[p << 1] * t[p << 1 | 1]; }
void build(int l, int r, int p) {
  if (l == r) {
    t[p] = c[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, p << 1);
  build(mid + 1, r, p << 1 | 1);
  pushup(p);
}
void update(int l, int r, int x, int p) {
  if (l == r) {
    t[p] = c[x];
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    update(l, mid, x, p << 1);
  else
    update(mid + 1, r, x, p << 1 | 1);
  pushup(p);
}
long long pw(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;
}
long long inv(long long x) { return pw(x, MOD - 2); }
int main() {
  int n = read();
  long long inv100 = inv(100);
  for (int i = (int)1; i <= (int)n; i++)
    x[i] = readll(), v[i] = readll(), p[i][0] = readll() * inv100 % MOD,
    p[i][1] = (1 - p[i][0] + MOD) % MOD;
  c[1].n = c[1].m = 2;
  c[1].a[0][0] = p[1][0];
  c[1].a[0][1] = p[1][1];
  int m = 0;
  for (int i = (int)2; i <= (int)n; i++) {
    c[i].n = c[i].m = 2;
    if (v[i - 1] > v[i]) {
      m++;
      q[m].x = x[i] - x[i - 1];
      q[m].y = v[i - 1] - v[i];
      q[m].id = i;
      q[m].op1 = q[m].op2 = 0;
    } else
      c[i].a[0][0] = p[i][0];
    if (v[i - 1] < v[i]) {
      m++;
      q[m].x = x[i] - x[i - 1];
      q[m].y = v[i] - v[i - 1];
      q[m].id = i;
      q[m].op1 = q[m].op2 = 1;
    } else
      c[i].a[1][1] = p[i][1];
    c[i].a[1][0] = p[i][0];
    m++;
    q[m].x = x[i] - x[i - 1];
    q[m].y = v[i] + v[i - 1];
    q[m].id = i;
    q[m].op1 = 0;
    q[m].op2 = 1;
  }
  sort(q + 1, q + 1 + m, cmp);
  build(1, n, 1);
  ans[0] = (t[1].a[0][0] + t[1].a[0][1]) % MOD;
  long long res = 0;
  for (int i = (int)1; i <= (int)m; i++) {
    int x = q[i].op1, y = q[i].op2, id = q[i].id;
    c[id].a[x][y] = p[id][y];
    update(1, n, id, 1);
    ans[i] = (t[1].a[0][0] + t[1].a[0][1]) % MOD;
    res = (res + 1ll * (ans[i] + MOD - ans[i - 1]) * q[i].x % MOD *
                     inv(q[i].y) % MOD) %
          MOD;
  }
  res = (res % MOD + MOD) % MOD;
  printf("%I64d\n", res);
  return 0;
}