Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(){
- int n;
- cin>>n;
- if(n%4==0){
- cout<<0<<'\n';
- cout<<n/2<<' ';
- }
- else if(n%4==1){
- cout<<1<<'\n';
- cout<<n/2+1<<' ';
- }
- else if(n%4==2){
- cout<<1<<'\n';
- cout<<n/2<<' ';
- }
- else if(n%4==3){
- cout<<0<<'\n';
- cout<<n/2<<' ';
- }
- int K=n;
- while(n!=0){
- if((K-n)%4==0 || (K-n)%4==3){
- cout<<n<<' ';
- }
- n--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement