F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Ellipse, again and again

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 742    Accepted Submission(s): 309


Problem 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
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 15:58:51, Gzip enabled