Through the doorway

Report a typo

Suppose you want to carry a box with dimensions A × B × C (length × width × height) through the doorway with dimensions X × Y (width × height). Write a program to check whether it is possible. Don't forget you can rotate your box, so you need to check every pair of dimensions!

The input format:
The input comprises five strings with numbers in the following order: A, B, C, X, Y. If the size of the doorway is greater than or equal to any two dimensions of the box, it is considered that the box can be carried.

The output format:
If the box can be carried through the doorway, output "The box can be carried".
If it cannot be carried, output "The box cannot be carried".

Sample Input 1:

24
21
11
36
80

Sample Output 1:

The box can be carried

Sample Input 2:

80
50
80
33
78

Sample Output 2:

The box cannot be carried
Write a program in Python 3





___

Create a free account to access the full topic