fork download
  1. n = [0, 3, 5, 6]
  2. a = n + n.reverse().collect { 15 - it }
  3. b = (0..15).toList() - a
  4. [a, " ", b].each { print it }
  5. println()
  6. (0..3).each { p ->
  7. ai = a.collect { it ** p }.sum()
  8. bi = b.collect { it ** p }.sum()
  9. [ai,bi].each { d -> print "${d}".padLeft(5) }
  10. println()
  11. }
Success #stdin #stdout 1.42s 388800KB
stdin
Standard input is empty
stdout
[0, 3, 5, 6, 9, 10, 12, 15] [1, 2, 4, 7, 8, 11, 13, 14]
    8    8
   60   60
  620  620
 7200 7200