Problem Statement | |||||||||||||
You are given a circle of diameter d, with n points equally spaced around the circumference. The points are numbered in order around the circle 0, 1, 2, ... , n-1. Of those n points, c of them are colored red. The points that are colored red are given by the generator function (g * k) % n, for k = 0, 1, 2, ..., c-1. You are given ints d, n, c, and g. You are to return a double indicating the largest area of a quadrilateral formed from four of the colored points. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The % operator is the modulus (remainder) operator. | ||||||||||||
- | Notice that it makes no difference which point is point 0, and in which direction around the circle the points are numbered. | ||||||||||||
Constraints | |||||||||||||
- | d will be between 1 and 1000, inclusive. | ||||||||||||
- | n will be between 4 and 1000000000, inclusive. | ||||||||||||
- | c will be between 4 and 500, inclusive. | ||||||||||||
- | c will be less than or equal to n. | ||||||||||||
- | g will be between 1 and n-1, inclusive, and will be relatively prime to n. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|