Question: Three Boxes - Problems | CodeChef
My solution:
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int t;
cin >> t;
while (t--){
int a, b, c, d;
cin >> a >> b >> c >> d;
int sum = (a + b + c);
if (sum <= d)
cout << 1 << "\n";
else if (sum % d == 0)
cout << (int)(sum/d) << "\n";
else
cout << (int)((sum/d) + 1) << "\n";
}
return 0;
}
I have no idea which test case am I missing that is causing my test cases to fail. Any help ?