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 <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "URDL";
const long long MOD2 = (long long)998244353 * (long long)998244353;
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 998244353) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 998244353) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int T[100035 * 4][2][2], P[100035][2];
bool ban[100035][2][2];
void Up(int rt, int l, int r) {
  int mid = (l + r) / 2;
  for (int(i) = 0; (i) < (int)(2); (i)++)
    for (int(j) = 0; (j) < (int)(2); (j)++) T[rt][i][j] = 0;
  for (int(i) = 0; (i) < (int)(2); (i)++)
    for (int(j) = 0; (j) < (int)(2); (j)++) {
      if (!ban[mid][i][j]) {
        for (int(x) = 0; (x) < (int)(2); (x)++)
          for (int(y) = 0; (y) < (int)(2); (y)++) {
            addmod(T[rt][x][y], (long long)T[(rt << 1)][x][i] *
                                    T[(rt << 1 | 1)][j][y] % 998244353);
          }
      }
    }
}
void build(int rt, int l, int r) {
  if (l == r) {
    T[rt][0][0] = P[l][0];
    T[rt][1][1] = P[l][1];
    return;
  }
  int mid = (l + r) / 2;
  build((rt << 1), l, mid);
  build((rt << 1 | 1), mid + 1, r);
  Up(rt, l, r);
}
void upt(int rt, int l, int r, int L, int val) {
  if (l == r) {
    return;
  }
  int mid = (l + r) / 2;
  if (L <= mid)
    upt((rt << 1), l, mid, L, val);
  else
    upt((rt << 1 | 1), mid + 1, r, L, val);
  Up(rt, l, r);
}
int x[100035], v[100035], p[100035];
struct mb {
  int id, L, V, d1, d2;
  bool operator<(const mb& o) const {
    return (long long)L * o.V < (long long)o.L * V;
  }
} ynk[100035 * 2];
void fmain(int tid) {
  scanf("%d", &n);
  int inv = fastPow(100, 998244353 - 2);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    scanf("%d%d%d", x + i, v + i, p + i);
    P[i][1] = (long long)p[i] * inv % 998244353;
    P[i][0] = (1 - P[i][1] + 998244353) % 998244353;
  }
  build(1, 1, n);
  int cnt = 0;
  for (int(i) = 1; (i) <= (int)(n - 1); (i)++) {
    ynk[++cnt] = {i, x[i + 1] - x[i], v[i] + v[i + 1], 1, 0};
    if (v[i] > v[i + 1]) {
      ynk[++cnt] = {i, x[i + 1] - x[i], v[i] - v[i + 1], 1, 1};
    }
    if (v[i] < v[i + 1]) {
      ynk[++cnt] = {i, x[i + 1] - x[i], v[i + 1] - v[i], 0, 0};
    }
  }
  sort(ynk + 1, ynk + 1 + cnt);
  int pre = 1, Ans = 0;
  for (int(i) = 1; (i) <= (int)(cnt); (i)++) {
    ban[ynk[i].id][ynk[i].d1][ynk[i].d2] = 1;
    upt(1, 1, n, ynk[i].id, 0);
    int cur = ((long long)T[1][0][0] + T[1][0][1] + T[1][1][0] + T[1][1][1]) %
              998244353;
    addmod(Ans, (long long)(pre - cur + 998244353) * ynk[i].L % 998244353 *
                    fastPow(ynk[i].V, 998244353 - 2) % 998244353);
    pre = cur;
  }
  printf("%d\n", Ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}