AARTDARK - Ascii Art Darkness Calculator

In simple ASCII images a dark pixel is represented as an asterisk * and a bright pixel as a full stop .

The darkness of an ASCII art image is defined as (number of * characters) / (number of characters in total).

Input

The first line of input contains the number of images. Subsequent lines of input contain either an integer defining the size of an "image", or image data.

All images are square, and the size of the image is the length of a side.

Output

For each input image, output the darkness of that image, one per line.

Example

Input:
2 2
..
.*
8
........
........
..*..*..
........
.*....*.
..****..
........
........ Output: 0.25
0.125

Added by:handee
Date:2021-06-18
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All

hide comments
2023-02-15 21:29:44 Simes
0.250 => WA
0.25 => AC
Ridiculous to have to trim trailing zeros when it's not mentioned in the description.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.