DCP-257: Divided Lucky Number Back to All Problems

Easy Math > Number Theory


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


Problem Setter:

Anowar Hossain Anu

Please login to submit solution to this problem.

Problem Limits

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

Problem Stats

71/241

Solve/Submission

Ranking

# User Language Timing
01 mahbubcseju Cpp14 0.00s
02 Koushik_12 Cpp14 0.00s
03 Nazmul_WUB Cpp14 0.00s
04 aabb Cpp14 0.00s
05 prottoy919 Cpp14 0.00s
06 nafiamahjabin Cpp14 0.00s
07 feodorv Cpp14 0.00s
08 AresGod Cpp14 0.00s
09 SakibAlamin Cpp14 0.00s
10 sonali Cpp14 0.00s
11 Morass Cpp14 0.00s
12 souravahmed C 0.00s
13 Robbinb1993 Cpp 0.00s
14 mamun02inf Cpp 0.01s
15 rifat_06 Cpp14 0.01s
16 Monira_Nasrin Cpp14 0.01s
17 Mahadi024 Cpp14 0.01s
18 shihabsarar29 Cpp14 0.01s
19 monir769 C 0.01s
20 epmahfuz Cpp14 0.01s
21 bafar Cpp14 0.01s
22 snow_man Cpp14 0.01s
23 moshiur_cse15 Cpp14 0.01s
24 SKL12 Cpp14 0.01s
25 Dragon_Curve Cpp14 0.01s
26 nasif2587 Cpp14 0.01s
27 pulak_ict_mbstu Cpp14 0.01s
28 Anubis Cpp14 0.01s
29 reshan13 Cpp14 0.01s
30 sahedsohel Cpp14 0.01s
31 rofi93 Cpp14 0.01s
32 ssavi Cpp14 0.01s
33 subhashis_cse Cpp14 0.02s
34 Saimum_140128 Cpp14 0.02s
35 shipon0142 Cpp14 0.02s
36 Nirjhor Cpp14 0.02s
37 anowar1112 Cpp14 0.02s
38 nuhu_iu Cpp14 0.02s
39 atikhashmee Cpp14 0.02s
40 t0whid Cpp14 0.02s
41 Arpan_cse_2k14 Cpp14 0.02s
42 jahid_ict Cpp14 0.02s
43 emrul Cpp14 0.02s
44 tariqiitju Cpp 0.02s
45 7Mahfuz Cpp14 0.02s
46 duronto20 Cpp14 0.02s
47 Aman_khan Cpp14 0.02s
48 rayhan50001 Cpp14 0.02s
49 Sleep_Mode Cpp14 0.02s
50 bu_hridoy Cpp14 0.02s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support