编程介的小学生 2017-05-08 10:20 采纳率: 20.5%
浏览 942
已采纳

Maps

The well known fixed point theorem states that if you take two maps of the same region that have different scales and put the smaller one atop the larger so that it is located completely within it, there is the point on the plane that represents the same actual point on both maps. Of course, there may be no common point for three or more maps - pairwise fixed points of different maps may be different.

Consider that you are given three rectangular maps M1, M2 and M3 of the same region but with different scales s1 > s2 > s3 (the scale of the map is the ratio of linear sizes of objects on the map to linear sizes of the actual objects, for any given region the larger is the scale of the map, the larger are the linear sizes of the map). Let the smallest map M3 be placed atop the largest one M1 in such a way that it is completely located within it. You have find the way to place the medium map M2, in such a way that the following conditions are satisifed:

M2 is completely located within M1;
M3 is completely located within M2;
there is the point that represents the same actual place on all three maps.

Input

Input contains multiple test cases. The first line of the input is a single integer T (1 <= T <= 50) which is the number of test cases. T test cases follow, each preceded by a single blank line.

The first line of each case contains three real numbers - the scale s1 and the linear sizes x1, y1 of the largest map (1 <= x1, y1 <= 1000). Let the map be placed on the cartesian plane (with OX axis directed rightwards and OY axis directed upwards) in such a way that its corners are in the points with coordinates (0, 0), (x1, 0), (x1, y1) and (0, y1).

The second line of each case contains one real number s2 - the scale of the medium map.

The third line of each case contains nine real numbers - the scale s3 of the smallest map and the coordinates of its four corners, given in counterclockwise order, starting from the corner corresponding to the lower-left one of the largest map. It is guaranteed that the input data is correct, that is, the map is rectangular, linear sizes of the map are all in compliance with its scale and linear sizes of the largest map, and the map is completely within the largest map.

You may also assume that the smallest map has no common points with the border of the largest map (although you may put the medium map in such a way that it has common border points with either of the other maps).

The scales of the maps satisfy 102 >= s1 > s2 > s3 >= 10-2, it is guaranteed that the difference between any two scales is at least 10-2.

Output

For each test case, if it is impossible to find the requested place for the medium map, print "impossible" on a single line. In the other case print eight real numbers - the coordinates of the corners of the second map in counterclockwise order, starting from the corner corresponding to the lower-left one of the largest map. Making calculations with the precision of 10-6 is satisfactory. Do not print blank lines in output.
Sample Input

2

1.0 10.0 5.0
0.3
0.2 3.0 2.5 1.0 2.5 1.0 1.5 3.0 1.5

1.0 1.0 1.0
0.5
0.1 0.11 0.01 0.11 0.11 0.01 0.11 0.01 0.01

Sample Output

3.2500000000 2.7083333333 0.2500000000 2.7083333333 0.2500000000 1.2083333333 3.2500000000 1.2083333333
impossible

  • 写回答

2条回答 默认 最新

查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 matlab数字图像处理频率域滤波
  • ¥15 在abaqus做了二维正交切削模型,给刀具添加了超声振动条件后输出切削力为什么比普通切削增大这么多
  • ¥15 ELGamal和paillier计算效率谁快?
  • ¥15 file converter 转换格式失败 报错 Error marking filters as finished,如何解决?
  • ¥15 ubuntu系统下挂载磁盘上执行./提示权限不够
  • ¥15 Arcgis相交分析无法绘制一个或多个图形
  • ¥15 关于#r语言#的问题:差异分析前数据准备,报错Error in data[, sampleName1] : subscript out of bounds请问怎么解决呀以下是全部代码:
  • ¥15 seatunnel-web使用SQL组件时候后台报错,无法找到表格
  • ¥15 fpga自动售货机数码管(相关搜索:数字时钟)
  • ¥15 用前端向数据库插入数据,通过debug发现数据能走到后端,但是放行之后就会提示错误