#P2089. Number Game

Number Game

题目描述

点击这里查看pdf

MianKing and GreenKing are playing a game. Initially there are KK integers on the blackboard and a set SS.

MianKing and GreenKing take turns to operate and MianKing will operate first.

In each operation the player can choose an integer xx on the blackboard which is not a Bad Number(Will be defined below), then choose an integer yy in SS.

The player should guaranteed that yleqxy\\leq x and if there is no y that satisfies yleqxy\\leq x in the set S, the player cannot choose this xx.

Then the player will replace xx with xyx-y on the blackboard.

If a player cannot do any operations, the player loses this game.

GreenKing is a bad woman, she wants to choose a subset of size KK from 1...n\\{1...n\\} to ensure that she can win the game(Assuming that both players are smart enough). Now you need to help her calculate how many subset of 1...n\\{1...n\\} satisfies the above conditions.

The answer may be very large, so you only need to output answer mod 998244353998244353.

We call a number is a Bad Number, if and only if it has an even number of 1 in the binary representation.

For example, 0,3,9960,3,996 are all Bad Numbers and 1,71,7 are not Bad Numbers.

输入格式

The first line has three integers n,K,Sn,K,|S|

The second line has S|S| distinct integers denotes the set SS.

1leqnleq10181\\leq n\\leq 10^{18}

1leqKleqmin(n,100)1\\leq K\\leq min(n,100)

forallxinS,1leqxleq20\\forall x \\in S, 1\\leq x\\leq 20

S>0|S|>0

输出格式

Output the answer mod 998244353998244353.

样例

5 2 1 
2 

6 

1000 100 10 
1 2 3 4 5 6 7 8 10 11 

896262428 

提示

Form 2020ICPC济南站