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 long long mod = 998244353;
struct nod {
  long long dis, v, l, r, pos;
  nod(long long a, long long b, long long c, long long d, long long e) {
    dis = a;
    v = b;
    l = c;
    r = d;
    pos = e;
  }
  nod() {}
} a[100005 << 1];
bool operator<(nod a, nod b) { return a.dis * b.v < a.v * b.dis; }
int x[100005], v[100005];
int n, tot;
long long pos[100005][2];
int can[100005][2][2];
long long dat[100005 << 2][2][2];
long long quickpow(long long p, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = (ans * p) % mod;
    k >>= 1;
    p = (p * p) % mod;
  }
  return ans;
}
void pushup(int now, int pos) {
  memset(dat[now], 0, sizeof(dat[now]));
  for (int l = 0; l <= 1; l++) {
    for (int r = 0; r <= 1; r++) {
      for (int i = 0; i <= 1; i++) {
        for (int j = 0; j <= 1; j++)
          if (!can[pos][i][j]) {
            dat[now][l][r] =
                (dat[now][l][r] +
                 dat[(now << 1)][l][i] * dat[((now << 1) | 1)][j][r]) %
                mod;
          }
      }
    }
  }
}
void build(int nl, int nr, int now) {
  if (nl == nr) {
    dat[now][0][0] = pos[nl][0];
    dat[now][1][1] = pos[nr][1];
    return;
  }
  build(nl, ((nl + nr) >> 1), (now << 1));
  build(((nl + nr) >> 1) + 1, nr, ((now << 1) | 1));
  pushup(now, ((nl + nr) >> 1));
}
void update(int ql, int nl, int nr, int now) {
  if (nl == nr) return;
  if (ql <= ((nl + nr) >> 1))
    update(ql, nl, ((nl + nr) >> 1), (now << 1));
  else
    update(ql, ((nl + nr) >> 1) + 1, nr, ((now << 1) | 1));
  pushup(now, ((nl + nr) >> 1));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%lld", &x[i], &v[i], &pos[i][1]);
    pos[i][1] = (pos[i][1] * quickpow(100, mod - 2)) % mod;
    pos[i][0] = (1 - pos[i][1] + mod) % mod;
  }
  for (int i = 2; i <= n; i++) {
    a[++tot] = nod(x[i] - x[i - 1], v[i] + v[i - 1], 1, 0, i - 1);
    if (v[i] > v[i - 1]) {
      a[++tot] = nod(x[i] - x[i - 1], v[i] - v[i - 1], 0, 0, i - 1);
    }
    if (v[i] < v[i - 1]) {
      a[++tot] = nod(x[i] - x[i - 1], v[i - 1] - v[i], 1, 1, i - 1);
    }
  }
  sort(a + 1, a + 1 + tot);
  long long ans = 0;
  long long pre = 1;
  build(1, n, 1);
  for (int i = 1; i <= tot; i++) {
    can[a[i].pos][a[i].l][a[i].r] = 1;
    update(a[i].pos, 1, n, 1);
    long long sum =
        (dat[1][0][0] + dat[1][0][1] + dat[1][1][0] + dat[1][1][1]) % mod;
    long long p = (pre - sum + mod) % mod;
    long long tim = (a[i].dis * (quickpow(a[i].v, mod - 2))) % mod;
    ans = (ans + p * tim) % mod;
    pre = sum;
  }
  printf("%lld\n", ans);
}