GONE - G-One Numbers
The War of Evil vs Good continues and Ra-One and G-One continue to be on respective sides.
After saving all the cities with Ra-One Numbers G-One realised that some cities whose population is a "G-One Number" can be easy target for Ra-One.
A G-One number is a number sum of whose digits is a prime number
For eg. 12 .. sum = 1+2 =3 ... 3 is a prime number.
G-One wants to find out all the populations which can be g-One numbers....
Can You help Him.?
You will be given the range of population and you have to tell him how many in this range are G-One Numbers.
first line has number 'c' indicating the number of ranges.
'c' lines follow and contain two numbers ..... 'f' and 't' inclusive.
Print a single line per case giving the number of populations which are G-One numbers.
Note: c will be less than 100
t and f will be less than 10^8 inclusive
AC in one GO;)
very nice problem
One of the best problems I solved.
Both numbers are inclusive.
Gaurav Kumar Verma:
worst case Test Case
@All can any one tell me why i m getting runtime error SIGKILL after runtime(2) ...
just luved it..
nice problm :)deceptive!
Muhammed Hedayetul Islam:
@Ravi Kiron: You can simply check the first sample input to be verified about 1