Question: java code as solution to the above mentioned scenario and code should cover all the test cases mentioned in explanation ...please its urgent help m

 java code as solution to the above mentioned scenario and code

java code as solution to the above mentioned scenario and code should cover all the test cases mentioned in explanation ...please its urgent help m out here...

Competition for the best cat is on. The competition consists of several duels. In eech duel both cats are standing on an infinite line facing each other (one-dimensional pleying field). There will be at least 1 cet-unit between the two cats in each duel. All cats take steps in standardized cat units. Rules of the game 1. The older cat always starts and no two cats have the same age. 2 On eny cats turn, it hes to move towards his opponent by 1 or 2 cet units. No cat can go beck, jump over his opponent or shere the same spot 3. The cat that can no longer move on its turn loses. The cet owners trained them well so their pets always meke the most optimel move. Input Read the Input stream from console (standard Input). The first line of the Input contains number of test cases t (ts1000). Each test case consists of 4 integers cat1-agecSPACE> cat1-pos SPACE>cat2-age SPACE cat2-pos. No calculations will exceed the number 2*31-1 Output For each test print '1* if the first cat wins and "0' otherwise. Write the output to console (standard output) with a new line after each output Example Inpur 10 19 5 9 2 5 4 Output Explanation For the first input- catl can move to ether pos 2 or 3. In the next move, regardless of cat1's decision ca12 can block him and win For the secand Input-catl starts and can immediately block cat2 and win. Select a Programming Language: Java-JavaSE 8 Torms Of Service 0 2017 Techiknowledgey Pie Ltd Leave a message Competition for the best cat is on. The competition consists of several duels. In eech duel both cats are standing on an infinite line facing each other (one-dimensional pleying field). There will be at least 1 cet-unit between the two cats in each duel. All cats take steps in standardized cat units. Rules of the game 1. The older cat always starts and no two cats have the same age. 2 On eny cats turn, it hes to move towards his opponent by 1 or 2 cet units. No cat can go beck, jump over his opponent or shere the same spot 3. The cat that can no longer move on its turn loses. The cet owners trained them well so their pets always meke the most optimel move. Input Read the Input stream from console (standard Input). The first line of the Input contains number of test cases t (ts1000). Each test case consists of 4 integers cat1-agecSPACE> cat1-pos SPACE>cat2-age SPACE cat2-pos. No calculations will exceed the number 2*31-1 Output For each test print '1* if the first cat wins and "0' otherwise. Write the output to console (standard output) with a new line after each output Example Inpur 10 19 5 9 2 5 4 Output Explanation For the first input- catl can move to ether pos 2 or 3. In the next move, regardless of cat1's decision ca12 can block him and win For the secand Input-catl starts and can immediately block cat2 and win. Select a Programming Language: Java-JavaSE 8 Torms Of Service 0 2017 Techiknowledgey Pie Ltd Leave a message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!