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 | emrul | Cpp | 0.00s |

02 | tvirussust | Cpp | 0.00s |

03 | Rajan_sust | Cpp14 | 0.00s |

04 | prodipdatta7 | Cpp14 | 0.00s |

05 | pulak_ict_mbstu | Cpp | 0.00s |

06 | FariD | Cpp14 | 0.00s |

07 | _GhOstMan_ | Cpp | 0.00s |

08 | Halum | Cpp | 0.00s |

09 | mhiceiu | Cpp | 0.00s |

10 | shuvo_mbstu | Cpp | 0.00s |

11 | isakib | Cpp | 0.00s |

12 | Not_Found0001 | Cpp | 0.00s |

13 | shishir09 | Cpp14 | 0.00s |

14 | nedstark | Cpp | 0.00s |

15 | Tanmoy | Cpp | 0.00s |

16 | feodorv | C | 0.00s |

17 | haasib | Cpp | 0.00s |

18 | tariqiitju | Cpp | 0.00s |

19 | Morass | Cpp14 | 0.00s |

20 | Bisnu039 | Cpp | 0.00s |

21 | sitaula | Cpp | 0.00s |

22 | orpib | Cpp | 0.01s |

23 | subhashis_cse | Cpp | 0.01s |

24 | rithu | Cpp | 0.01s |

25 | miltonbhowmick | Cpp14 | 0.01s |

26 | t0whid | Cpp | 0.01s |

27 | nasib_mbstu | Cpp | 0.01s |

28 | anik_JU | Cpp | 0.01s |

29 | Pure_Protea | Cpp | 0.01s |

30 | _dipu | Cpp14 | 0.01s |

31 | Sarwar05 | Cpp | 0.01s |

32 | shamimjucse | Cpp | 0.01s |

33 | burhan103335 | Cpp | 0.02s |

34 | robin_aust | Cpp | 0.02s |

35 | sagarthecoder | Cpp | 0.02s |

36 | NUR_ALAM | Cpp14 | 0.02s |

37 | Durbin | Cpp14 | 0.02s |

38 | Mahir101 | Cpp | 0.02s |

39 | devcoder | CSharp | 0.02s |

40 | mahmudulhaque | Cpp | 0.03s |

41 | epmahfuz | Cpp | 0.03s |

42 | atrahman2012 | Cpp | 0.03s |

43 | durjoy_talukdar | Cpp | 0.03s |

44 | Sheikh_Fahad | Cpp | 0.03s |

45 | nuhu_iu | Cpp | 0.03s |

46 | DynamicOvi | Cpp | 0.03s |

47 | Mimsad | Cpp | 0.03s |

48 | sifat1 | Cpp | 0.03s |

49 | HR_Habib | Cpp | 0.03s |

50 | yuv_sust | 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. :(