Dealing with lists

hi, I have a hard time to manage how this:
the issue that I have to floor or more and I have them in different “Elevation at Bottom”


I need to calculate the end offset point from each pipe, therefore I made a cross product
but I ended up with to list :

in the end, it set only the first 6 items and that totally wrong. it could work in that way

the main idea how about if I have 5 floors and 100 pipes ?? if we don’t know how many slabs that we have :confused: