#P16776. [GKS 2020 #H] Boring Numbers
[GKS 2020 #H] Boring Numbers
Problem Description
Ron read a book about boring numbers. According to the book, a positive number is called boring if all of the digits at even positions in the number are even and all of the digits at odd positions are odd. The digits are enumerated from left to right starting from . For example, the number is boring as the odd positions include the digits which are odd and even positions include the digits which are even.
Given two numbers and , Ron wants to count how many numbers in the range ( and inclusive) are boring. Ron is unable to solve the problem, hence he needs your help.
Input Format
The first line of the input gives the number of test cases, . test cases follow. Each test case consists of a single line with two numbers and .
Output Format
For each test case, output one line containing Case #: , where is the test case number (starting from ) and is the count of boring numbers.
3
5 15
120 125
779 783
Case #1: 6
Case #2: 3
Case #3: 2
Hint
In Sample Case , the numbers in the range are out of which are boring, hence the answer is .
In Sample Case , the numbers in the range are out of which are boring, hence the answer is .
In Sample Case , the numbers in the range are out of which are boring, hence the answer is .
Limits
.
Test Set
.
Test Set
.