Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help ASAP Three cats named A, B and C and two mice are standing at some points on a line. Cats A and B
Please help ASAP
Three cats named A, B and C and two mice are standing at some points on a line. Cats A and B are standing at point and cat C is standing at point y. The two mice are hiding at a point z The cats run at the same speed, and they want to catch one of the two mice. If cats A and B arrive at point z first, each cat catches one mouse. If cat C arrives first at poi it catches one of the mice and the other one escapes; cats A and B catch none. If all eats arrive at the same time, they fight and the two mice escape. nt z, You are given a number of test cases in the form of x, y, and z. Find the number of mice each cat catches Input Format The first line contains a single integer T denoting the number of test cases. A's location), y (cat B's location), and z (location of the two mice) on the line . Each of the subsequent T lines contains three space-separated integers describing x (cat Output Format Sample Input 3 1 2 3 132 213 Sample Output Cat A: 1 Cat B:1 Cat C: 1 Instructions Write and run a C++ program to solve the problem using the input data below. Provide on the back of this sheet: (1) the C++ program, and (2) the output Show your complete code and output on the back page. developed to your instructor before leaving is reg Demonstration of the program Input datoa 22 75 70 33 86 59 47 29 89 18 19 82 84 17 18 84 68 76 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started