• 沒有找到結果。

Output For each point to be tested, write a message of the form: Point i is contained in figure j for each figure that contains that point

N/A
N/A
Protected

Academic year: 2021

Share "Output For each point to be tested, write a message of the form: Point i is contained in figure j for each figure that contains that point"

Copied!
2
0
0

加載中.... (立即查看全文)

全文

(1)

476 Points in Figures: Rectangles

Given a list of rectangles and a list of points in the x-y plane, determine for each point which figures (if any) contain the point.

Input

There will be n(≤ 10) rectangles descriptions, one per line. The first character will designate the type of figure (“r” for rectangle). This character will be followed by four real values designating the x-y coordinates of the upper left and lower right corners.

The end of the list will be signalled by a line containing an asterisk in column one.

The remaining lines will contain the x-y coordinates, one per line, of the points to be tested. The end of this list will be indicated by a point with coordinates 9999.9 9999.9; these values should not be included in the output.

Points coinciding with a figure border are not considered inside.

Output

For each point to be tested, write a message of the form:

Point i is contained in figure j

for each figure that contains that point. If the point is not contained in any figure, write a message of the form:

Point i is not contained in any figure

Points and figures should be numbered in the order in which they appear in the input.

Note: See the picture on the right for a diagram of these figures and data points.

Sample Input

r 8.5 17.0 25.5 -8.5 r 0.0 10.3 5.5 0.0 r 2.5 12.5 12.5 2.5

*

2.0 2.0 4.7 5.3 6.9 11.2 20.0 20.0 17.6 3.2 -5.2 -7.8 9999.9 9999.9

Sample Output

Point 1 is contained in figure 2 Point 2 is contained in figure 2 Point 2 is contained in figure 3 Point 3 is contained in figure 3

(2)

Universidad de Valladolid OJ: 476 – Points in Figures: Rectangles 2/2

Point 4 is not contained in any figure Point 5 is contained in figure 1

Point 6 is not contained in any figure

參考文獻

相關文件

• Density is varying in the medium and the volume scattering properties at a point is the product of scattering properties at a point is the product of the density at that point

Output : For each test case, output the maximum distance increment caused by the detour-critical edge of the given shortest path in one line.... We use A[i] to denote the ith element

Upon reception of a valid write command (CMD24 or CMD25 in the SD Memory Card protocol), the card will respond with a response token and will wait for a data block to be sent from

EQUIPAMENTO SOCIAL A CARGO DO INSTITUTO DE ACÇÃO SOCIAL, Nº DE UTENTES E PESSOAL SOCIAL SERVICE FACILITIES OF SOCIAL WELFARE BUREAU, NUMBER OF USERS AND STAFF. ᑇؾ N

The best way to picture a vector field is to draw the arrow representing the vector F(x, y) starting at the point (x, y).. Of course, it’s impossible to do this for all points (x,

at each point of estimation, form a linear combination of a preliminary esti- mator evaluated at nearby points with the coefficients specified so that the asymptotic bias

11[] If a and b are fixed numbers, find parametric equations for the curve that consists of all possible positions of the point P in the figure, using the angle (J as the

Now, nearly all of the current flows through wire S since it has a much lower resistance than the light bulb. The light bulb does not glow because the current flowing through it