Tap here to switch tabs
Problem
Submissions

Problem: Maximum Containers on a Ship

med
30 min
Try to solve the Maximum Containers on a Ship problem.

Statement

You are given three integers n, w, and maxWeight.

A cargo ship has a square deck of size n $ imes$ n, where each cell can hold at most 11 container. Each container has a weight of w, and the ship can carry a total weight of at most maxWeight.

Return the maximum number of containers that can be loaded onto the ship.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000

  • 1≤1 \leq w ≤1000\leq 1000

  • 1≤1 \leq maxWeight ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Containers on a Ship

med
30 min
Try to solve the Maximum Containers on a Ship problem.

Statement

You are given three integers n, w, and maxWeight.

A cargo ship has a square deck of size n $ imes$ n, where each cell can hold at most 11 container. Each container has a weight of w, and the ship can carry a total weight of at most maxWeight.

Return the maximum number of containers that can be loaded onto the ship.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000

  • 1≤1 \leq w ≤1000\leq 1000

  • 1≤1 \leq maxWeight ≤109\leq 10^9