Help in Coin flip

I have been stuck from 2 days . plzz help me I am getting SIGTSTP
Solution Link
I am gonna to be mad if I cannot solve this problem

Your time comp is O(t * g * n)
See this

Code
while(t--){
    lld g;
    cin>>g;
    while(g--)
    {
        int n,i,q;
        cin>>i>>n>>q;
        if(n%2==0)
        cout<<n/2<<"\n";
        else
        {
            if(q!=i)
            cout<<n/2+1<<"\n";
            else
            cout<<n/2<<"\n";
        }
    }
}

But bro I am getting Runtime error SIGTSTP .I want to know why this error is coming.
BTW THANKS. for your solution to blow up my mind.

In your while loop, you are not changing value of j. So, it is running infinitely and therefore SIGTSTP.

1 Like

Bro I salute It take me 1 day but still clueless .bhot bada thanks to you.

koi baat nhi bro :+1:

I think your are giving IOI as me

Nope, I am in college. Is this for college?

No bro ,its for school students

for college there is acm icpc
bro in which college you are

BIT Mesra, Ranchi

jee rank

9k btw what will you do after knowing all this?

:rofl: :rofl: :rofl: good question

Lel :joy:
Any other ques?

bhai how your long challenge going on

bhai bitsat exam me jo aptitude aati h uska lvl kya hota h

BITS != BIT and about ques I don’t remember

preparation strategy

In which class are you?