#include using namespace std; #define rep(i,n) for(int i=0;i=0;i--) #define rng(i,c,n) for(int i=c;i #define _48SMghu ios::sync_with_stdio(0),cin.tie(0) using ll=long long; using pii=pair; using vi=vector; void print(){cout<<'\n';} template void print(const h&v,const t&...u){cout<>n; int s=n*(n+1)/2; if(s%2){ cout<<"-1\n"; return; } s/=2; vec(vi) dp(n+1,vi(s+1,-1)); dp[0][0]=1; rng(i,1,n+1){ rep(j,s+1){ if(dp[i-1][j]==-1) continue; dp[i][j]=0; int nj=j+i; if(nj<=s) dp[i][nj]=1; } } if(dp[n][s]==-1){ cout<<"-1\n"; return; } vi usd(n); int i=n,j=s; while(i>0){ if(dp[i][j]==1) usd[i-1]=1,j-=i; i-=1; } rep(i,n){ cout<>__t; rep(cs,__t){ slv(); } }