
import random



def subsetsum_optvalue( data, maxWeight ):
    """
    Takes 'data': a list of numbers greater than 0
    and 'maxWeight': maximum possible sum value.
    Should return the maximum value of a subset of numbers from the 
    data list that is less than maxWeight
    """
    return 0



def subsetsum_answer( data, maxWeight ):
    """Takes 'data': a list of numbers greater than 0
    and 'maxWeight': maximum possible sum value.
    Should return a list of the actual subset of numbers that 
    provide an optimal solution to the subset-sum problem
    """
    return []



def generate_data(n, a, b):
    """
    Generates a list of n random strictly positive numbers 
    between a and b, including both end points
    """
    data = []
    for i in xrange(0,n):
	data.append(random.randint(a, b))
    return data



def main():
    data = generate_data(20, 1, 100)
    data.sort()
    W = random.randint(100, 500)
    print "Weight", W, "Data", str(data)
    print "Optimal result", subsetsum_answer( data, W )
    print "Optimal result value", subsetsum_optvalue( data, W )
    print sum(data)


main()
