AT_abc478_g.Division Point Hull
省选/NOI-
通过率:0%
时间限制:4.00s
内存限制:1024MB
AC君温馨提醒
该题目为【atcoder】题库的题目,您提交的代码将被提交至atcoder进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are N points P1,P2,…,PN on the coordinate plane. The coordinates of point Pi are (Xi,Yi).
You are given positive integers p,q. Let Qi,j be the point that internally divides the segment PiPj in the ratio p:q. In particular, if Pi=Pj, then Qi,j=Pi.
Find the area of the convex hull of Qi,j for all pairs of positive integers (i,j) satisfying 1≤i<j≤N.
平面上有 N 个点 P1,P2,…,PN。点 Pi 的坐标为 (Xi,Yi)。
给定正整数 p,q。记 Qi,j 为线段 PiPj 上按比例 p:q 内分所得的点。特别地,若 Pi=Pj,则定义 Qi,j=Pi。
求所有满足 1≤i<j≤N 的正整数对 (i,j) 所对应的点 Qi,j 构成的凸包的面积。
输入格式
The input is given from Standard Input in the following format:
N p q
X1 Y1
X2 Y2
⋮
XN YN
输入从标准输入中按以下格式给出:
N p q
X1 Y1
X2 Y2
⋮
XN YN
输出格式
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 yx (x≥0,y≥1), output x and y in this order, separated by a space, in one line.
可以证明,在本题的约束条件下,所求凸包的面积为有理数。当该面积表示为既约分数 yx (x≥0,y≥1) 时,请在一行中按顺序输出 x 和 y,中间用一个空格分隔。
输入输出样例
输入#1
4 1 2 -2 4 1 1 -3 -2 4 0
输出#1
59 6
输入#2
3 3 4 11 -7 2 8 -4 18
输出#2
0 1
输入#3
10 5 7 -3677189 -8603516 3324282 8371380 -4445534 -865546 -1235744 -6761030 2732080 -9194939 8510740 4384715 -7326815 2451526 -2079912 1054509 2072791 -8408897 -4437202 -5184973
输出#3
6746232144385823 48
说明/提示
Sample 1 Explanation:
We have Q1,2=(−1,3),Q1,3=(−37,2),Q1,4=(0,38),Q2,3=(−31,0),Q2,4=(2,32),Q3,4=(−32,−34).
Their convex hull is the pentagon formed by connecting Q1,2,Q1,3,Q3,4,Q2,4,Q1,4 in this order, and its area is 659.

Sample 2 Explanation:
The area of the convex hull may be 0.
Constraints
- 2≤N≤105
- 1≤p<q≤10
- ∣Xi∣≤107
- ∣Yi∣≤107
- All input values are integers.
样例 1 解释:
我们有 Q1,2=(−1,3),Q1,3=(−37,2),Q1,4=(0,38),Q2,3=(−31,0),Q2,4=(2,32),Q3,4=(−32,−34)。
它们的凸包是由按此顺序连接点 Q1,2,Q1,3,Q3,4,Q2,4,Q1,4 所构成的五边形,其面积为 659。

样例 2 解释:
凸包的面积可能为 0。
限制条件
- 2≤N≤105
- 1≤p<q≤10
- ∣Xi∣≤107
- ∣Yi∣≤107
- 所有输入值均为整数。
输入解题思路,AI测评打分。不知道怎么写?