当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6425:Rikka with Badminton

题目描述
In the last semester, Rikka joined the badminton club.

There are $n$ students in the badminton club, some of them have rackets, and some of them have balls. Formally, there are $a$ students have neither rackets nor balls, $b$ students have only rackets, $c$ students have only balls, and $d$ students have both rackets and balls. $(a+b+c+d=n)$

This week, the club is going to organize students to play badminton. Each student can choose to take part in or not freely. So there are $2^n$ possible registration status.

To play badminton, there must be at least two students who have rackets and at least one students who have balls. So if there aren't enough balls or rackets, the activity will fail.

Now, Rikka wants to calculate the number of the status among all $2^n$ possible registration status which will make the activity fail.
输入解释
The first line contains a single number $t(1 \leq t \leq 10^3)$, the number of testcases.

For each testcase, the first line contains four integers $a,b,c,d(0 \leq a,b,c,d \leq 10^7,a+b+c+d \geq 1)$.
输出解释
For each testcase, output a single line with a single integer, the answer modulo $998244353$.
输入样例
3
1 1 1 1
2 2 2 2
3 4 5 6
输出样例
12
84
2904
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6425

最后修改于 2020-10-25T23:31:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 524288/524288K(Java/Others)