help.. totally no idea on how to make it...

cire09's Avatar, Join Date: Feb 2010
Light Poster
suppose you are given 100 gold coins labeled w/ numbers 1 through n. Coin n has weight and worth that is sqrroot(n). Given one minute if computation, how close can you come to dividing the 100 coins into piles of 50 coins each of nearly equal weight. The output should be a difference in the weight, followed by a list of the 50 labels of coins on one side of
the scale.

PLS help me...this is the case study that is given to me but i totally suck in memorizing formulas in mathematics.. thats why i dont know how to make this one...
ManzZup's Avatar, Join Date: May 2009
Skilled contributor
you can get two boundaries
assign to array and sort ascending for a start
then take the value at 49 as the boundary line
so you can keep adding the numbers > or < the boundary