Applying min() to set gap

Item-1
Item-2
Item-3
Item-4
Item-5

Applying max() to set gap

Item-1
Item-2

Applying clamp() to set gap

Item-1
Item-2
Item-3
Item-4
Item-5