This page is still under construction.

Parts of this page are still being built. What you see may change.

Half

Interview

Time limit2sMemory limit512 MB

Summary
Starting with n apples and meeting k friends, each friend either takes half an apple or half of the current amount; list every possible final amount.
Level

Medium5 of 10

Topics
Implementation, Brute force, Math, Sorting
Solved
No attempts yet

Problem

Kind-hearted Daniil has several apples. Because of his natural kindness, every time he meets one of his friends, he looks at the apples he has and gives the friend half of them.

Daniil does not like all his friends equally, so to some of them he gives half an apple, and to others he gives half of the apples he has. Daniil's eye for measurement is not as good as his generosity, and he cannot divide apples into more than two parts. Therefore, if he meets a friend and has a non-integer number of apples, he has to give half an apple.

In the morning Daniil had nn apples, and during the day he met kk friends. Find out how many apples he could have left in the evening.

Input

The input file contains two integers: nn, the number of apples Daniil has, and kk, the number of friends he met during the day (1≤n≤10001 \le n \le 1000, 1≤k≤10001 \le k \le 1000).

Output

The first line of the output file must contain the number mm of possible answers to the question of how many apples Daniil can have in the evening. The next line must contain the mm real numbers, sorted in ascending order, that are the possible answers.

Examples1

  1. Example 1

    Input
    6 1
    
    Expected output
    2
    3.0 5.5