Canadian Computing Competition: 2022 Stage 1, Senior #4
Andrew is a very curious student who drew a circle with the center at
Andrew drew
A good triplet is defined as a triplet
.- The origin
lies strictly inside the triangle with vertices at , , and . In particular, the origin is not on the triangle's perimeter.
Lastly, two triplets
Andrew, being a curious student, wants to know the number of distinct good triplets. Please help him determine this number.
Input Specification
The first line contains the integers
The second line contains
The following table shows how the available 15 marks are distributed.
Marks Awarded | Number of Points | Circumference | Additional Constraints |
---|---|---|---|
None | |||
None | |||
None |
Output Specification
Output the number of distinct good triplets.
Sample Input
8 10
0 2 5 5 6 9 0 0
Output for Sample Input
6
Explanation of Output for Sample Input
Andrew drew the following diagram.
The origin lies strictly inside the triangle with vertices
Comments
Time complexity of
gives tle on everything but batch 1 btw