Gradual spacing with various pattern height - List.Scan & List.Cycle


I am trying to lay out the shapes on zigzag pattern.
The shape ( rectangle in this example) will also change in height.
The distance between shape and next one above will be same.
So the row spacing will be gradual by the height of shape.

I use List.cycle and List.scan for various height and various spacing with constant gap distance.
I transformed the prototype into the layout on the surface.
But, I can’t achieve what I want.
Can you help me what I should to fix to get it?Gradual Vertical Spacing with various height of Rectangle.dyn (1.0 MB)

Thank you.