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;
template <class T>
void cmax(T &a, T b) {
  a = (a > b ? a : b);
}
template <class T>
void cmin(T &a, T b) {
  a = (a > b ? b : a);
}
const long long maxn = 140000, kcz = 998244353;
long long ksm(long long ds, long long zs = kcz - 2, long long mod = kcz) {
  long long res = 1;
  for (; zs; zs >>= 1, ds = ds * ds % mod)
    if (zs & 1) res = res * ds % mod;
  return res;
}
const long long i100 = ksm(100);
long long lim[maxn][2][2], n;
long long p[maxn][2];
struct SEG {
  long long tr[maxn << 1][2][2];
  void up(long long now, long long l, long long r) {
    memset(tr[now], 0, sizeof(tr[now]));
    long long i, j, k, t;
    for (i = (0); i <= (1); ++i)
      for (j = (0); j <= (1); ++j)
        for (k = (0); k <= (1); ++k)
          for (t = (0); t <= (1); ++t)
            if (!lim[((l + r) >> 1)][k][t])
              (tr[now][i][j] +=
               tr[(now << 1)][i][k] * tr[(now << 1 | 1)][t][j]) %= kcz;
  }
  void build(long long now, long long l, long long r) {
    if (l == r) {
      tr[now][0][0] = p[l][0];
      tr[now][1][1] = p[l][1];
      return;
    }
    build((now << 1), l, ((l + r) >> 1));
    build((now << 1 | 1), ((l + r) >> 1) + 1, r);
    up(now, l, r);
  }
  void up(long long now, long long l, long long r, long long x) {
    if (l == r) return;
    if (((l + r) >> 1) >= x)
      up((now << 1), l, ((l + r) >> 1), x);
    else
      up((now << 1 | 1), ((l + r) >> 1) + 1, r, x);
    up(now, l, r);
  }
} seg;
struct data {
  long long id, l, r, t;
  double p;
  data() {
    id = l = r = t = 0;
    p = 0;
  }
  data(long long a, long long b, long long c, long long d, double e) {
    id = a;
    l = b;
    r = c;
    t = d;
    p = e;
  }
  bool operator<(const data &b) const { return p < b.p; }
} a[maxn << 1];
int main() {
  scanf("%lld", &n);
  long long i, lx, lv, cnt = 0;
  for (i = (1); i <= (n); ++i) {
    long long X, V, P;
    scanf("%lld%lld%lld", &X, &V, &P);
    if (i > 1) {
      a[++cnt] = data(i - 1, 1, 0, (X - lx) * ksm(V + lv) % kcz,
                      (double)(X - lx) / (V + lv));
      if (V > lv)
        a[++cnt] = data(i - 1, 0, 0, (X - lx) * ksm(V - lv) % kcz,
                        (double)(X - lx) / (V - lv));
      else if (lv > V)
        a[++cnt] = data(i - 1, 1, 1, (X - lx) * ksm(lv - V) % kcz,
                        (double)(X - lx) / (lv - V));
    }
    p[i][0] = (100 - P) * i100 % kcz;
    p[i][1] = P * i100 % kcz;
    lv = V;
    lx = X;
  }
  seg.build(1, 1, n);
  sort(a + 1, a + cnt + 1);
  long long ans = 0, last = 1, now, j, k;
  for (i = (1); i <= (cnt); ++i) {
    lim[a[i].id][a[i].l][a[i].r] = 1;
    seg.up(1, 1, n, a[i].id);
    now = 0;
    for (j = (0); j <= (1); ++j)
      for (k = (0); k <= (1); ++k) (now += seg.tr[1][j][k]) %= kcz;
    ans += a[i].t * (last - now + kcz) % kcz;
    last = now;
  }
  printf("%lld", (ans % kcz + kcz) % kcz);
  return 0;
}