Help me in solving ZOOZ problem

My issue

My solution to the problem is satisfying all the condition set by the question but it is still showing failure to all the test cases for the submit. (There is no error in the program, it is running as instructed by the problem)

My code

#include<iostream>
using namespace std;
int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        string s;
        if (n >= 3) {
            if (n % 2 == 0) {
                s = "1001";
                if (n >= 6) {
                    for (int j = 1; j <= (n - 4) / 2; j ++)
                        s.append("01");
                }
            } else {
                s = "010";
                if (n >= 5) {
                    for (int k = 1; k <= (n - 3) / 2; k ++)
                        s.append("10");
                }
            }
            cout << s << endl;
        }
    }
    return 0;
}

Problem Link: ZOOZ Problem - CodeChef