Water Bottle Buying

Toukir is new in Dhaka and he just arrived today. He got a chance to study at Notre Dame College. Af…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

@touhidurrr
#include

using namespace std;

int main() {
int n , a , b , c , d ;
cin >> n ;
cin >> a >> b >> c;
d=n/2;

if(n%2==0 && d<=5)
cout << d*b;
else if(n%2==0 && d > 5)
cout << (d*b)+c;
else if(n%2!=0 && n > 5)
cout << (n*a)+c;
else if(n%2!=0 && n <= 5)
cout << n*a;

}
every time my answer is being accepted in the first 6 test cases … But on the 7 test case , it is showing wrong answer
i need help about the above description.

How could you say, if n is even and d ≤ 5 then d * b is the minimum price?

Print the minimum among (d * b, d * b + c, n * a + c, n * a)

I understand. Thank you for your feedback