21069_Euclid

2022-5-16 18:18| 发布者: Hocassian| 查看: 44| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504802120100-Problem List-采集的数据-后羿采集器.html

Pro.ID

21069

Title

Euclid

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21069

AC

17

Submit

248

Ratio

6.85%

时间&空间限制

  • Time Limit: 1500/500 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    In one of his notebooks, Euclid gave a complex procedure for solving the following problem. With computers, perhaps there is an easier way.
    In a 2D plane, consider a line segment AB, another point C which is not collinear with AB, and a triangle DEF. The goal is to find points G and H such that:
    • H is on the ray AC (it may be closer to A than C or further away, but angle CAB is the same as angle HAB)
    • ABGH is a parallelogram (AB is parallel to GH, AH is parallel to BG)
    • The area of parallelogram ABGH is the same as the area of triangle DEF

    输入

    Input consists of multiple datasets. Each dataset will consist of twelve real numbers, with no more than 3 decimal places each, on a single line. Those numbers will represent the x and y coordinates of points A through F, as follows:
    xA yA xB yB xC yC xD yD xE yE xF yF
    Points A, B and C are guaranteed to not be collinear. Likewise, D, E and F are also guaranteed to be non-collinear. Every number is guaranteed to be in the range from −1000.0 . . . 1000.0 inclusive.
    End of the input will be a line with twelve zero values.

    输出

    Description
    In one of his notebooks, Euclid gave a complex procedure for solving the following problem. With computers, perhaps there is an easier way.
    In a 2D plane, consider a line segment AB, another point C which is not collinear with AB, and a triangle DEF. The goal is to find points G and H such that:
    • H is on the ray AC (it may be closer to A than C or further away, but angle CAB is the same as angle HAB)
    • ABGH is a parallelogram (AB is parallel to GH, AH is parallel to BG)
    • The area of parallelogram ABGH is the same as the area of triangle DEF
    Input
    Input consists of multiple datasets. Each dataset will consist of twelve real numbers, with no more than 3 decimal places each, on a single line. Those numbers will represent the x and y coordinates of points A through F, as follows:
    xA yA xB yB xC yC xD yD xE yE xF yF
    Points A, B and C are guaranteed to not be collinear. Likewise, D, E and F are also guaranteed to be non-collinear. Every number is guaranteed to be in the range from −1000.0 . . . 1000.0 inclusive.
    End of the input will be a line with twelve zero values.
    Output
    For each input set, print a single line with four floating point numbers. These represent points G and H, like this:
    xG yG xH yH
    Print all values to a precision of 3 decimal places. Print a single space between numbers.
    Sample Input
    0 0 5 0 0 5 3 2 7 2 0 4
    1.3 2.6 12.1 4.5 8.1 13.7 2.2 0.1 9.8 6.6 1.9 6.7
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
    Sample Output
    5.000 0.800 0.000 0.800
    13.756 7.204 2.956 5.304
    Source

    样例输入

    0 0 5 0 0 5 3 2 7 2 0 4
    1.3 2.6 12.1 4.5 8.1 13.7 2.2 0.1 9.8 6.6 1.9 6.7
    0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0

    样例输出

    5.000 0.800 0.000 0.800
    13.756 7.204 2.956 5.304

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部