CABLE - Editorial

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4

Author: pols_agyi_pols
Testers: kingmessi
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

You’re given a cuboid with dimensions A\times B\times C and a cube with side length X.
Which one has higher volume?

EXPLANATION:

The volume of the cuboid is A\cdot B\cdot C units.
The volume of the cube is X^3 = X\cdot X\cdot X units.

Compute both these values, then check which one is higher using an if condition.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
a, b, c, x = map(int, input().split())
v1 = a*b*c
v2 = x*x*x
if v1 == v2: print('Equal')
elif v1 < v2: print('Cube')
else: print('Cuboid')