Help me in solving CSC14A problem

My issue

i want code of this in c++

My code

// Update the code below to solve this problem

#include <iostream>
#include <string>
using namespace std;

int main() 
{
 int t;
 cin>>t;
 while(t--)
  {
   int N,M,K;
   cin>>N>>M>>K; 
  
  }
 return 0;
}

Learning course: Solve Programming problems using C++
Problem Link: Review problem - 3 Practice Problem in Solve Programming problems using C++ - CodeChef

Just compare M*K >= N. if it satisfies he can eat bread before expiry. I know python so just gave you the logic

Hello @nandinia604,
Here is the code you can refer it for solving your problem.
Thank You…

include
include
using namespace std;

int main()
{
int T;//no of test case
cin>>T;
while(T–)
{
int N;//no of loaves of bread
int M;//no of days after the bread will expire
int K;//no of loaves of bread eikooc can eat in a day
cin>>N>>M>>K;
if(M*K>=N){
cout<<“Yes”<<endl;
}
else{
cout<<“No”<<endl;
}
}
return 0;
}

2 Likes