sort the sums, call them s1, s2, s3,..., satisfy s1 <= s2 <= s3 <=

and set the n integers by a1, a2, a3, satisfy a1 <= a2 <= a3 <=

so we can sure that s1 = a1 + a2, and s2 = a1 + a3, and what is a2 + a3?

only a1 + a4, a1 + a5, ..., a1 + an can less than a2 + a3, so a2 + a3 is one
of s3, s4, ...

enumerate a2 + a3, we can solve a1, a2, a3, so the others...


On 11/7/07, Andrey <[EMAIL PROTECTED]> wrote:
>
>
> Any set of n integers form n(n   1)/2 sums by adding every possible
> pair.
> The task is to find the n integers given the set of sums.
>
> Any ideas?
>
> I've found out the solution but I doubt it the best one...
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
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