Question: C++ program Three cats named A, B and C and two mice are standing at some points on a line. Cats A and B are
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 x and cat C is standing at point y. The to mice are hiding at a point 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 point z it catches one of the mice and the other one escapes; cats A and B cateh none. If all cats arrive at the same time, they fight and the two mice escape. You are given a number of test cases in the form of x. I, and z cat catches Find the number of mice each 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 a (cat Output Format Sample Output Cat A: 1 Cat B: 1 Cat C:1 Sample Input 12 3 132 Instructions Write and run a C++ back of this sheet: program to solve the problem using the input data below. Prouide on the (a) the C++ program, and (2) the output. Show your complete code and output on the back page. Demonstration of the program Input data 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
Get step-by-step solutions from verified subject matter experts
