Help me in solving PR0BLEM problem

My issue

According to question,this answer(code) is invalid for test case 2,8.Can you elaborate it more clearly.

My code

#include <stdio.h>

int main(void) {
	// your code goes here

	// your code goes here
	int T;
	scanf("%d",&T);
	while(T--)
	{
	  int N, M;
        scanf("%d %d", &N, &M);
        if ((N % 2 == 0 && M % 2 == 0) || (N % 2 == 1 && M % 2 == 1)) 
        {
            printf("YES\n");
        }
        else
        {
            
            printf("NO\n");
        }
    }
	
	return 0;
}




Problem Link: PR0BLEM Problem - CodeChef

@shubham_731
your code is working absolutely fine .
Whats your issue?

My issue is that this code is printing YES for test case 2,8 but 2,8 is not satisfying the condition according to question. ie it should print NO.

2, 8 indeed does satisfy the given condition.

Step 1: Bob solves one problem - 5, 7
Step 2: Alice solves one problem - 4, 8
Step 3: Bob solves one problem - 7, 7

Done!

1 Like

Thank you roumak. I wanted to ask you a question that do you have any group of discussion so that I can join and ask my problems. Any group in WhatsApp or something else. If u have please share with me.

The idea of having a group of discussion is great. But unfortunately, I don’t have any friends who are into competitive programming or even programming in General.

Anyways,

ask my problems

You can always ask doubts in the CodeChef forum, and there are a lot of people here who are always willing to help!

Can u give me ur WhatsApp number so that we can discuss any problems.