Shoe Fit solution codechef
You have three shoes of the same size lying around. Each shoe is either a left shoe (represented using) or a right shoe (represented using ). Given , , , representing the information for each shoe, find out whether you can go out now, wearing one left shoe and one right shoe.
- The first line contains an integer , the number of test cases. Then the test cases follow.
- Each test case contains a single line of input, three integers , , .
For each test case, output in a single line the answer:if it’s possible to go out with a pair of shoes and if not.
Sample Input 1
3 0 0 0 0 1 1 1 0 1
Sample Output 1
0 1 1
Test Case: Since there’s no right shoe, it’s not possible to go out with a pair of shoes.
Test Case: It’s possible to go out with a pair of shoes wearing the first and last shoes.
Test Case: It’s possible to go out with a pair of shoes wearing the first and second shoes.