A. 分数矩阵

    Type: Default 1000ms 128MiB

分数矩阵

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.

说明

我们定义如下矩阵:
1/1 1/2 1/3
1/2 1/1 1/2
1/3 1/2 1/1
矩阵对角线上的元素始终是1/1,对角线两边分数的分母逐个递增。
请求出这个矩阵的总和。

输入格式

每行给定整数N (N<50000),表示矩阵为 N*N.当N为0时,输入结束。

输出格式

输出答案,保留2位小数。
2
4
0
3.00
8.83

来源

语言入门-基础练习