fork download
  1. def f11236(a)
  2. a.combination(2).select {|(b, c)| b + c == 100}
  3. end
  4. as = [[1, 99, 20], [62, 116, 181, 86, 60, 98, -16, 73, 131, 16, 80, -81, 40], [100, 0, 100, 0]]
  5. puts as.map {|a| "%p\n-> %p" % [a, (f11236 a)]}.join("\n\n")
  6.  
Success #stdin #stdout 0.01s 5860KB
stdin
Standard input is empty
stdout
[1, 99, 20]
-> [[1, 99]]

[62, 116, 181, 86, 60, 98, -16, 73, 131, 16, 80, -81, 40]
-> [[116, -16], [181, -81], [60, 40]]

[100, 0, 100, 0]
-> [[100, 0], [100, 0], [0, 100], [100, 0]]