[Python, Java, C++] Elegant & Short | Math
Complexity
Time complexity: O(1)
Space complexity: O(1)
Code
# Complexity
- Time complexity: $$O(1)$$
- Space complexity: $$O(1)$$

# Code
```python3 []
class Solution:
    def maxContainers(self, n: int, w: int, max_weight: int) -> int:
        return min(n * n, max_weight // w)
```
```Java []
class Solution {
    public int maxContainers(int n, int w, int maxWeight) {
        return Math.min(n * n, maxWeight / w);
    }
}
```
```C++ []
class Solution {
public:
    int maxContainers(int n, int w, int maxWeight) {
        return std::min(n * n, maxWeight / w);
    }
};
```
['Math', 'Python', 'C++', 'Java', 'Python3']