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

建议使用的浏览器:

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

6204:triangulation triangulation triangulation

题目描述
Today, I meet a difficult problem.
You are given three ints $n$, $x$, $y$. We have a regular n-gon: a convex polygon with $n$ sides, in which all sides have the same length and all internal angles are equal. We want to draw $n-3$ non-intersecting diagonals in some way. Once we do that, we will have the polygon divided into exactly $n-2$ triangles. We want to produce a situation in which one of these $n-2$ triangles has a $strictly$ larger area than each of the remaining $n-3$ triangles.
The vertices of the polygon are labeled $1$ through $n$ in clockwise order. Two sets of diagonals are different if one of them contains a diagonal that is not exist in the other one. Count all sets of $n-3$ non-intersecting diagonals that produce an arrangement with the above property. Output the number modulo $x$ multiple the number modulo $y$.
I can't solve it. Can you help me?
For example , the number of the first case is $(0\% 5)*(0\% 6)=0$,the number of the second case is $(5\% 6)*(5\% 7)=25$.
输入解释
First line contains an integer $T$ ($T \leq 2$), the number of test cases.
For each test case, there are three numbers $n, x, y$ in a line separated by blanks ($3 \leq n \leq 400, 1 \leq x, y \leq 10^9$).
输出解释
For each test case, print a single number in a line which is described above.
输入样例
2
4 5 6
5 6 7
输出样例
0
25
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6204

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

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 32768/32768K(Java/Others)