My issue
The input is “4215” and the corresponding output is Chef according to my code but the actual output is Chefina.
My code
// Update the code below to solve the problem
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int a,b,x,y;
cin>>a>>b>>x>>y;
int count = x / a, temp = y / b;
if (count < temp)
{
cout << "Chefina" << endl;
}
else if (count > temp)
{
cout << "Chef" << endl;
}
else
{
cout << "Both" << endl;
}
}
return 0;
}
Learning course: Solve Programming problems using C++
Problem Link: CodeChef: Practical coding for everyone