On Mon, 7 Sep 2009 16:57:11 -0400, Prolific Coder
<[email protected]> wrote:
> Now for case 2 - 10 20 3 output is given as 7. Can some one explain how
is
> it? I am getting it as 8.
[cut]
> 12 - 2*2*3
> 15 - 3*5
>
> Set 1 - 10, 15, 20
> Set 2  - 12, 18
> Set 3-8 - 11, 13, 14, 16, 17,19

12 share common prime factor - 3, which is >= P, so you should merge their
sets (that is, Set 1 and Set 2 from your output).
That gives you 7 sets.

Regards
Adam


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-codejam" 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/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to