cpp
Code


# Code
```cpp []
class Solution {
public:
    int maxContainers(int n, int w, int maxWeight) {
        int ans=0;
        for (int i=0;i<(n*n);i++){
            if ((ans+1)*w>maxWeight) return ans;
            ans++;
        }
        return ans;
    }
};
```
['C++']