Towhid loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Unfortunately, not all numbers are lucky. Towhid calls a “Divided Lucky Number” if the number is divided by **n, 4 and 7** . For example, if n=3 then “Divided Lucky Number“ are 84 , 252, 444444. Input: ------ Input starts with an integer **T (T≤ 10000)** , denoting the number of test cases. The next line contains an integer **n (1 ≤ n ≤ 10^15)**. Output: ------- For each case, print one line containing **“Divided Lucky Number”** If there are **multiple solutions**, print minimum value of them and value must be grater than zero . Sample Input ------------ 3 11 3 5 Sample Output ------------- 308 84 140

Anowar Hossain Anu

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 | SakibAlamin | Cpp14 | 0.00s |

02 | nafiamahjabin | Cpp14 | 0.00s |

03 | mahbubcseju | Cpp14 | 0.00s |

04 | AresGod | Cpp14 | 0.00s |

05 | prottoy919 | Cpp14 | 0.00s |

06 | Koushik_12 | Cpp14 | 0.00s |

07 | aabb | Cpp14 | 0.00s |

08 | feodorv | Cpp14 | 0.00s |

09 | sonali | Cpp14 | 0.00s |

10 | Nazmul0092 | Cpp14 | 0.00s |

11 | Morass | Cpp14 | 0.00s |

12 | Robbinb1993 | Cpp | 0.00s |

13 | souravahmed | C | 0.00s |

14 | mamun02inf | Cpp | 0.01s |

15 | monir769 | C | 0.01s |

16 | ssavi | Cpp14 | 0.01s |

17 | epmahfuz | Cpp14 | 0.01s |

18 | Mahadi024 | Cpp14 | 0.01s |

19 | pulak_ict_mbstu | Cpp14 | 0.01s |

20 | Monira_Nasrin | Cpp14 | 0.01s |

21 | rifat_06 | Cpp14 | 0.01s |

22 | bafar | Cpp14 | 0.01s |

23 | SKL12 | Cpp14 | 0.01s |

24 | rofi93 | Cpp14 | 0.01s |

25 | reshan13 | Cpp14 | 0.01s |

26 | shihabsarar29 | Cpp14 | 0.01s |

27 | Dragon_Curve | Cpp14 | 0.01s |

28 | sahedsohel | Cpp14 | 0.01s |

29 | Anubis | Cpp14 | 0.01s |

30 | snow_man | Cpp14 | 0.01s |

31 | nasif2587 | Cpp14 | 0.01s |

32 | moshiur_cse15 | Cpp14 | 0.01s |

33 | emrul | Cpp14 | 0.02s |

34 | kzvd4729 | Cpp14 | 0.02s |

35 | jahid_ict | Cpp14 | 0.02s |

36 | nuhu_iu | Cpp14 | 0.02s |

37 | sadiq_nayeem | Cpp14 | 0.02s |

38 | _c_k_r_ | Cpp14 | 0.02s |

39 | motaleb_ICT | Cpp14 | 0.02s |

40 | Nirjhor | Cpp14 | 0.02s |

41 | rayhan50001 | Cpp14 | 0.02s |

42 | shipon0142 | Cpp14 | 0.02s |

43 | Sleep_Mode | Cpp14 | 0.02s |

44 | duronto20 | Cpp14 | 0.02s |

45 | t0whid | Cpp14 | 0.02s |

46 | DynamicOvi | Cpp14 | 0.02s |

47 | Aman_khan | Cpp14 | 0.02s |

48 | bu_hridoy | Cpp14 | 0.02s |

49 | jamil993 | Cpp14 | 0.02s |

50 | lsiddiqsunny | Cpp14 | 0.02s |

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