How Many Ones Needed?

To write binary numbers we need only two digits ‘0’ and ‘1’. To write a specific value we need a fixed number of ones, but of course number of zeroes may vary because of leading zeroes. For example to write values between 5 and 10 (inclusive) we need total 12 ones as shown in the figure on the left. You have to write a program that finds total number of ones that are required to write numbers in binary within a given range a and b. Input The input file can contain up to 11000 lines of inputs. Each line contains two positive integers a and b (0 ≤ a ≤ b ≤ 2000000000). Input is terminated by a line containing two zeroes. This line should not be processed. Output For each line of input of input produce one line of output. This line contains the serial of output followed by an integer which denotes the number of 1’s required to write all the values between a and b (inclusive) in binary. Look at the output for sample input for details. Sample Input 5 10 20 30 00 Sample Output Case 1: 12 Case 2: 35