mod = 998244353 def main(): n, m = list(map(int, input().split())) XY = [list(map(int, input().split())) for _ in range(n)] XY.sort(key = lambda x: -x[3]) b100 = pow(100, -1, mod) ans = 0 for t in list(map(int, input().split())): now = 1 for x, y, p, s in XY: c = max(0, t//x)-max(0, (t-y)//x) nxt = now*pow((100-p)*b100, c, mod)%mod ans = (ans + (now-nxt)*s) % mod now = nxt ans = (ans + now) % mod return ans print(main())