Advertisement
ShafiulAzim

codeforces 749

Feb 11th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n,i,j,c=0,z,y=0;
  6. cin>>n;
  7. if(n%2!=0)
  8. {
  9. z=n-3;
  10. y=(z/2);
  11. c=y+1;
  12. }
  13. else
  14. {
  15. y=n/2;
  16. c=y;
  17. }
  18.  
  19. cout<<c<<endl;
  20.  
  21. for(i=1; i<=y; i++)
  22. {
  23. cout<<"2"<<' ';
  24. }
  25. if(n%2!=0)
  26. cout<<"3";
  27.  
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement