QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 256 MB Puntuación total: 100

#5626. 某种求和问题

Estadísticas

在本题中,你需要计算正整数的各种累加和。

输入格式

输入的第一行包含一个整数 $P$ ($1 \le P \le 10000$),表示随后数据组的数量。每组数据应被独立且相同地处理。

每组数据由单行输入组成。它包含数据组编号 $K$,后跟一个整数 $N$ ($1 \le N \le 10000$)。

输出格式

对于每组数据,输出一行。该行包含数据组编号 $K$,后跟一个空格,再后跟三个由空格分隔的整数 $S1$、$S2$ 和 $S3$,其中:

$S1 =$ 前 $N$ 个正整数的和。 $S2 =$ 前 $N$ 个奇数的和。 $S3 =$ 前 $N$ 个偶数的和。

样例

样例输入 1

3
1 1
2 10
3 1001

样例输出 1

1 1 1 2
2 55 100 110
3 501501 1002001 1003002

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.