Wrong answer correct output (bear and candies)

I am getting correct output but on submitting codechef says wrong answer,I can’t figure out why.`#include
using namespace std;

int main() {

int t;
cin>>t;
for(int j=0;j<t;j++)
{
int n,m;
int flag=0;
int flags=0;
int a=0;
//int k;
int b=0;
cin>>n>>m;
for(int i=0;i<1000;i++)
{
    
    a=2*i+1+a;
    b=2*i+2+b;
    if(a>n)
    {
        flag=1;
        break;
    }
    if(b>m)
    {
        flags=1;
        break;
    }
}

if(flag==0)
{
    cout<<"LIMAK"<,endl;
}
else if(flags==0) cout<<"BOB"<<endl;

else break;

}
return 0;

}`

Your solution is correct bro… just instead of printing “LIMAK” and “BOB” change it to “Limak” and “Bob”, and you will be good to go…

Here I got AC from same solution after above changes…

Please accept this answer if it was helpful… :slight_smile:

Thnxx dude

1 Like
//