r = [3, 2, 2]rl = range(len(r))ni = [sum(r[j] + 1 for j in rl if j != i) for i in rl]ki = [n*(n - 1) for n in ni]k = sum(ki)print(k)
Standard input is empty
114
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!