DCP-209: Sorted array Back to All Problems

Medium Recursion > Basic Recursion


Think of a sorted array of integer X where ith element of X is X[i]= 2^p * 3^q * 5^r * 7^s * 11^t * 13^u where p,q,r,s,t,u>=0 in other word , if you prime factorize any element of X you can get only 2,3,5,7,11 and/or 13 so the array is looks like X={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,21,22,24,……..} you have to calculate the ith element of X Input: ------ First line a positive integer **T<=30000** then T lines contain a non negative integer i Output: ------- You have to print X[i] in a line for each test cases. You can assume **X[i]<=1000000000** Sample input: ------------- 6 0 20 15 100 1000 25000 Sample output: -------------- 1 24 16 216 20800 682628310


Problem Setter:

Md. Tariqul Islam

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

33/44

Solve/Submission

Ranking

# User Language Timing
01 rayhan50001 Cpp14 0.01s
02 feodorv Cpp14 0.01s
03 Morass Cpp14 0.01s
04 wayne6172 C 0.01s
05 Robbinb1993 Cpp 0.02s
06 abdulmukit Cpp 0.02s
07 tariqiitju Cpp 0.02s
08 t0whid Cpp14 0.02s
09 sadia2427 Cpp14 0.02s
10 smriad Cpp14 0.02s
11 haasib Cpp14 0.02s
12 seyedssz Cpp14 0.03s
13 Jobayer__ Cpp14 0.04s
14 FariD Cpp14 0.04s
15 mahmud2690 Cpp14 0.04s
16 twyu0721 Cpp 0.09s
17 CLown1331 Cpp14 0.11s
18 emrul Cpp14 0.11s
19 nazmulpcc Cpp 0.13s
20 sakib_muhit Cpp14 0.17s
21 RandyWaterhouse Python3 0.31s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support