### We Are Discuss About CODECHEF SOLUTION

Two Different Palindromes Codechef Solution

## Two Different Palindromes Codechef Solution

## Problem

You are given two positive integers $A$ and $B$. You need to construct two **different** binary strings (i.e, they are strings which consist of only $0$s and $1$s), which satisfy these two conditions:

- Both the strings should be palindromes.
- Each string should have exactly $A$ $0$s, and exactly $B$ $1$s in them.

Output `Yes`

if two such different binary strings can be constructed and `No`

otherwise.

**Note:**

- A string is said to be a palindrome, if the string and the reverse of the string are identical.
- Two strings are said to be different if either their lengths are different, or if they differ in at least one character.

### Input Format

- The first line of input will contain a single integer $T$, denoting the number of test cases.
- Each test case contains two space-separated integers, $A$ and $B$, in a new line.

### Output Format

For each test case, output on a new line ‘Yes’, if you can construct two different binary strings satisfying the conditions. If not, output `No`

.

You may print each character of the string in uppercase or lowercase (for example, the strings `YeS`

, `yes`

, `YES`

, and `YEs`

will all be treated as identical).

### Constraints

- $1≤T≤1_{5}$
- $1≤A,B≤1_{6}$

### Sample 1:

3 2 2 2 3 3 3

Yes Yes No

### Explanation:

**Test case $1$:** Consider the binary strings $0110$ and $1001$. Both of them are palindromes, and both of them have exactly $2$ $0$s, and $2$ $1$s. Hence we can construct them, and so the answer is `Yes`

.

**Test case $2$:** Consider the binary strings $01110$ and $10101$. Both of them are palindromes, and both of them have exactly $2$ $0$s, and $3$ $1$s. Hence we can construct them, and so the answer is `Yes`

.

**Test case $3$:** There is no way to construct two such different strings. Hence the answer is `No`

.

## SOLUTION

## Two Different Palindromes Codechef Solution

Yhaa You have done it but next? if YOU Want to Get Others Please Visit Here **JOIN NOW**