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

建议使用的浏览器:

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

6837:Kirakira

题目描述
There are $n$ stars in the sky. At every moment, the $i$-th of them has a probability of $u_i/v_i(1 \leq u_i < v_i<P=31607)$ to become visible. All stars are independent of each other. The position of a star can be described as a coordinate on a 2D plane. No two stars share the same coordinate. Your task is to compute the expectation value of the area of the convex hull formed by the visible stars.
Formally, let $P = 31607$. It can be shown that the answer can be expressed as an irreducible fraction $p/q$, where $p$ and $q$ are integers and $q \not \equiv 0 \pmod{P}$. Output the integer equal to $p \cdot q^{-1} \bmod P$. In other words, output such an integer $x$ that $0 \le x < P$ and $x \cdot q \equiv p \pmod{P}$.
输入解释
The first line contains a single integer $T$ ($1 \le T \le 100$), denoting the number of test cases.

For each test case, the first line contains a single integer $n$$(1 \le n \le 1000)$, denoting the number of stars.

Each of the following $n$ lines describes a stars. The $i$-th line of them contains 4 integers $x_i, y_i, u_i, v_i(-1000 \le x_i,y_i \le 1000, 1 \leq u_i < v_i<P=31607)$ indicating the coordinate of the $i$-th star and the probability of the $i$-th star to become visible. It is guaranteed that no two stars share the same coordinate.

There are at most $3$ test cases satisfying $n>20$.
输出解释
Output the integer equal to $p \cdot q^{-1} \bmod P$ denoting the answer.
输入样例
2
4
0 0 1 2
1 0 1 2
0 1 1 2
1 1 1 2
4
0 0 1 2
1 0 1 2
-1 0 1 2
0 1 1 2
输出样例
21730
21730
来自杭电HDUOJ的附加信息
Recommend IceyWang

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

源链接: HDU-6837

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

共提交 0

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