Deviding N(1,2,3,..,N) part from numeric list as summation of each values(don't sorted) has highest as possible.

amornsak.nak at gmail.com amornsak.nak at gmail.com
Mon Oct 10 09:38:10 EDT 2016


Deviding N(1,2,3,..,N) part from numeric list as summation of each values(don't sorted) has highest as possible.

The first I'm sorry for my English language.

I have a list is

land = [10,20,30,40,110,50,18,32,5]

and I want to find each values of summation (don't sorted values in list) as It has highest as possible

example.

I want to dividing N=3 part from list as above and divieded each part has highest values that as possible.
*** (don't sorted values in list)

first part has values is = 10, 20, 30, 40
summation = 10+20+30+40 = 100

second part has values is = 110
summation = 110

and third part has values is = 50, 18, 32, 5
summation = 105

that 100, 110 and 105 is highest values as possible in list by dividing N=3 part.

and then If I want to divide N(1,2,3,...,N) part from any more numeric list???

Thank you for python code

(:



More information about the Python-list mailing list