[NICA #1] 年金现值系数表

Luogu
IDLGB3797
Time1000ms
Memory128MB
DifficultyP1
循环结构
小 A 最近在研究财务事项。 在财务计算中,年金现值系数是一个常用概念。它定义,$\mathrm{PVIFA}(i,n)=\dfrac{[1-(1+i)^{-n}]}{i}$,其中 $i$ 表示每期利率,$n$ 表示年金支付天数。例如,$\mathrm{PVIFA}(5\%,10)=\dfrac{[1-(1+5\%)^{-10}]}{5\%}=7.7217$。你不必在意 $\mathrm{PVIFA}$ 的具体含义。 小 A 希望你能把年金现值系数以表格的形式打印出来,方便他快速查阅。具体而言,你应该输出一张表格,纵轴表示期数,横轴表示每期利率。如下图: ![](https://cdn.luogu.com.cn/upload/image_hosting/65j0yxcc.png) ## Input 输入一行,两个正整数 $n$ 和 $i$,表示表格中需要绘制的行数和列数。 ## Output 输出 $n+1$ 行 $i+1$ 列的图表。规定如下: - 第一行第一列为 `\t`; - 第一行第二列起往后一共 $i$ 个位置,依次输出 $1\%,2\%,\dots,i\%$,以 `\t` 作为分隔符; - 第二行第一列起往下每行的第一列,依次输出 $1,2,\dots n$,与后面的内容以 `\t` 作为分隔符。 - 第二行第二列开始,设当前为第 $a$ 行第 $b$ 列,则只需输出 $\mathrm{PVIFA}((b-1)\%,a - 1)$ 保留四位小数的值,以 `\t` 作为分隔符。 - 每行行末以 `\n` 作为换行符,不应出现多余的 `\t`。 [samples] ## Note 数据保证,$1 \leq n,i \leq 50$。
Samples
Input #1
10 5
Output #1
	1%	2%	3%	4%	5%
1	0.9901	0.9804	0.9709	0.9615	0.9524
2	1.9704	1.9416	1.9135	1.8861	1.8594
3	2.9410	2.8839	2.8286	2.7751	2.7232
4	3.9020	3.8077	3.7171	3.6299	3.5460
5	4.8534	4.7135	4.5797	4.4518	4.3295
6	5.7955	5.6014	5.4172	5.2421	5.0757
7	6.7282	6.4720	6.2303	6.0021	5.7864
8	7.6517	7.3255	7.0197	6.7327	6.4632
9	8.5660	8.1622	7.7861	7.4353	7.1078
10	9.4713	8.9826	8.5302	8.1109	7.7217
API Response (JSON)
{
  "problem": {
    "name": "[NICA #1] 年金现值系数表",
    "description": {
      "content": "小 A 最近在研究财务事项。 在财务计算中,年金现值系数是一个常用概念。它定义,$\\mathrm{PVIFA}(i,n)=\\dfrac{[1-(1+i)^{-n}]}{i}$,其中 $i$ 表示每期利率,$n$ 表示年金支付天数。例如,$\\mathrm{PVIFA}(5\\%,10)=\\dfrac{[1-(1+5\\%)^{-10}]}{5\\%}=7.7217$。你不必在意 $\\mathrm{PVI",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB3797"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "小 A 最近在研究财务事项。\n\n在财务计算中,年金现值系数是一个常用概念。它定义,$\\mathrm{PVIFA}(i,n)=\\dfrac{[1-(1+i)^{-n}]}{i}$,其中 $i$ 表示每期利率,$n$ 表示年金支付天数。例如,$\\mathrm{PVIFA}(5\\%,10)=\\dfrac{[1-(1+5\\%)^{-10}]}{5\\%}=7.7217$。你不必在意 $\\mathrm{PVI...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments