Need some help:

Guys My code is running correct on the compiler but when I submit , it shows error.
Please can someone tell me what is wrong . Here is the link and code ----------
https://www.codechef.com/LTIME100B/problems/UNQEQ
/*
*


  • AUTHOR : Ashish Gururani *
  • Language: C++14 *
  • Purpose: - *
  • IDE used: Visual Studio Code. *

Comments will be included in practice problems if it helps ^^
*/
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i, n, k) for (ll i = 0; i < n; i += k)
#define rrep(i, n, k) for (ll i = n; i >= 0; i -= k)
#define rep1(i, n, k) for (ll i = 1; i < n; i += k)
#define vi vector
#define vl vector
#define vs vector
#define vvi vector
#define vvl vector
#define vvs vector
#define mem(a, b) memset(a, b, sizeof(a))
#define fast
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL)
#define pb emplace_back
#define mp make_pair
#define fi first
#define se second
#define nline “\n”
#define tc(t)
long long t;
cin >> t;
while (t–)
#define all(x) (x).begin(), (x).end()

#define dbg(x) cout << #x << " = " << x << endl
#define inf 1e6 + 5
#define mod ll(1e9 + 7)
using namespace std;

template
void print_array(const T &arr, char c = ’ ')
{
for (auto x : arr)
{
cout << x << c;
}
cout << endl;
}

template
void input_array(vector &arr)
{
for (ll i = 0; i < arr.size(); i++)
{
cin >> arr[i];
}
}

vvl adj;
vl vis;
int main()
{
#ifndef ONLINE_JUDGE
freopen(“input.txt”, “r”, stdin);
freopen(“error.txt”, “w”, stderr);
freopen(“output.txt”, “w”, stdout);
#endif
fast;
ll a, b, c, d, e, f, m, n, p, q;
string s, r;

tc(t)
{
    cin >> n;
    vl A, B;
    bool flg = 1;
    for (ll i = 1; i < n + 1; i++)
    {
        if (flg)
        {
            A.pb(i);
            i++;
            B.pb(i);
            flg = 0;
        }else{
            B.pb(i);
            i++;
            A.pb(i);
            flg=1;
        }
    }
    // print_array(A);
    // print_array(B);
    ll sum= accumulate(all(A),0);
    ll sumb=accumulate(all(B), 0);
    // dbg(sum);
    if((n*(n+1))/2==2*sum&&sum==sumb &&(n*(n+1))/2==2*sumb){
        cout<<"YES"<<endl;
        swap(A[A.size()  -1], A[0] );
        print_array(A);
        print_array(B);
    }else {
        cout<<"NO"<<endl;
    }
}
return 0;

}

Kindly, Format your code or simply provide your submission link, That will be easy for community to respond quickly and debug your code. <3

there are two ways to solve this problem
e.g:1 2 3 4 5 6 7 8

First

first 1 2 7 8
second 3 4 5 6

mean select first N/4 elements from first and N/4 elements from rear end in first array and remaining elements in second array.

Second

first 1 8 3 6
second 2 7 4 5

mean select first and last elements in first array(1,8) and after that select next first and last in second array (2,7)and so on…
(use bool to handle it)

solution link:
https://www.codechef.com/viewsolution/51535221

but i did not get any worng test case for my solution could you please help me to find
wrong tc solution link: Solution: 51535221 | CodeChef

if you are using this the prefix sum is going to be same.it will give WA,since it’s mentioned in the question that prefix sum at any point should not be same.hope it helps:)