WC '95 P2 - Round Numbers

View as PDF

Submit solution

Points: 12 (partial)
Time limit: 0.6s
Memory limit: 16M

Problem type
Woburn Challenge 1995

A positive integer N is said to be a "round number" if the binary representation of N has as many or more zeroes than ones. For example, the integer 9, when written in binary is form, is 1001. 1001 has two zeroes and two ones: thus 9 is a round number. The integer 26 is 11010 in binary; since it has two zeroes and three ones, it is not a round number.

Input Specification

An integer K (1 \le K < 2^{31}).

Output Specification

Indicate how many positive integers less than or equal to K are "round numbers" in the format shown below.

Sample Input


Sample Output

There are 5 round numbers less than or equal to 10.


There are no comments at the moment.