Mock DWITE '09 P1 - Super Special Awesome Numbers =D

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 25.0s
Memory limit: 256M

Problem types
2009 Mock DWITE by A.J.: Problem 1

A 'super' number is a number whose digital sum (i.e., the sum of its digits) is even!
A 'special' number is a number with strictly increasing digits!
An 'awesome' number is a number that is not divisible by any perfect square other than 1!

Given a range, determine how many Super Special Awesome numbers lie within it.

Input Specification

The input will contain five lines. Each line will contain two integers L and U (1 \le L \le U \le 1\,000\,000).

Output Specification

For each line given in input, in the order given, output one line containing a single integer: the number of Super Special Awesome numbers between L and U (inclusive).

Sample Input

2 10
30 300
6666 66666
12345 67890
100000 1000000

Sample Output

2
23
51
50
32

Comments

There are no comments at the moment.