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:
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
x_0, y_0, a_x, a_y, b_x, b_y, p_x, p_y, n
x
,y
,a
x
,a
y
,b
x
,b
y
,p
x
,p
y
,n.
There are two recursive equations:
x_i= (a_x * x_{i-1} + b_x) mod p_x
x
i
=(a
x
∗x
i−1
+b
x
)modp
x
and
y_i= (a_y * y_{i-1} + b_y) mod p_y
y
i
=(a
y
∗y
i−1
+b
y
)modp
y
for all 0 < i < n.
The given n points are
(x_i, y_i)
(x
i
,y
i
) for
0 le i < n
0≤i