Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.1 kB
3
Indexable
Never
/*
ID: amarhan2
LANG: C++
TASK: humble
*/
#include<bits/stdc++.h>

using namespace std;
using ll = long long;
void Solve() {
    ll t, i, n, s, ans, j, m;

    cin >> n >> m;
    n *= 2;
    vector < long long > v[m + 2];
    v[0].push_back(n);
    ll r;
    for ( i = 1; i <= m; i ++) {
        long long a[2002] = {0};
        for ( j = 0; j < v[i - 1].size(); j ++) {
            r = v[i - 1][j];
            if ( a[r - 1] == 0 && r - 1 >= 0) {
                a[r - 1] = 1;
                v[i].push_back(r - 1);
            }
            if ( r % 2 == 0 && a[r/2] == 0) {
                a[r/2] = 1;
                v[i].push_back(r/2);
            }
        }
    }
    sort (v[m].begin(), v[m].end());
    cout << v[m].size() << endl;
    for ( i = 0; i < v[m].size(); i ++){
        double d = double(v[m][i])/2;
        printf("%.1f ",d);
    }
    
    
}
int main () {
//    freopen ("humble.in","r",stdin);
//    freopen ("humble.out","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(NULL);

    Solve();
}