Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.
In the metaphysical world of the Matrix, different people make their chessboards with their own specifications. Sometimes they play multidimensional chess being in multiple positions. For now, let's think that they can choose N x N chessboards and have fun playing chess. While they are having fun, we want to know that if we choose any rectangle from the chessboard, what is the probability that the chosen rectangle is not a square.
The first line of input consists of a single integer T , next T lines contain an integer N , the dimension of the chessboard.
Print the probability of choosing a rectangle that is not a square. Errors less than will be ignored.
Input | Output |
---|---|
1 8 | 0.842593 |
94% Solution Ratio
tanvirtareqEarliest,
S_SubrataFastest, 0.0s
tanvirtareqLightest, 131 kB
anonyo.akandShortest, 123B
Login to submit
The total probability of a sample space is 1. So if the probability of choosing a square is subtract...