编程介的小学生 2017-08-22 09:29 采纳率: 20.5%
浏览 764
已采纳

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

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-09-03 14:30
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?