A
int main() {
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int T,n;
cin>>T;
while(T--) {
int i;
cin>>n;
if(n&1) {
fz1(i,n) {
cout<<i<<" ";
}
}
else {
fz1(i,n) {
cout<<2*i<<" ";
}
}
puts("");
}
return 0;
}
B
int main() {
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int T;
cin>>T;
while(T--) {
int i;
int n,oo,gg=-1;
cin>>n;
fz1(i,n) {
cin>>oo;
oo=abs(oo-i);
if(oo) {
gg=(gg==-1)?oo:__gcd(gg,oo);
}
}
cout<<gg<<endl;
}
return 0;
}
C
const ll Mod=1000000007;
int main() {
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int T;
cin>>T;
while(T--) {
int i;
int n;
cin>>n;
vector<int>a(n),b(n);
fz0k(i,n) {
cin>>a[i];
}
fz0k(i,n) {
cin>>b[i];
}
sort(a.begin(),a.end());
sort(b.begin(),b.end());
ll wwx=1,jyl=0,pos=n-1;
fd0k(i,n) {
while(pos>=0&&a[pos]>b[i]) {
jyl++;
pos--;
}
if(jyl==0) {
wwx=0;
break;
}
wwx=wwx*jyl%Mod;
jyl--;
}
cout<<wwx<<al;
}
return 0;
}
D1
int main() {
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif
int T;
cin>>T;
while(T--) {
int i,j;
int n;
cin>>n;
vector<int>a(n);
fz0k(i,n) {
cin>>a[i];
}
ll wwx=0;
fz0k(i,n) {
auto q=new stack<pii>;
fz(j,i,n-1) {
auto tmp=mp(a[j],j);
while(!q->empty()) {
auto oo=q->top();
if(oo.fi>a[j]) {
tmp.fi=max(tmp.fi,oo.fi);
tmp.se=min(tmp.se,oo.se);
q->pop();
}
else {
break;
}
}
q->push(tmp);
wwx+=j-i+1-((ll)q->size());
}
}
cout<<wwx<<" \n"[T>0];
}
return 0;
}