Flowerbed
In front of the main building, there's a circular flowerbed containing n round flowers, all fitting completely within it. These flowers vary in height, so their circles might overlap. Before leaving the Summer School, students decided to take some soil from the flowerbed as a keepsake. The administration agreed to this and decided to reduce the flowerbed's radius as much as possible, while keeping its center unchanged, and distribute the leftover soil to those interested. The flowers must still fit entirely within the resized flowerbed.
Input Data
The first line provides three integers x, y, R - the coordinates of the flowerbed's center and its radius. The second line gives the number of flowers n, which is at most 10^5
. Each of the next n lines contains three integers x[i]
, y[i]
, R[i]
- the coordinates of the center and the radius of the i-th flower. All coordinates and radii are within 1000 in absolute value, and all radii are positive. It is guaranteed that all flowers fit inside the flowerbed.
Output Data
Output a single real number with a precision of five decimal places, representing the new radius of the flowerbed.