内分点凸包AI (CI翻译)
Problem Statement
题目描述
AI (CI翻译)There are $N$ points $P_1,P_2,\dots,P_N$ on the coordinate plane. The coordinates of point $P_i$ are $(X_i,Y_i)$.
坐标平面上有 $N$ 个点 $P_1,P_2,\dots,P_N$。点 $P_i$ 的坐标为 $(X_i,Y_i)$。AI (CI翻译)
You are given positive integers $p,q$. Let $Q_{i,j}$ be the point that internally divides the segment $P_iP_j$ in the ratio $p:q$. In particular, if $P_i=P_j$, then $Q_{i,j}=P_i$.
给定正整数 $p,q$。令 $Q_{i,j}$ 为将线段 $P_iP_j$ 按 $p:q$ 的比例内分的点。特别地,如果 $P_i=P_j$,则 $Q_{i,j}=P_i$。AI (CI翻译)
Find the area of the convex hull of $Q_{i,j}$ for all pairs of positive integers $(i,j)$ satisfying $1 \leq i \lt j \leq N$.
求满足 $1 \leq i \lt j \leq N$ 的所有正整数对 $(i,j)$ 对应的点 $Q_{i,j}$ 所构成的凸包面积。AI (CI翻译)
Constraints
约束条件
AI (CI翻译)$2 \leq N \leq 10^5$$1 \leq p \lt q \leq 10$$|X_i|\leq 10^7$$|Y_i|\leq 10^7$- All input values are integers.
$2 \leq N \leq 10^5$$1 \leq p \lt q \leq 10$$|X_i|\leq 10^7$$|Y_i|\leq 10^7$- 所有输入值均为整数。
Input
输入格式
AI (CI翻译)The input is given from Standard Input in the following format:
输入从标准输入按以下格式给出:AI (CI翻译)
N p q
X_1 Y_1
X_2 Y_2
\vdots
X_N Y_N
N p q
X_1 Y_1
X_2 Y_2
\vdots
X_N Y_NAI (CI翻译)
Output
输出格式
AI (CI翻译)It can be proved that, under the constraints of this problem, the area of the convex hull to be found is rational. When the area is represented as an irreducible fraction $\dfrac{x}{y}\ (x \geq 0, y \geq 1)$, output $x$ and $y$ in this order, separated by a space, in one line.
可以证明,在本题的约束条件下,所求凸包的面积为有理数。将面积表示为最简分数 $\dfrac{x}{y}\ (x \geq 0, y \geq 1)$ 时,请在一行中按顺序输出 $x$ 和 $y$,用空格分隔。AI (CI翻译)
样例
4 1 2
-2 4
1 1
-3 -2
4 0
59 6
3 3 4
11 -7
2 8
-4 18
0 1
10 5 7
-3677189 -8603516
3324282 8371380
-4445534 -865546
-1235744 -6761030
2732080 -9194939
8510740 4384715
-7326815 2451526
-2079912 1054509
2072791 -8408897
-4437202 -5184973
6746232144385823 48
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。