21908_Ellipse,againandagain

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

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

Pro.ID

21908

Title

Ellipse, again and again

Title链接

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

AC

12

Submit

25

Ratio

48.00%

时间&空间限制

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

    There is an ellipse in the plane, its formula is . We denote the focuses by F1 and F2. There is a point P in the plane. Draw a segment to associate the origin and P, which intersect the ellipse at point Q. Then draw a tangent of the ellipse which passes Q. Denote the distance from the center of the ellipse to the tangent by d. Calculate the value of .

    输入

    The first line contains a positive integer n that indicates number of test cases.

    And each test case contains a line with four integers. The value of parameters of the ellipse a, b ( 0 < |a|, |b| ≤ 100 ), and the coordinates x, y of P ( |x| ≤ 100,  |y| ≤ 100 ) are given successively.

    输出

    Description

    There is an ellipse in the plane, its formula is . We denote the focuses by F1 and F2. There is a point P in the plane. Draw a segment to associate the origin and P, which intersect the ellipse at point Q. Then draw a tangent of the ellipse which passes Q. Denote the distance from the center of the ellipse to the tangent by d. Calculate the value of .

    Input

    The first line contains a positive integer n that indicates number of test cases.

    And each test case contains a line with four integers. The value of parameters of the ellipse a, b ( 0 < |a|, |b| ≤ 100 ), and the coordinates x, y of P ( |x| ≤ 100,  |y| ≤ 100 ) are given successively.

    Output

    For each test case, output one line. If the given point P lies inside the given ellipse, print "In ellipse" otherwise print the value of d*d*QF1*QF2 rounded to the nearest integer.

    Sample Input

    1
    1 1 1 1

    Sample Output

    1

    Source

    样例输入

    1
    1 1 1 1

    样例输出

    1

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部