-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dust2
55 lines (49 loc) · 1.1 KB
/
Dust2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define MAX 200010
#define MOD 1000000007
#define INF 1e15
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pi 3.14159265358979323846
#define endl "\n"
#define coutflg if(flg){cout << "YES\n";}else{cout << "NO\n";}
#define coutyes cout << "YES\n";
#define coutno cout << "NO\n";
#define flush fflush(stdout);
#define fixedprec cout << fixed << setprecision(18);
void solve(){
ll n;
cin >> n;
if(n==3){
cout << "1 1 3\n";
return;
}
ll c = 1;
while(n){
for(ll i=1;i<=((n+1)/2);i++){
cout << c << " ";
}
n /= 2;
c *= 2;
}
cout << endl;
}
int main(){
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
// freopen("output.txt", "w", stdout);
#endif
fast
ll t,q;
q = 1;
// cin >> q;
for(t=1;t<=q;t++){
// cout << "Case #" << t << ": ";
solve();
}
}