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