Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define por(i,a,b) for(i=a;i<b;i++)
- #define sf(R) scanf("%I64d",&R)
- #define pf(R) printf("%I64d",R)
- #define pb(x) push_back(x)
- #define ld long double
- #define mo 1000000007
- #define ll long long
- #define S second
- #define f first
- using namespace std;
- int main(){
- ll n;
- sf(n);
- ll t[n],t2[n];
- ll j=1,i,aux;
- ll c=1;
- if(n%2 ==0){
- por(i,0,n/2){
- t[i]=j;
- t2[i]=1+j;
- j+=2;
- }
- for(i=1;i<(n/2);i+=2){
- aux=t[i];
- t[i]=t2[i];
- t2[i]=aux;
- }
- if(n%4 == 0){
- cout<<"0\n";
- }else cout<<"1\n";
- cout<<n/2<<" ";
- por(i,0,n/2){
- cout<<t[i]<<" ";
- }
- }else {
- j=2;
- por(i,0,n/2){
- t[i]=j;
- t2[i]=1+j;
- j+=2;
- }
- for(i=1;i<(n/2);i+=2){
- aux=t[i];
- t[i]=t2[i];
- t2[i]=aux;
- }
- if((n-1)%4 == 0){
- cout<<"1\n";
- }else cout<<"0\n";
- cout<<n/2<<" ";
- por(i,0,n/2){
- cout<<t2[i]<<" ";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement