Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Beginner
Here is a problem in my hand that I need so solve it. It sounds like this: Given a number (between 4 and 30000) x, which is the greatest number that can be written as a product of numbers that have the sum x.
 
Example:
For x = 7 the result is 12.
Explanation:
7 = 2 + 2 + 3
and the greatest product is
12 = 2 x 3 x 3
 
I do not want to abridge the path for solving the problem and I do not want complete code for this problem. I only need some directions and documentation about the method that I could use in order to solve it.
Posted 21-Dec-09 6:19am
catcit400
Edited 21-Dec-09 6:20am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

First decide how you will check it manually.
Write it on a piece of paper.
Then start with your program.
 
You could then ask specific questions on that here.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

I suspect the answer is always going to be 2x2x2... for even numbers and 3x2x2x2.... for odd numbers. If that is true, then the problem becomes much easier.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi ,
 
Christian Graus is correct if you go by his way you will get proper solution.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 8,149
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 12 Apr 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100