Codeforces
CF Step
Youtube Linkedin Discord Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Code: Antimedian Deletion

/**
 *    author:  tourist
 *    created: 28.03.2026 07:44:17
 **/
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        cin >> n;
        vector<int> p(n);
        for (int i = 0; i < n; i++) {
            cin >> p[i];
            --p[i];
        }
        if (n == 1) {
            cout << 1 << '\n';
        } else {
            for (int i = 0; i < n; i++) {
                cout << 2 << " \n"[i == n - 1];
            }
        }
    }
    return 0;
}