|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||1024 MB||1||1||1||100.000%|
The president of Happyland needs to be reelected. She will do so by focusing her last efforts on one of the things the population of Happyland loves the most: children. She knows it is a great problem that children keep running away from the national orphanage, so she decided to rebuild the wall around it so the orphanage will be more secure and the population will be happier.
The area around which the wall must be built consists of the orphanage house, the orphanage gate, and a set of observation towers, left from Happyland’s glory days.
The president of Happyland determined, in a meeting with orphanage specialists, that a safe wall must be a polygon such that:
A possible configuration of object as in Sample input 1. The point H represents the house, the point G is the gate, and all other points are observation towers.
The walls represented above violate one or more rules, so they are not valid walls.
Now the president wants your help to know how many distinct safe walls can be built. Two walls are distinct if and only if there is an observation tower that is a vertex of one wall but not the other.
The walls represented above are all the distinct valid walls for Sample input 1.
The first line contains two integers Xh and Yh, the coordinates of the house. The next line contains two integers Xg and Yg, the coordinates of the gate. The next line contains an integer N (0 ≤ N ≤ 300), the number of observation towers. Each of the next N lines contains two integers Xt and Yt, the coordinates of a tower. All mentioned coordinates (X, Y) are distinct and such that −109 ≤ X, Y ≤ 109.
Output a single line with an integer indicating the number of distinct walls that follow the restrictions. Because this number can be very large, output the remainder of dividing it by 109 + 7.
0 0 -2 -1 5 2 1 0 -4 -1 2 -4 0 0 -2
2 2 2 0 3 -1 2 4 7 2 -2
100 100 -200 -120 0