1 | for (int c0 = -27 * n + 2; c0 <= 1; c0 += 1) |
2 | S1(c0 - 1); |
3 | for (int c0 = 2; c0 <= min(2 * n, n + 29); c0 += 1) { |
4 | if (c0 >= 3) { |
5 | if (2 * n >= c0 + 1) { |
6 | S4(c0 - c0 / 2 - 1, c0 / 2 + 1); |
7 | if (c0 + 2 >= 2 * n) { |
8 | for (int c2 = 1; c2 < -n + c0; c2 += 1) |
9 | S5(-n + c0, n, c2); |
10 | } else if (c0 >= 5) { |
11 | S4(c0 - c0 / 2 - 2, c0 / 2 + 2); |
12 | for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) |
13 | S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); |
14 | } |
15 | } |
16 | for (int c1 = -c0 + c0 / 2 + 3; c1 <= min(-1, n - c0); c1 += 1) { |
17 | S4(-c1, c0 + c1); |
18 | S6(-c1 + 2, c0 + c1 - 2); |
19 | for (int c2 = 1; c2 <= -c1; c2 += 1) |
20 | S5(-c1 + 1, c0 + c1 - 1, c2); |
21 | } |
22 | if (2 * n >= c0 + 3 && c0 >= n + 2) { |
23 | S6(-n + c0 + 1, n - 1); |
24 | for (int c2 = 1; c2 < -n + c0; c2 += 1) |
25 | S5(-n + c0, n, c2); |
26 | } |
27 | if (c0 >= n + 3 && 2 * n >= c0 + 1) |
28 | S6(-n + c0, n); |
29 | if (c0 >= n + 3) { |
30 | S1(c0 - 1); |
31 | } else { |
32 | if (n + 1 >= c0 && c0 <= 4) { |
33 | S1(c0 - 1); |
34 | } else if (c0 >= 5 && n + 1 >= c0) { |
35 | S1(c0 - 1); |
36 | S6(2, c0 - 2); |
37 | } |
38 | if (n + 1 >= c0) { |
39 | S6(1, c0 - 1); |
40 | } else if (n >= 3) { |
41 | S1(n + 1); |
42 | S6(2, n); |
43 | } |
44 | } |
45 | if (n == 2 && c0 == 4) |
46 | S1(3); |
47 | } else { |
48 | S1(1); |
49 | } |
50 | if (c0 % 2 == 0) |
51 | S3(c0 / 2); |
52 | for (int c1 = max(1, -n + c0); c1 < (c0 + 1) / 2; c1 += 1) |
53 | S2(c0 - c1, c1); |
54 | } |
55 | for (int c0 = max(2 * n + 1, -27 * n + 2); c0 <= n + 29; c0 += 1) |
56 | S1(c0 - 1); |
57 | for (int c0 = n + 30; c0 <= 2 * n; c0 += 1) { |
58 | if (2 * n >= c0 + 1) { |
59 | S4(c0 - c0 / 2 - 1, c0 / 2 + 1); |
60 | if (c0 + 2 >= 2 * n) { |
61 | for (int c2 = 1; c2 < -n + c0; c2 += 1) |
62 | S5(-n + c0, n, c2); |
63 | } else { |
64 | S4(c0 - c0 / 2 - 2, c0 / 2 + 2); |
65 | for (int c2 = 1; c2 < c0 - c0 / 2 - 1; c2 += 1) |
66 | S5(c0 - c0 / 2 - 1, c0 / 2 + 1, c2); |
67 | } |
68 | for (int c1 = -c0 + c0 / 2 + 3; c1 <= n - c0; c1 += 1) { |
69 | S4(-c1, c0 + c1); |
70 | S6(-c1 + 2, c0 + c1 - 2); |
71 | for (int c2 = 1; c2 <= -c1; c2 += 1) |
72 | S5(-c1 + 1, c0 + c1 - 1, c2); |
73 | } |
74 | if (2 * n >= c0 + 3) { |
75 | S6(-n + c0 + 1, n - 1); |
76 | for (int c2 = 1; c2 < -n + c0; c2 += 1) |
77 | S5(-n + c0, n, c2); |
78 | } |
79 | S6(-n + c0, n); |
80 | } |
81 | if (c0 % 2 == 0) |
82 | S3(c0 / 2); |
83 | for (int c1 = -n + c0; c1 < (c0 + 1) / 2; c1 += 1) |
84 | S2(c0 - c1, c1); |
85 | } |
86 | |