8542: Array

内存限制:256 MB 时间限制:2 S 标准输入输出
题目类型:传统 评测方式:Special Judge 上传者:
提交:1 通过:0

题目描述

Ranran has a sequence a of n integers a1,a2,⋯,an which satisfies  and he is very proud of it, so he comes up with a problem for you.

You need to find out a sequence c of m integers c0,c1,⋯,cm−1. With c, you construct an infinite sequence b, and bi equals to ci mod m. b must satisfy the condition that in every consecutive ai numbers of b there exists a number equals to i.

Please note that a is 1-indexed and b, c are 0-indexed. The value of m is decided by you.


Can you solve the problem?

输入格式

输出格式

输入样例 复制

1
2

输出样例 复制

2
1 1

分类标签