Count, Count & Keep Counting
Given two non-negative integers 'x' and 'y', you need to count the total number of set bits in the binary representation of all the integers between 'x' and 'y' (both inclusive).
The input file can contain upto 3000 lines. Each line contains two integers 'x' and 'y'. Input is terminated by a line containing two zeros. This line should not be processed.
Each line of input should produce one line of output of the form 'Case A: B' (quotes for clarity) where A is the serial of output and B denotes the total number of set bits.
0 <= x <= y <= 2000000000
Case 1: 12
Case 2: 35
For the first test case, 5 to 10 can be represented as 101, 110, 111, 1000, 1001, 1010.So the total number of set bits = 2+2+3+1+2+2 = 12.