| ||We have chosen a finite set of points in the plane.
You are given their coordinates in the ints x and y:
for each valid i, there is a point with coordinates (x[i],y[i]).
We are interested in triangles with the following properties:
Return the number of such triangles.
Note that the constraints guarantee that there are no degenerate triangles and that the point (0,0) never lies on the boundary of a triangle.
- Each vertex of the triangle is one of our chosen points.
- The point (0,0) lies inside the triangle.
|Method signature:||long count(int x, int y)|
|(be sure your method is public)|
|-||x and y will contain between 3 and 2500 elements, inclusive.|
|-||x and y will contain the same number of elements.|
|-||Each element of x and y will be between -10,000 and 10,000, inclusive.|
|-||No two points will be the same.|
|-||No three points will be collinear.|
|-||No point will be on the origin.|
|-||There will be no two points P and Q such that P, Q, and the origin are collinear.|
|There is exactly one possible triangle. It does contain the origin.|
|There are four possible triangles. Two of them contain the origin. One is the triangle with vertices in (-1,1), (-1,-1), and (2,-1). The other is the triangle with vertices in (-1,-1), (1,2), and (2,-1).|
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2010, TopCoder, Inc. All rights reserved.