C++ solution
\nint minElements(vector<int>& nums, int limit, int goal) {\n\tlong sum = accumulate(nums.begin(), nums.end(), 0L);\n\treturn ceil((double)abs(goal - sum) / lim
```\nint minElements(vector<int>& nums, int limit, int goal) {\n\tlong sum = accumulate(nums.begin(), nums.end(), 0L);\n\treturn ceil((double)abs(goal - sum) / limit);\n}\n```\n
['C', 'C++']