QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 2048 MB 満点: 100

#8989. 椭圆食

統計

椭圆是一个二维几何图形。它由到两个特定点的距离之和为常数的所有点组成。这两个特定点被称为椭圆的焦点。椭圆的长轴是穿过两个焦点的直径。它是椭圆中最长的直径。

给定椭圆的两个焦点以及长轴的长度,确定能够包围该椭圆的最小轴对齐边界框的坐标。

输入格式

输入包含一行,包含五个整数 $x_1, y_1, x_2, y_2$ ($-100 \le x_1, y_1, x_2, y_2 \le 100$) 和 $a$ ($\sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} \le a \le 1,000$),其中椭圆的两个焦点位于 $(x_1, y_1)$ 和 $(x_2, y_2)$,长轴的长度为 $a$(注意这是长轴长度,而非半长轴或长半径)。

输出格式

在一行中输出四个由空格分隔的实数。这些数字依次为 $x_{low}, y_{low}, x_{high}, y_{high}$,其中 $(x_{low}, y_{low})$ 是椭圆最小边界框的左下角坐标,$(x_{high}, y_{high})$ 是椭圆最小边界框的右上角坐标。如果输出结果与标准答案的绝对误差或相对误差不超过 $10^{-4}$,则视为正确。

样例

样例输入 1

-5 0 5 0 16

样例输出 1

-8.000000 -6.244998 8.000000 6.244998

样例输入 2

51 23 19 67 70

样例输出 2

7.778685 13.871235 62.221315 76.128765

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.