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
I'm a loserLast edit: 2020-11-29 09:15:38
Fine fn ally
No one cares in how many attempts you did :)
1st digit DP AC in one go :)
Easy digit dp problem
Down voted because too ez.
4th digit dp AC in one go
trâu cũng ac
AC in two GO :P
AC in one GO;)