#ABC478G. 分割点凸包 / Division Point Hull
分割点凸包 / Division Point Hull
Problem Statement
There are points on the coordinate plane. The coordinates of point are .
You are given positive integers . Let be the point that internally divides the segment in the ratio . In particular, if , then .
Find the area of the convex hull of for all pairs of positive integers satisfying .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
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 , output and in this order, separated by a space, in one line.
4 1 2
-2 4
1 1
-3 -2
4 0
59 6
We have $Q_{1,2}=\left(-1,3\right),Q_{1,3}=\left(-\frac{7}{3},2\right),Q_{1,4}=\left(0,\frac{8}{3}\right),Q_{2,3}=\left(-\frac{1}{3},0\right),Q_{2,4}=\left(2,\frac{2}{3}\right),Q_{3,4}=\left(-\frac{2}{3},-\frac{4}{3}\right)$.
Their convex hull is the pentagon formed by connecting in this order, and its area is .

3 3 4
11 -7
2 8
-4 18
0 1
The area of the convex hull may be .
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
- Source: AtCoder ABC 478 G
相关
在下列比赛中: