[NOIP Simulation Test]: Fly (Fly) (number of simple geometric-shaped array +)

Title Description

$ liu \ _runda $ decided to raise the level of knowledge about, so he went to ask God Guo. Guo God readily gave $ liu \ _runda $ a God problem, $ liu \ _runda $ and will not do, so put this question to throw in the High School entrance exam to do.
Guo God $ $ n-bar is located in the first quadrant segments, and each segment is given coordinate axis, and $ X $ $ $ Y-axis intersection, so obviously can uniquely identify each segment.
n-ordinate $ $ $ Y $ line segments and the intersection of axes are $ 1,2,3,4 ... n $. $ $ X-axis and a line segment intersection and $ Y $ we denote the ordinate axis intersection of the abscissa $ $ I $ x_i + 1, x_i $ generated in such a manner:
$ $ x_1 is given by the input.
$ x_i = (x_ {i- 1} + a) \% mod, 2 \ leqslant i \ leqslant n $.
That is: If X_3 = $ 4 $, $ y intersection and the ordinate axis $ $ $ 3 parabolic, and $ X $ $ abscissa intersection of axes 4 + 1 = 5 $.
We guarantee given $ n, x_1, a, mod $ $ x_i $ such that all different from each other.
For all points in the first quadrant (point of horizontal and vertical coordinates may be any real number), if a point is $ X $ line segments through its Kichiku value is $ \ frac {x \ times ( x-1)} { 2} $.
Find all points in the first quadrant and Kichiku value.


Input Format

$ 4 $ line integers $ n, x_1, a, mod $.


Output Format

Obviously unfinished ......

Guess you like

Origin www.cnblogs.com/wzc521/p/11355718.html