## 11621 - Small Factors

Moderator: Board moderators

Shafaet_du
Experienced poster
Posts: 147
Joined: Mon Jun 07, 2010 11:43 am
Contact:

### 11621 - Small Factors

Sample inputs:

Code: Select all

``````2147483647
1000000
99999999
324534536
2342323333
1
222222222
444444444
555555555
6345345345
0``````
output:

Code: Select all

``````2147483648
1048576
100663296
339738624
2415919104
1
226492416
452984832
573308928
6442450944
``````
generate the set {2^i*3^j} using two nested loops and search inside it. Use long long or unsigned int for safety.

happy programming

masum93
New poster
Posts: 7
Joined: Wed May 11, 2011 11:15 am

### Re: 11621-Small factors

But your input consists of numbers greater than 2147483648
And a stupid fact, the problem states that the numbers will be of the form 2^i3^j where i,j are in N i.e. they are positive integers, so the first number should be 6 because N is the set of positive integers, but this gives WA.

uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

### Re: 11621-Small factors

Here's some input I found useful during testing / debugging.

Input:

Code: Select all

``````2147483647
1000000
99999999
2
324534536
48223023
847223
1231298
3
94383434
101010032
1000000000
2000000000
54362323
333711
4742
841232
1
0``````
AC Output:

Code: Select all

``````2147483648
1048576
100663296
2
339738624
50331648
884736
1259712
3
95551488
102036672
1019215872
2038431744
56623104
354294
5184
884736
1
``````
Check input and AC output for over 7,500 problems on uDebug!

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

### Re: 11621 - Small Factors

Shafaet_du wrote:generate the set {2^i*3^j} using two nested loops and search inside it. Use long long or unsigned int for safety.

happy programming
This problem is similar to Ugly Numbers (136) and Humble Numbers (443). Set can be generated with one loop using pointers.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman