QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 32 MB مجموع النقاط: 30

#17122. 苹果

الإحصائيات

Ante 买了一块土地。这块土地上有 $N$ 棵苹果树,但由于他的土地是三角形的,他很难确定哪些苹果树属于他。

你的程序将获得组成 Ante 土地的三角形顶点的坐标,以及所有苹果树的坐标。请确定属于 Ante 的土地面积,以及属于他的苹果树数量。我们认为位于土地边界上的苹果树也属于他。

顶点为 $(x_A, y_A)$、$(x_B, y_B)$ 和 $(x_C, y_C)$ 的三角形面积由以下公式给出:

$$\frac{|x_A(y_B - y_C) + x_B(y_C - y_A) + x_C(y_A - y_B)|}{2}$$

输入格式

前三行包含三角形顶点的坐标。

接下来的第一行包含一个整数 $N$ ($1 \le N \le 100$),表示苹果树的数量。

接下来的 $N$ 行,每行包含一棵苹果树的坐标。

所有坐标均为小于 1000 的正整数对,用空格隔开。

输出格式

第一行输出属于 Ante 的土地面积,保留一位小数。

第二行输出属于 Ante 的苹果树数量。

样例

输入样例 1

1 1
5 1
3 3
4
3 1
3 2
3 3
3 4

输出样例 1

4.0
3

输入样例 2

3 2
5 4
1 6
3
2 4
3 5
4 3

输出样例 2

6.0
3

输入样例 3

2 6
5 1
7 8
5
1 4
3 5
6 4
6 5
4 7

输出样例 3

15.5
2

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.