Creatnx has $n$ mirrors, numbered from $1$ to $n$. Every day, Creatnx asks exactly one mirror "Am I beautiful?". The $i$-th mirror will tell Creatnx that he is beautiful with probability $\frac{p_i}{100}$ for all $1 \le i \le n$.

Creatnx asks the mirrors one by one, starting from the $1$-st mirror. Every day, if he asks $i$-th mirror, there are two possibilities:  The $i$-th mirror tells Creatnx that he is beautiful. In this case, if $i = n$ Creatnx will stop and become happy, otherwise he will continue asking the $i+1$-th mirror next day;  In the other case, Creatnx will feel upset. The next day, Creatnx will start asking from the $1$-st mirror again. 

You need to calculate the expected number of days until Creatnx becomes happy.

This number should be found by modulo $998244353$. Formally, let $M = 998244353$. It can be shown that the answer can be expressed as an irreducible fraction $\frac{p}{q}$, where $p$ and $q$ are integers and $q \not \equiv 0 \pmod{M}$. Output the integer equal to $p \cdot q^{-1} \bmod M$. In other words, output such an integer $x$ that $0 \le x < M$ and $x \cdot q \equiv p \pmod{M}$.


-----Input-----

The first line contains one integer $n$ ($1\le n\le 2\cdot 10^5$) — the number of mirrors.

The second line contains $n$ integers $p_1, p_2, \ldots, p_n$ ($1 \leq p_i \leq 100$).


-----Output-----

Print the answer modulo $998244353$ in a single line.


-----Examples-----
Input
1
50

Output
2

Input
3
10 20 50

Output
112



-----Note-----

In the first test, there is only one mirror and it tells, that Creatnx is beautiful with probability $\frac{1}{2}$. So, the expected number of days until Creatnx becomes happy is $2$.

Difficulty: interview

Starter code:

Solutions:

#q = int(input())
#x, y = map(int,input().split(' '))
#print (' '.join(list(map(str, s))))

def extended_gcd(aa, bb):
    lastremainder, remainder = abs(aa), abs(bb)
    x, lastx, y, lasty = 0, 1, 1, 0
    while remainder:
        lastremainder, (quotient, remainder) = remainder, divmod(lastremainder, remainder)
        x, lastx = lastx - quotient*x, x
        y, lasty = lasty - quotient*y, y
    return lastremainder, lastx * (-1 if aa < 0 else 1), lasty * (-1 if bb < 0 else 1)
 
def modinv(a, m):
    g, x, y = extended_gcd(a, m)
    if g != 1:
        raise ValueError
    return x % m

m = 998244353
n = int(input())
p = list(map(int,input().split(' ')))

up = 0
low = 1
for i in range(n):
    up = up + low
    up = up * 100 % m
    low = low * p[i] % m
    
print (up*modinv(low,m)%m)

M = 998244353

