bzoj#P2250. Pku3899 The Lucky Numbers
Pku3899 The Lucky Numbers
题目描述
John and Brus are freshmen at the primary school.Their first home task is to learn some integer numbers.It is not so hard for the guys and they decide to impress their teacher by learning all lucky numbers between and .inclusive.
As you already know from the previous year contest and are lucky digits,and all the other digits are not lucky.A lucky number is a number that contains only lucky digits in decimal notation.
After learning all lucky numbers in range John and Brus still have some free time and now they decide to learn additionally each lucky number that is out of range,but the reversed number of is in this range.Here reversed number of is the number written in decimal notation,but the order of digits is reversed.For example,the reversed number of is and reversed number of is .
You are given integers and and your task is to find the total number of lucky numbers learned by John and Brus.
输入格式
本题有多组数据
The first line contains single integer - the number of test cases.Each test case consists of a single line containing two integers and separated by a single space.
输出格式
For each test case print a single line containing the total number of lucky numbers learned by John and Brus.
2
1 100
44 47
6
3
数据规模与约定
的数据满足:,。
题目来源
Seerc2009