There are N signal stations on the plane, numbered 1 to N. Station i is at (xi,yi) and broadcasts into a disk centered at that point. The radius and the strength of a broadcast depend on how much power the station receives.
Station i can send Mi different signals, named (i,1) through (i,Mi). Signal (i,j) has radius ri,j and strength si,j, and station i always sends it once the power that reaches the station is at least wi,j. So when station i receives power p, every signal (i,j) with wi,j≤p goes out, and each of those signals covers every point of the closed disk with center (xi,yi) and radius ri,j.
The strength delivered to a point (x,y) is the largest strength among the signals that cover it. If no signal covers the point, the strength there is 0. The government measures how far the signals spread with the value A below.
A=∑ss×(area of the region whose strength is exactly s)
Each day the government picks the power for station i among the integers in [Li,Ui]. Every integer is equally likely, and the stations are chosen independently of each other. Compute the expected value of A.
The first line contains the number of stations N (1≤N≤20).
The descriptions of the N stations follow in order, starting with station 1. The first line of each description contains five integers x, y (−104≤x,y≤104), M (1≤M≤20), L and U (1≤L≤U≤104), separated by spaces. Each of the next M lines contains three integers r, s and w (1≤r,s,w≤104), separated by spaces.
Print the expected value of A on one line, rounded to six digits after the decimal point. Print exactly six digits after the decimal point.
Every input satisfies two guarantees: the expected value is smaller than 106, and it is at least 10−9 away from the boundary where rounding to six decimal digits switches between rounding up and rounding down.