def gcd(a, b):
    if (a == 0):
        return 0, 1

    x, y = gcd(b % a, a)

    return y - (b // a) * x, x



k = input()
probs = list(map(int, input().split(' ')))
num, denum = 0, 1
for p in probs:
    num = (num + denum) * 100 % M
    denum = denum * p % M

    #print(num, denum)

inv, _ = gcd(denum, M)
print(num * inv % M)


#d[i + 1] = (d[i] + 1) * 100 / p


mod = 998244353

def inv_mod(n) :
        return pow(n, mod-2, mod)

def frac_mod(a, b) :
        return a*inv_mod(b) % mod

n = int(input())
a = input().split()

res = 0
for v in a :
        res = (res+1) * 100 * inv_mod(int(v)) % mod

print(res)

#!/usr/bin/env python3
import sys
input = sys.stdin.readline
MOD = 998244353
 
n = int(input())
a = [int(item) for item in input().split()]
A = 0
B = 0
child = 1
bases = []
base = 1
for i in range(n + 10):
    bases.append(base)
    base *= 100
    base %= MOD

for i, item in enumerate(a):
    A += child * (100 - item) * bases[n-i-1]
    A %= MOD
    B += child * (100 - item) * bases[n-i-1] * (i + 1)
    B %= MOD
    child *= item
    child %= MOD
B += child * n
ans = B * pow(bases[n]-A, MOD-2, MOD)
ans %= MOD
print(ans)

mod = 998244353

def inv_mod(n):
    return pow(n, mod - 2, mod)

n = int(input())
p = [int(x) for x in input().split()]

res = 0
for i in p:
    res = (res + 1) * 100 * inv_mod(i) % mod

print(res)

import sys
import math
from collections import defaultdict
from collections import deque
from itertools import combinations
from itertools import permutations
input = lambda : sys.stdin.readline().rstrip()
read = lambda : list(map(int, input().split()))
def write(*args, sep="\n"):
  for i in args:
    sys.stdout.write("{}{}".format(i, sep))
INF = float('inf')
MOD = 998244353
YES = "YES"
NO = "NO"

n = int(input())
p = [0] + read()
p = list(map(lambda x : x*pow(100, MOD-2, MOD)%MOD, p))


A = [0] * (n+2)

for i in range(2, n+2):
  A[i] = (A[i-1] - 1) * pow(p[i-1], MOD-2, MOD) % MOD 

print((-A[-1] + MOD) % MOD)


M = 998244353

n = int(input())

exp = 0
for pi in map(int,input().split()):
    exp = (exp+1) * 100 * pow(pi,M-2,M) % M

print(exp)



mod = 998244353

def pow_(x, p, mod):
    if p == 1: return x % mod 
    
    tmp  = pow_(x, p // 2, mod)
    if p % 2 == 0:
        return (tmp * tmp) % mod
    else:
        return (tmp * tmp * x) % mod
    
def reverse(x, mod):
    return pow_(x, mod-2, mod)

n     = int(input()) + 1
p     = [0] + list(map(int, input().split()))
dp    = [0] * n
rev   = [0] * 101 

for i in range(1, 101):
    rev[i] = reverse(i, mod)
    
for i in range(1, n):
    dp[i]=(((dp[i-1]+1)*100 * rev[p[i]])) % mod 
    
print(dp[-1])

M = 998244353
 
n = int(input())
 
exp = 0
for pi in map(int,input().split()):
    exp = (exp+1) * 100 * pow(pi,M-2,M) % M
 
print(exp)

M = 998244353
 
def gcd(a, b):
    if (a == 0):
        return 0, 1
 
    x, y = gcd(b % a, a)
 
    return y - (b // a) * x, x
 
k = input()
probs = list(map(int, input().split(' ')))
num, denum = 0, 1
for p in probs:
    num = (num + denum) * 100 % M
    denum = denum * p % M
 
inv, _ = gcd(denum, M)
print(num * inv % M)

import os

N = int(3e5 + 233)
MOD = 998244353
ans = []
for i in range(N):
    ans.append(0)

def fp(x, y):
    res = 1
    while y:
        if y&1:
            res = res * x
            res %= MOD
        x *= x
        x %= MOD
        y >>= 1
    return res

inv = fp(100, MOD-2)
n = int(input())
dig = list(map(int, input().split()))
for i in range(1, n+1):
    x = dig[i-1]
    x *= inv
    x %= MOD
    ans[i] = (((1 + ans[i-1]) % MOD) * fp(x, MOD-2)) % MOD
print(ans[n])

import sys
input=sys.stdin.readline
n=int(input())
L=map(int,input().split())
k=0
c=1
m=998244353
counter=0
for i in L:
    k+=c*(pow(100,n-counter,m))
    k%=m
    c*=i
    c%=m
    counter+=1
def modInverse(a, m) : 
    m0 = m 
    y = 0
    x = 1
    if (m == 1) : 
        return 0
    while (a > 1) : 
        q = a // m 
        t = m 
        m = a % m 
        a = t 
        t = y 
        y = x - q * y 
        x = t 
    if (x < 0) : 
        x = x + m0 
    return x 
p=k%m
q=c%m
print((modInverse(q,m)*p)%m)

from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353
def factors(n):return sorted(list(set(reduce(list.__add__,([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))))
def inv_mod(n):return pow(n, mod - 2, mod)

def li():return [int(i) for i in input().rstrip('\n').split(' ')]
def st():return input().rstrip('\n')
def val():return int(input())

n = val()
exp = 0
for pi in li():
    exp = (exp+1) * 100 * pow(pi,M-2,M) % M
 
print(exp)

def solve():
    s = input()
    if 'aa' in s or 'bb' in s or 'cc' in s:
        print(-1)
        return
    syms = s + '@'
    ans = ['@']
    for i, sym in enumerate(s):
        if sym != '?':
            ans.append(sym)
            continue
        for x in 'abc':
            if x != ans[-1] and x != syms[i + 1]:
                ans.append(x)
                break
    print(''.join(ans[1:]))


def solveb():
    n = int(input())
    perm = [int(x) for x in input().split()]
    num___idx = [-1 for _ in range(n + 1)]
    for i, num in enumerate(perm):
        num___idx[num] = i

    curr_max = -1
    curr_min = 2 * n
    num___pretty = [0 for _ in range(n + 1)]
    for num in range(1, n + 1):
        curr_max = max(num___idx[num], curr_max)
        curr_min = min(num___idx[num], curr_min)
        if curr_max - curr_min + 1 == num:
            num___pretty[num] = 1
    print(*num___pretty[1:], sep='')


def solvec():
    n = int(input())
    rank___problems_nr = [int(x) for x in input().split()]
    weird_prefsums = [0]
    last_num = rank___problems_nr[0]
    for num in rank___problems_nr:
        if num != last_num:
            last_num = num
            weird_prefsums.append(weird_prefsums[-1])
        weird_prefsums[-1] += 1

    gold = weird_prefsums[0]
    silvers = 0
    i = 1
    for i in range(1, len(weird_prefsums)):
        x = weird_prefsums[i]
        if x - gold > gold:
            silvers = x - gold
            break

    bronzes = 0
    for j in range(i, len(weird_prefsums)):
        x = weird_prefsums[j]
        if x > n / 2:
            break
        if x - gold - silvers > gold:
            bronzes = x - gold - silvers
    if bronzes == 0 or silvers == 0:
        print(0, 0, 0)
        return

    print(gold, silvers, bronzes)


def solved():
    a, b, c, d = (int(x) for x in input().split())
    ab_len = min(a, b)
    a -= ab_len
    b -= ab_len
    cd_len = min(c, d)
    c -= cd_len
    d -= cd_len

    if a == 1 and cd_len == 0 and d == 0 and c == 0:
        print('YES')
        print('0 1 ' * ab_len + '0')
        return
    if d == 1 and ab_len == 0 and a == 0 and b == 0:
        print('YES')
        print('3 ' + '2 3 ' * cd_len)
        return
    if a > 0 or d > 0:
        print('NO')
        return

    cb_len = min(b, c)
    b -= cb_len
    c -= cb_len
    if b > 1 or c > 1:
        print('NO')
        return
    print('YES')
    print('1 ' * b + '0 1 ' * ab_len + '2 1 ' * cb_len + '2 3 ' * cd_len + '2' * c)


def get_me(prob, mod):
    # return 100, prob
    return (100 * pow(prob, mod - 2, mod)) % mod


def solvee():
    n = int(input())
    mod = 998244353
    idx___prob = [int(x) for x in input().split()]
    curr_me = get_me(idx___prob[0], mod)
    for prob in idx___prob[1:]:
        me = get_me(prob, mod)
        curr_me *= me
        curr_me %= mod

        curr_me += me
        curr_me %= mod

    # curr_q_me = pow(curr_q_me, mod - 2, mod)

    print(curr_me)


def __starting_point():
    solvee()

__starting_point()

from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline
M = mod = 998244353
def factors(n):return sorted(list(set(reduce(list.__add__,([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))))
def inv_mod(n):return pow(n, mod - 2, mod)
 
def li():return [int(i) for i in input().rstrip('\n').split(' ')]
def st():return input().rstrip('\n')
def val():return int(input())
 
n = val()
exp = 0
for pi in li():
    exp = (exp+1) * 100 * pow(pi,M-2,M) % M
 
print(exp)
#From SMMaster


# 解説AC
mod = 998244353
n = int(input())
p = list(map(int, input().split()))
i100 = pow(100, mod-2, mod)
p = [i*i100%mod for i in p]

top = 1
for i in range(n-2, -1, -1):
    top *= p[i]
    top += 1
    top %= mod

bot = 1
for i in range(n):
    bot *= p[i]
    bot %= mod

ans = top*pow(bot, mod-2, mod)%mod
print(ans)

n = int(input())
p = list(map(int, input().split()))

ans = 0
size = 998244353

for p in p:
    ans = (ans+1) % size
    ans = (((ans*100) % size)*pow(p, size-2, size)) % size

print(ans)


mod = 998244353
 
def inv_mod(n):
    return pow(n, mod - 2, mod)
 
n = int(input())
p = [int(x) for x in input().split()]
 
res = 0
for i in p:
    res = (res + 1) * 100 * inv_mod(i) % mod
 
print(res)

n = int(input())
exp = 0 
M = 998244353
for pi in map(int, input().split()):
    exp = (exp+1)*100*pow(pi, M-2, M) %M

print(int(exp%M))

import sys
input = sys.stdin.readline

mod = 998244353 #出力の制限
#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m=mod):
    x = extgcd(a,m)[0]
    return (m+x%m)%m

N = int(input())
A = list(map(int, input().split()))

K = 0
P = 0
Q = 1
for i, a in enumerate(A):
    p0 = a * mod_inv(100) % mod
    q0 = (100-a) * mod_inv(100) % mod

    P = (P + (i+1)*Q*q0) % mod
    K = (K + Q*q0) % mod
    Q = Q * p0 % mod

inv = (mod + 1 - K) % mod
w = (N*Q + P) % mod
ans = w * mod_inv(inv) % mod
print(ans)

M = 998244353
 
n = int(input())
 
exp = 0
for pi in map(int,input().split()):
    exp = (exp+1) * 100 * pow(pi,M-2,M) % M
 
print(exp)

n=input()
n=int(n)
md=998244353
L=list(map(int,input().split()))
def inv(x):
    nonlocal md
    return pow(x,md-2,md)
ml=1
ans=0
for el in reversed(L):
    ml*=100
    ml*=inv(el)
    ml%=md
    ans+=ml
    ans%=md
print(ans)


M = 998244353 
n=input()
p=list(map(int, input().split(' ')))
num=0
denum=1
for i in p:
    num=(num+denum)*100%M
    denum=denum*i%M
#print(num, denum)
from math import gcd
g=gcd(num,denum)
num=num//g
denum=denum//g
denum=pow(denum,M-2,M)
print(num*denum%M)


MOD =  998244353

def power(x,y):
    res=1
    while(y>0):
        if(y&1):
            res = x*res%MOD
        y = y >>1
        x = x*x%MOD
    return res



n = int(input())



prob = input().split()


p = power(100,n)
q = 1

for i in range(0,n-1):
    q = q*(int(prob[i]))%MOD
    p = (p + q*(power(100,n-i-1))%MOD)%MOD
q = q*(int(prob[n-1]))%MOD

print(p*(power(q,MOD-2))%MOD)

from sys import stdin

input = stdin.readline

mod = 998244353

inv = [0] * 103
inv[1] = 1
for i in range(2, 101):
    inv[i] = (mod - mod // i) * inv[mod % i] % mod

n = int(input())

h = [0] * (n+3)
h[0] = 1
for i in range(1, n+2):
    h[i] = h[i-1]*100 % mod


p = list(map(int, input().split()))
tot = 1 * h[n] % mod
now = 1
iv = 1
for i in range(n):
    if i == n-1:
        iv = iv*inv[p[i]] % mod
        continue
    now = now*p[i] % mod
    tot += now * h[n-i-1] % mod
    tot %= mod
    iv = iv*inv[p[i]] % mod

print(tot*iv % mod)