Mr. Lin attends the wedding

TimeLimit:8000MS  MemoryLimit:128MB
64-bit integer IO format:%lld
未提交 | 登录后收藏
Problem Description

Today is the wedding of Mr.Lin good friend YGC. Mr.Lin went to the store to prepare a gift for YGC. As the best friend of Mr.Lin, It is impossible for Mr.Lin bought only one gift to YGC. So Mr.Lin suddenly had a strange thought in his mind:”I want to buy n gifts to YGC”. But Mr.Lin doesn't know what YGC likes about the m items in this store. Then Mr.Lin will bought n pieces of gifts from the m kinds of gifts gift to YGC.Now we define that YGC has a value  for the likes of these m items. We define the favorite situation of YGC for those gift bought by Mr.Lin is 1.gif ( means the number that the i-th item is selected, and  can be 0), now Mr.Lin is rushing to take the train to participate in the YGC wedding, so he takes  pieces for each item and then goes to Train. Now we want to know the mathematics expectation of YGC’s favorite situation for Mr.Lin’s gifts.Maybe the answer is lager enough, you can only tell us the answer modulo 998244353.

m种物品中任意挑选一共n件物品并且方案不相同所能获得得权值对应的数学期望。

对方案数不同定义如下:如果m种物品的对应的选取个数有一种不相同就是不相同

对权值的定义如下1.gif(pi表示第i种物品选取了pi个,vi表示第i种物品的权值)


Input

There multiple test cases in the input, each test case contains two lines

First line of input contains two positive integers n, m (n,m<=1e5,∑n,∑m<=1e5) 

and next line contain m integers () separated by a single space mentioned in the description.


Output

For every test case, output one single line contains a number, which is mentioned in the description. 

SampleInput
3 2
2 4
SampleOutput
30

HINT
the first sample answer is(64+32+16+8)/4 
Submit
题目统计信息详细
总AC数1
通过人数1
尝试人数1
总提交量2
AC率50.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: