首页 > 试题广场 >

take

[编程题]take

Kanade has n boxes , the i-th box has p[i] probability to have an diamond of d[i] size.

At the beginning , Kanade has a diamond of 0 size. She will open the boxes from 1-st to n-th. When she open a box,if there is a diamond in it and it's bigger than the diamond of her , she will replace it with her diamond.

Now you need to calculate the expect number of replacements.

You only need to output the answer module 998244353.

Notice: If x%998244353=y*d %998244353 ,then we denote that x/y%998244353 =d%998244353


输入描述:
The first line has one integer n.

Then there are n lines. each line has two integers p[i]*100 and d[i].


输出描述:
Output the answer module 998244353
示例1

输入

3
50 1
50 2
50 3

输出

499122178

备注:
1<= n <= 100000

1<=p[i]*100 <=100

1<=d[i]<=10^9

这道题你会答吗?花几分钟告诉大家答案吧!

问题信息

难度:
0条回答 118浏览

热门推荐

通过挑战的用户

查看代码
take