#598. 「Nowcoder多校 2019 Day5」generator 3
「Nowcoder多校 2019 Day5」generator 3
当前没有测试数据。
题目描述
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: and 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.
样例
样例输入 1
2 3 4 5 6 7 8 9 10
样例输出 1
28
样例输入 2
123 193 37 59 31 128 195777 193241 12345678
样例输出 2
75659192744