Question: Sample Output true false true true false true true true false false true true true true false false false false false true true true true

Sample Output
true
false
true true false
true true true
false false true
true true true
false
false
false false false
true true true
true true true
true true true
true
true
true true true
true true true
true true true
false
false
true true true
false true true
false false false
false false false
Graphics:
View Test Case -1
Sample Input:
4
054-36-164522-390-1
27207-3106431867
-240344-2441-2433-2376-245-7-2428-235-4
-238.2-1.4,2.335217-239-3-239-2-2374-233-2-237-5-235-6
373-2096369-207369-207378-206374-214371-205379-214
375-2033373-201372-208374-202379-204374-201376-206
-1073-3113-1078-314-1072-316-1068-316-1070-314-1071-309-1069-312
Input Format:
The first line of input will contain a single integer T, denoting the number of test
cases.
Each test case consists of two lines of input, each line contains 15 values separate
by a space and these two input lines represent the set-1 and set-2 objects.
Output Format:
For each test case, there are six lines of output which described as,
In line-1 print true or false.
In line-2 print true or false.
In line-3 print a boolean array of size 3 separated by space.
In line-4 to 6, print a table of size 3 by 3 adjacent elements are separated by space.
Constraints:
-2000x,y-coordinates of points 2000
0
Programming hints:
The following classes may required:
point
circle
triangle
rectangle
geometry
Input is two copies a point, circle, triangle, rectangle for set-1 and set-2.
A point is defined as P(x,y).
A circle is defined as radius r and center point C(x1,y1).
A triangle is defined as three non collinear points A(x2,y2),B(x3,y3) and C(x4,y4).
A rectangle is defined as two points top left D(x5,y5) and bottom right E(x6,y6).
Note: Assume that rectangle sides are parallel to coordinate axes.
listing them gives: x,y,r,x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6
\table[[set-1\set-2,Circle,Triangle,Rectangle],[Circle,false,false,false],[Triangle,false,true,false],[Rectangle,true,true,true]]
In Detail:
In set-1 shapes, the point lie on only in circle and triangle but not in rectangle.
Answer: false.
In set-2 shapes, the point lie on all the three shapes. Answer: true.
Alike shapes in sets : circle - circle, triangle - triangle, rectangle - rectangle.
circle in set-1 intersecting with circle in set-2 so it is true.
triangle in set-1 not intersecting with set-2 so it is false.
rectangle in set-1 is intersecting with set-2 so it is true.
Hence, final answer is a list of boolean as true false true.
Note: Follow the same order when you code. (Circle, Triangle, Rectangle)
In the following table, set-1 shapes and set-2 shapes are mapped and showing
the answers for question 4.
Display of both sets in one 2D coordinate plane:
Combined:
Set-1:
Set-2:
Individual display of set-1 and set-2 geometrical objects in 2D coordinate
system:
Set-1:
Sample Output true false true true false true

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 Programming Questions!