Should I align multiple search boxes horizontally or vertically?

Which UI/Ux is better? horizontally placed search boxes or vertically placed? I am trying to understand which pattern is good in terms of UX/UI and reducing the user's effort

I am thinking in a way that the horizontally aligned search boxes(the upper image)need more effort of eye scanning and entering the details.

The upper image contains the horizontally placed search boxes and the bottom image contains the vertically aligned search boxes