ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Chapter 3. Repetition structures > задача:


13. Round numbers

Задачи сборника

• 05. Factorial
• 06. X to the power of Y
• 07. Fibonacci Series
• 08. Binary to decimal
• 09. Decimal to binary
• 10. Maximum
• 11. Perfect numbers
• 12. Wonder primes
• 13. Round numbers
• 14. Tower of Happiness
• 2. Molecules

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 1000/1000/1000/1000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Problem description

A positive integer N is said to be a "round number" if the binary representation of N has as many or more zeroes as it has ones. For example, the integer 9, when written in binary 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.

Write a program that tells how many round numbers appear in the inclusive range given by the input.

Input

There are two integers A and B (0 ≤ A ≤ B ≤ 1000000).

Output

Number of round numbers in given range.

Example

stdin stdout

2 12

6

Для отправки решений необходимо выполнить вход.

www.contester.ru