pku 3705
#include<iostream>
#include<stdio.h>
using namespace std;
void my_fun(int num,int time);
bool is_even(int num);
int main()

{
int num;
int time;
while(cin>>num)
{
if(num == 1)
{
cout<<0<<endl;
}
else if(num == 2)
{
cout<<1<<endl;
cout<<"1 1 1"<<endl;
}
else if(!is_even(num))
{
cout<<(time = (num+1)/2)<<endl;
my_fun(num,time);
cout<<2<<" "<<(num-1)/2<<" "<<num - num/2<<endl;
}
else
{
cout<<(time = (num + 1)/2 +1)<<endl;
my_fun(num - 1,time-1);
cout<<2<<" "<<(num-2)/2<<" "<<num - num/2 <<endl;
cout<<num<<" "<<1<<" "<<0<<endl;
}
}
}
bool is_even(int num)

{
if(num % 2)
return false;
return true;
}
void my_fun(int num,int time)

{
int i;
int n = 0;
for(i = 0; i < time - 1; ++ i)
{
cout<<num/2<<" "<<2<<" ";
cout<<(num -= 2,num + n/2)<<endl;
n += 2;
}
}

