Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _USE_MATH_DEFINES
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <set>
- #include <map>
- #include <algorithm>
- #include <string>
- #include <math.h>
- #include <vector>
- #include <cmath>
- #include <sstream>
- using namespace std;
- int main()
- {
- long long n;
- vector <long long> answ;
- cin >> n;
- while (n > 1)
- {
- answ.push_back(n / 2);
- n -= n / 2;
- }
- cout << answ.size() << endl;
- for (auto i = answ.begin(); i != answ.end(); i++)
- cout << *i << " ";
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment