The duplication of p1, p2, p3 bugs me.
y.zip(r, q).each { |p1, p2, p3|
puts '%5s %5s | %3s' % [p1, p2, p3]
}
Maybe there is a solution with map? Is there a way to insert the variables directly into the string rather than using this formatting?