Tap here to switch tabs
Problem
Submissions

Problem: Categorize Box According to Criteria

med
30 min
Try to solve the Categorize Box According to Criteria problem.

Statement

Given four integers length, width, height, and mass representing the dimensions and mass of a box, categorize the box based on the following criteria:

  • The box is "Bulky" if at least one of the following conditions is met:

    • Any dimension of the box (length, width, or height) is greater than or equal to 10410^4.

    • The volume of the box is greater than or equal to 10910^9.

  • The box is "Heavy" if its mass is greater than or equal to 100100.

Categorize the box according to these rules:

  • If the box is both "Bulky" and "Heavy", return "Both".

  • If the box is neither "Bulky" nor "Heavy", return "Neither".

  • If the box is "Bulky" but not "Heavy", return "Bulky".

  • If the box is "Heavy" but not "Bulky", return "Heavy".

Note: The volume of the box is calculated as $ ext{volume} = ext{length} imes ext{width} imes ext{height}$.

Constraints:

  • 1≤1 \leq length, width, height ≤105\leq 10^5

  • 1≤1 \leq mass ≤103\leq 10^3

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Categorize Box According to Criteria

med
30 min
Try to solve the Categorize Box According to Criteria problem.

Statement

Given four integers length, width, height, and mass representing the dimensions and mass of a box, categorize the box based on the following criteria:

  • The box is "Bulky" if at least one of the following conditions is met:

    • Any dimension of the box (length, width, or height) is greater than or equal to 10410^4.

    • The volume of the box is greater than or equal to 10910^9.

  • The box is "Heavy" if its mass is greater than or equal to 100100.

Categorize the box according to these rules:

  • If the box is both "Bulky" and "Heavy", return "Both".

  • If the box is neither "Bulky" nor "Heavy", return "Neither".

  • If the box is "Bulky" but not "Heavy", return "Bulky".

  • If the box is "Heavy" but not "Bulky", return "Heavy".

Note: The volume of the box is calculated as $ ext{volume} = ext{length} imes ext{width} imes ext{height}$.

Constraints:

  • 1≤1 \leq length, width, height ≤105\leq 10^5

  • 1≤1 \leq mass ≤103\leq 10^3