camera = [cx, cy] on the plane: it cannot move, but it can turn to face any direction. It sees a sector view_angle degrees wide, and **the edges of the sector are included** in the view.
Targets are marked at targets[i] = [xi, yi]. A target is visible if the direction from the camera to it falls inside the sector. Targets never block one another, and several targets may share a point. A target located exactly at the camera is visible whichever way it faces.
Return the largest number of targets that can be seen at once by choosing the camera's direction.targets=[[5, 2], [2, 5], [0, 2], [2, 0]], view_angle=90, camera=[2, 2] → 2
The targets lie exactly east, north, west and south of the camera. A 90° view fits two neighbouring ones, say east and north (the edges count).
targets=[[3, 3], [6, 6], [3, 3], [4, 7]], view_angle=10, camera=[3, 3] → 3
Two targets sit right at the camera and are always visible. Of the other two, only one fits a 10° view: their directions differ by about 31°.
targets=[[9, 1], [9, 9], [1, 9]], view_angle=0, camera=[1, 1] → 1
With a zero angle only targets on one exact line of sight are visible, and here each target has its own direction.
targets=[[5, 2], [2, 5], [0, 2], [2, 0]], view_angle=90, camera=[2, 2]
2
Run checks the first 3 tests in your browser. Submit checks all 133 tests on the server, hidden ones included.