Type: Default 1000ms 256MiB

随机打乱

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

问以下 C++(伪)代码的结果里,每个数字出现在各个位置上的概率:

for (int i=1;i<=n;i++) a[i]=i;
for (int i=1;i<=n;i++){
    int j=Rand(1,n);
    swap(a[i],a[j]);
}

其中 Rand(l,r) 表示从区间 [l,r][l,r] 中等概率随机一个整数。

Format

Input

读入一个正整数 nn

Output

输出 nn 行。 每行 nn 个数字,第 ii 行的数字表示 11nn 每个数字出现在位置 ii 上的概率。 绝对精度或相对精度误差小于 10610^{-6} 即认为正确。

Samples

5
0.2000000000 0.2419200000 0.2099200000 0.1843200000 0.1638400000 
0.2000000000 0.1804800000 0.2304000000 0.2048000000 0.1843200000 
0.2000000000 0.1856000000 0.1740800000 0.2304000000 0.2099200000 
0.2000000000 0.1920000000 0.1856000000 0.1804800000 0.2419200000 
0.2000000000 0.2000000000 0.2000000000 0.2000000000 0.2000000000

Limitation

对于 50%50\% 的数据,保证 1n1001\le n \le 100

对于 100%100\% 的数据,保证 1n10001\le n \le 1000

8.23普及提高大联欢【Div.1+2】

Not Attended
Status
Done
Rule
OI
Problem
6
Start at
2023-8-23 8:30
End at
2023-8-23 13:00
Duration
4.5 hour(s)
Host
Partic.
18