c++ – You are given real positive numbers a, b, c, d. Find out if a rectangle with sides a, b can be placed inside a rectangle with sides c, d so that

You are given real positive numbers a, b, c, d. Find out if a rectangle with sides a, b can be placed inside a rectangle with sides c, d so that each side of the rectangle is parallel or perpendicular to the sides of the other rectangle.

Answer: With values 2, 3, 4, 3 you can;
3, 2, 4, 2 – no.

can someone explain this algorithm to me?