atcoder#ABC269C. [ABC269C] Submask
[ABC269C] Submask
Score : points
Problem Statement
You are given a non-negative integer . Print all non-negative integers that satisfy the following condition in ascending order.
- The set of the digit positions containing in the binary representation of is a subset of the set of the digit positions containing in the binary representation of .- That is, the following holds for every non-negative integer : if the digit in the "s" place of is , the digit in the s place of is .
- That is, the following holds for every non-negative integer : if the digit in the "s" place of is , the digit in the s place of is .
Constraints
- is an integer.
- In the binary representation of , at most digit positions contain .
Input
The input is given from Standard Input in the following format:
Output
Print the answer as decimal integers in ascending order, each in its own line.
11
0
1
2
3
8
9
10
11
The binary representation of is . The non-negative integers that satisfy the condition are:
0
0
576461302059761664
0
524288
549755813888
549756338176
576460752303423488
576460752303947776
576461302059237376
576461302059761664
The input may not fit into a -bit signed integer.