题号:NC51700
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Here is another simple problem: Given n points in the 2-dimensional plane, please calculate the area of the convex hull.
However, as you might already have guessed, the value of n is very large! So you'll use the following generator to generate all those points:
You are given nine integers

.
There are two recursive equations:
%20%5Cmod%20p_x)
and
%20%5Cmod%20p_y)
for all 0 < i < n.
The given n points are
)
for

.
输入描述:
The input consists of only one line.
This line contains nine integers in the following order:
.
* 
* 
* 
* There may be multiple points in the same position
输出描述:
Please output one integer denoting the area of the convex hull (of the generated n points) multiplied by 2.
It can be proved that two times such area is always an integer.
示例2
输入
复制
123 193 37 59 31 128 195777 193241 12345678