Thai Nguyen province is land planning projects across the province and divide again by regions. Leaders decided to draw a map for easy management. Maps are rectangular size MxN. With symbols:
'#' Is the mountainous area.
'-' is a residential area but no person in.
'*' Is a residential area was inhabited.
The mountain forest land will be divided into separate residential areas. 2 common point called a residential area if it is situated next to each other in the longitudinal direction or transverse direction. Surrounded map is always a mountain forest. Always have a minimum 1 residential area on the map.
Your task is to calculate the average number of people living in residential areas.
– The first line contains the number t – number of tests ( 0 < t < 40)
- Mỗi test tiếp theo sẽ có:
+ Dòng 1 chứa 2 số M và N là kích thước bản đồ hình chữ nhật. ( M, N <= 100)
+ Các dòng tiếp theo mô tả thông tin bản đồ.
– t line, each line is the average number of people living in residential areas. Results rounded to 2 decimal.