Question Link
- Question:
Enter n to obtain the number of diagonal 1 and diagonal 2 in the positive n edge shape (diagonal 1: At least parallel to the other diagonal; diagonal 2: At least perpendicular to the other diagonal ), the diagonal line cannot be the side of a polygon.
(4 ≤ n ≤ 10e5)
- Analysis:
The number of sides in the center of two parallel edges must be the same, that is to say, when the two endpoints move several short points in one direction, they can get another parallel edge. That is to say, each side of a polygon is parallel (when the six sides are in the shape of a special case, they are processed separately)
Vertical relatively troublesome: For N is an even number, we can obtain that each point of the n-3 side is a diagonal 2 (n is an even number, any diagonal line must divide the original graph into two Symmetric Graphs); when n is an odd number, there is no diagonal line 2 (only speculation)
Int A [2] [110]; int main () {int N; A [0] [4] = 0; A [0] [5] = 0; A [0] [6] = 6; A [1] [4] = 2; A [1] [5] = 0; A [1] [6] = 9; while (~ RI (N) {If (n <= 6) {printf ("% d \ n", a [0] [N], A [1] [N]);} else {cout <1ll * (N-3) * n/2 <''; If (N & 1) cout <0 <Endl; else cout <1ll * (N-3) * n/2 <Endl ;}} return 0 ;}