#include <bits/stdc++.h> typedef long long ll; const int maxn = 100010; const int inf = 0x3f3f3f3f; #define P pair<double, double> #define x first #define y second using namespace std; P V[5]; P s[5]; double Cross(P a, P b) { return a.x * b.y - a.y * b.x; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { for (int i = 0; i < 3; i++) cin >> V[i].x >> V[i].y; for (int i = 0; i < 2; i++) s[i] = {V[i + 1].x - V[i].x, V[i + 1].y - V[i].y}; bool z = true; if (Cross(s[0], s[1]) > 0) z = false;
#include <bits/stdc++.h> typedef long long ll; const int maxn = 100010; const int inf = 0x3f3f3f3f; using namespace std; int t, n; void solveji() { for (int k = n - 2; k >= 1; k -= 2) { int a = 4, b = 2; printf("3"); for (int t = 1; t <= 5; t++) { for (int i = 1; i <= k; i++) printf("%d%d", a, b); printf("%d", a); a++, b++; if (a > 6) a = 1; if (b > 6) b = 1; } printf("%d", a); for (int i = 1; i <= k - 1; i++) printf("%d%d", b, a); printf("4"); } printf("\n"); }
void solveou() { for (int k = n - 1; k >= 1; k -= 2) { int a = 4, b = 2; printf("3"); for (int t = 1; t <= 5; t++) { if (t == 5 && k == 1) break; printf("%d", a); for (int i = 1; i <= k - 1; i++) printf("%d%d", b, a); a++, b++; if (a > 6) a = 1; if (b > 6) b = 1; } if (k != 1) { printf("%d", a); for (int i = 1; i <= k - 2; i++) printf("%d%d", b, a); } if (k == 1) printf("3"); else printf("4"); } printf("\n"); }
int main() { scanf("%d", &t); while (t--) { scanf("%d", &n); if (n % 2) solveji(); else solveou(); } return 0; }