# your code goes herex x = [1,2,3,4,5] x.sort() k = 3 print("Maximum happiness =", sum(x[k-1:]))
Standard input is empty
Maximum happiness = 12
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!