Pro.ID21118 TitleFlipping colors Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21118 AC5 Submit7 Ratio71.43% 时间&空间限制描述A rectangle with sides parallel to the x-y axes and its left-lower corner at (0, 0) is being painted. The rectangle may be thought of as a flat-screen display with almost infinite resolution; initially the entire rectangle is black. Two numbers are given 0 < h, v < 1 and then
Given a point in the original rectangle but not on the boundary of any rectangle that turns up in the process of painting, determine the color of the point. 输入Input contains multiple cases. The first line of each case contains 4 numbers, the length of the rectangle H, the height of the rectangle V and then the numbers h and v. The next line contains one integer number n, the number of points to consider. The following n lines contain two numbers each, the x and the y coordinate of a point. 输出Description A rectangle with sides parallel to the x-y axes and its left-lower corner at (0, 0) is being painted. The rectangle may be thought of as a flat-screen display with almost infinite resolution; initially the entire rectangle is black. Two numbers are given 0 < h, v < 1 and then
Given a point in the original rectangle but not on the boundary of any rectangle that turns up in the process of painting, determine the color of the point. Input Input contains multiple cases. The first line of each case contains 4 numbers, the length of the rectangle H, the height of the rectangle V and then the numbers h and v. The next line contains one integer number n, the number of points to consider. The following n lines contain two numbers each, the x and the y coordinate of a point. Output Organize your output as shown in the sample. For each point from input print the color of the point. Sample Input 81 32 0.333333333333 0.5 Sample Output Case 1: Source 样例输入81 32 0.333333333333 0.5 样例输出Case 1: 作者 |