hey guys…I am trying to solve CANDY123 and i am getting my test cases correct but it gives me wrong answer when i submit. can anybody tell me what test cases should i try to resolve this problem.
Thanks…
#include<iostream>
#include<sstream>
#include<string>
#include<limits>
using namespace std;
int main()
{
int trials = 0;
cin >> trials;
cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
while(trials--)
{
int A = 0;
int B = 0;
string line;
getline(cin,line);
stringstream s(line);
s >> A >> B;
int l = 0;
int b = 0;
int candy = 1;
int turn = 0;
while(true)
{
if (turn)
{
if(b <= B)
{
b += candy;
turn = 0;
}
else
{
cout<<"Limark"<<endl;
break;
}
}
else
{
if(l <= A)
{
l += candy;
turn = 1;
}
else
{
cout<<"Bob"<<endl;
break;
}
}
candy++;
}
}
}