测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A1128. [COCI-2007_2008-contest5]#4 JABUKE

编程题 普及+/提高

题目描述

Ante bought a piece of land. The land contains N apple trees, but his piece is triangular and it is not easy for him to determine which apple trees belong to him.
Your program will be given the coordinates of the vertices of the triangle forming Ante's piece, and the coordinates of all apple trees. Determine the area of land belonging to Ante, and the number of trees belonging to him. We consider apple trees on the very border of his piece to belong to him.
The area of a triangle with vertices (xA, yA), (xB, yB) and (xC, yC) is given by the following formula:
2 ( ) ( ) ( ) A B C B C A C A B x y − y + x y − y + x y −

输入格式

The first three lines contain the coordinates of the vertices of the triangle.
The following line contains the integer N (1 ≤ N ≤ 100), the number of apple trees.
Each of the following N lines contains the coordinates of one apple tree.
All coordinates are pairs of positive integers less than 1000, separated by a space.

输出格式

Output the area of land belonging to Ante on the first line, with one digit after the decimal point.
Output the number of tree belonging to Ante on the second line.

输入输出样例

输入 #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
上一题 去做题 下一题