On 6/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

If M >= N and M >= K, then the solution is
N * (M/K) + (M - M/K*K) * (N/K)

Use integer division
 
This solution is not corrent.
 
for example, M = N = 4, K = 2
N * (M/K) + (M - M/K*K) * (N/K) = 4 * ( 4 / 2 ) + ( 4 - 4 / 2 * 2 ) * ( 4 / 2 ) = 8
 
But the number of placement is greater than 8
 
1122
3344
5566
7788
 
1322
1344
5566
7788
 
1124
3324
5566
7788
 
1324
1324
5566
7788
...... easy to see that we can get another 4 ways of placement following upper mode
 
But another group of placements is like this:
 
1223
1443
5566
7788

 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to