还是自己智障!
#include<bits/stdc++.h>
using namespace std;
int a[100000+100];
int main(){
int n;
cin>>n;
for(int j=1;j<=n;j++){
a[j]=j;
}
long long s1=0,s2=0;
if(n==2){
cout<<'1'<<endl;
cout<<'1'<<" "<<'1'<<endl;
}
else if(n==3){
cout<<'0'<<endl;
cout<<'2'<<" "<<'1'<<' '<<'2'<<endl;
}
else{
if(n%2==1){
if(n/2%2==0){
cout<<"1"<<endl;
cout<<(n+1)/2<<" ";
cout<<'1'<<' ';
for(int j=2;j<=n/2;j+=2){
cout<<j<<" "<<n-j+2<<" ";
}
}
else{
cout<<"0"<<endl;
cout<<(n+1)/2<<" ";
for(int j=1;j<=n/2;j+=2){
cout<<j<<" "<<n-j<<" ";
}
}
}
else{
if(n/2%2==0){
cout<<"0"<<endl;
cout<<n/2<<" ";
for(int j=1;j<n/2;j+=2){
cout<<a[j]<<" "<<a[n-j+1]<<" ";
}
}
else{
cout<<'1'<<endl;
cout<<n/2<<" ";
for(int j=1;j<n/2;j=j+2){
cout<<a[j]<<" "<<a[n-j+1]<<" ";
}
cout<<n/2<<endl;
}
}
}
return 0;
}