Easy Beginners Problems > Ad-hoc

A number is called **Prime Magical Number** if it contains at least one prime digit in its decimal representation. for example: 124, 123 , 256 are Prime Magical Numbers as they contain at least one prime digit in their representation. Whereas 100 , 410, 698 are not Prime Magical Number as there is no prime digit in their representation.<br> You are given an integer **N**. Your task is to count total Prime Magical Number which are less than or equal to **N**.<br> ***Note: {2,3,5,7} are prime digit.*** Input: ------ Input starts with an integer **T (1<=T<=20)**, denoting the number of test cases. Each case contains an integer **N (1 ≤ N ≤ 100000)**. Output: ------- For each case of input, output the count of total **Prime Magical Number** which are less than or equal to **N**. Sample Input ------------ 1 5 Sample Output ------------- 3 ---------- **Sample Explanation:**<br> Prime Magical Number which are less than or equal to 5 are: 2,3,5. So, total = 3.<br>

Bishal Gautam

Language |
Time Limit (seconds) |

C | 1.00 |

C++ | 1.00 |

C++14 | 1.00 |

C# | 2.00 |

Go | 2.00 |

Java | 2.00 |

JavaScript | 2.00 |

Objective-C | 2.00 |

Perl | 2.00 |

PHP | 2.00 |

Python | 2.00 |

Python3 | 2.00 |

Ruby | 2.00 |

VB.Net | 2.00 |

Solve/Submission

# | User | Language | Timing |
---|---|---|---|

01 | Halum | Cpp | 0.00s |

02 | haasib | Cpp | 0.00s |

03 | emrul | Cpp | 0.00s |

04 | tariqiitju | Cpp | 0.00s |

05 | mhiceiu | Cpp | 0.00s |

06 | prodipdatta7 | Cpp14 | 0.00s |

07 | shishir09 | Cpp14 | 0.00s |

08 | Tanmoy | Cpp | 0.00s |

09 | pulak_ict_mbstu | Cpp | 0.00s |

10 | FariD | Cpp14 | 0.00s |

11 | _GhOstMan_ | Cpp | 0.00s |

12 | feodorv | C | 0.00s |

13 | Not_Found0001 | Cpp | 0.00s |

14 | Rajan_sust | Cpp14 | 0.00s |

15 | Bisnu039 | Cpp | 0.00s |

16 | isakib | Cpp | 0.00s |

17 | Morass | Cpp14 | 0.00s |

18 | shuvo_mbstu | Cpp | 0.00s |

19 | tvirussust | Cpp | 0.00s |

20 | nedstark | Cpp | 0.00s |

21 | sitaula | Cpp | 0.00s |

22 | rithu | Cpp | 0.01s |

23 | nasib_mbstu | Cpp | 0.01s |

24 | _dipu | Cpp14 | 0.01s |

25 | anik_JU | Cpp | 0.01s |

26 | miltonbhowmick | Cpp14 | 0.01s |

27 | Sarwar05 | Cpp | 0.01s |

28 | shamimjucse | Cpp | 0.01s |

29 | orpib | Cpp | 0.01s |

30 | t0whid | Cpp | 0.01s |

31 | Pure_Protea | Cpp | 0.01s |

32 | subhashis_cse | Cpp | 0.01s |

33 | Durbin | Cpp14 | 0.02s |

34 | robin_aust | Cpp | 0.02s |

35 | burhan103335 | Cpp | 0.02s |

36 | Mahir101 | Cpp | 0.02s |

37 | NUR_ALAM | Cpp14 | 0.02s |

38 | devcoder | CSharp | 0.02s |

39 | sagarthecoder | Cpp | 0.02s |

40 | sifat1 | Cpp | 0.03s |

41 | atrahman2012 | Cpp | 0.03s |

42 | Rafiqul01 | Cpp14 | 0.03s |

43 | mahade31 | Cpp14 | 0.03s |

44 | asifthegreat | Cpp | 0.03s |

45 | Riaz_BSMRSTU | Cpp | 0.03s |

46 | shahjalalshohag | Cpp | 0.03s |

47 | yuv_sust | Cpp | 0.03s |

48 | s_s_9 | Cpp | 0.03s |

49 | durjoy_talukdar | Cpp | 0.03s |

50 | _c_k_r_ | Cpp | 0.03s |

Copyright © 2015-2016 Dev Skill.

Feedback
#### Your feedback is our precious!

## Thank you for providing feedback! Our developers will be happy :)

## Sorry there was a problem when submitting the feedback. Please try again. :(