5422: 比赛

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

题目描述

C. 比赛
每次测试的时间限制
2 秒
每个测试的内存限制
256 兆字节
输入
标准输入
输出
标准输出
每年在A市和B市之间的高速公路上举行比赛。今年,万尼亚决定参加比赛,驾驶自己的汽车,这辆车已经存在并拥有自己的高贵名字 - Huff-puffer。
所以,瓦夏在哈夫河豚上离开了 A 市,此外,一开始他就用 α 升汽油填充油箱(α≥10 是万尼亚最喜欢的数字,不一定是整数)。加油站位于高速公路上,间隔100公里,即第一个站距离城市A100公里,第二个站距离城市A200公里,第三个站距离城市A300公里,依此类推。哈夫河豚每 10 公里花费 100 升汽油。
万尼亚每次经过加油站时都会检查油箱。如果留在油箱中的汽油不足以到达下一站,Vanya 会在油箱中加满 α 升汽油。否则,他不会在车站停下来继续开车。
例如,如果 α=43.21,那么汽车将首次在 4 号车站加油,届时将剩下 3.21 升汽油。加油后,汽车将有 46.42 升。然后万尼亚停在 8 号站,最终得到 6.42+43.21=49.63 升。下一站是12号站,9.63+43.21=52.84。下一站是17号车站,依此类推。
你不会相信这一点,但哈夫河豚在比赛中一直处于领先地位!也许是由于意外的雪。也许是由于高速公路沿线安装的摄像机记录了速度限制。也许是因为万尼亚威胁要把赫夫河豚扔掉,除非汽车获胜。不管是什么原因,哈夫河豚正在领先,嫉妒的人和其他参赛者绞尽脑汁,试图想出一种方法来阻止这种愤怒。
一种方法是开采Vanya将停止的下一个加油站。你的任务是计算这将在哪个车站发生并警告万尼亚。您不知道α号,但是,您将获得Vanya停止的车站编号的连续序列。查找下一站所在的车站编号。

输入
第一行包含一个整数 n (1≤n≤1000),表示万尼亚停止的加油站数量。下一行有 n 个空格分隔的整数,表示站点的编号。数字为正数,不超过 106,按递增顺序给出。连续匹配中没有两个数字。保证至少存在一个数字 α≥10,这种连续的停止对应于该数字。
输出
如果答案可以唯一确定,请在第一行打印“唯一”(不带引号)。在第二行中打印下一站的车站编号。如果答案不是唯一的,请在第一行打印“不唯一”。
例子
输入
3
1 2 4

输出
unique
5
输入
2
1 2
输出
not unique
注意
在第二个示例中,答案不是唯一的。例如,如果 α=10,我们将有这样的序列为 1、2、3,如果 α=14,则序列将为 124
C. The Race
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Every year a race takes place on the motorway between cities A and B. This year Vanya decided to take part in the race and drive his own car that has been around and bears its own noble name − The Huff-puffer.
So, Vasya leaves city A on the Huff-puffer, besides, at the very beginning he fills the petrol tank with α liters of petrol (α≥10 is Vanya's favorite number, it is not necessarily integer). Petrol stations are located on the motorway at an interval of 100 kilometers, i.e. the first station is located 100 kilometers away from the city A, the second one is 200 kilometers away from the city A, the third one is 300 kilometers away from the city A and so on. The Huff-puffer spends 10 liters of petrol every 100 kilometers.
Vanya checks the petrol tank every time he passes by a petrol station. If the petrol left in the tank is not enough to get to the next station, Vanya fills the tank with α liters of petrol. Otherwise, he doesn't stop at the station and drives on.
For example, if α=43.21, then the car will be fuelled up for the first time at the station number 4, when there'll be 3.21 petrol liters left. After the fuelling up the car will have 46.42 liters. Then Vanya stops at the station number 8 and ends up with 6.42+43.21=49.63 liters. The next stop is at the station number 12, 9.63+43.21=52.84. The next stop is at the station number 17 and so on.
You won't believe this but the Huff-puffer has been leading in the race! Perhaps it is due to unexpected snow. Perhaps it is due to video cameras that have been installed along the motorway which register speed limit breaking. Perhaps it is due to the fact that Vanya threatened to junk the Huff-puffer unless the car wins. Whatever the reason is, the Huff-puffer is leading, and jealous people together with other contestants wrack their brains trying to think of a way to stop that outrage.
One way to do this is to mine the next petrol station where Vanya will stop. Your task is to calculate at which station this will happen and warn Vanya. You don't know the α number, however, you are given the succession of the numbers of the stations where Vanya has stopped. Find the number of the station where the next stop will be.

Input
The first line contains an integer n (1≤n≤1000) which represents the number of petrol stations where Vanya has stopped. The next line has n space-separated integers which represent the numbers of the stations. The numbers are positive and do not exceed 106, they are given in the increasing order. No two numbers in the succession match. It is guaranteed that there exists at least one number α≥10, to which such a succession of stops corresponds.
Output
Print in the first line "unique" (without quotes) if the answer can be determined uniquely. In the second line print the number of the station where the next stop will take place. If the answer is not unique, print in the first line "not unique".
Examples
Input
3
1 2 4

Output
unique
5
Input
2
1 2
Output
not unique
Note
In the second example the answer is not unique. For example, if α=10, we'll have such a sequence as 1, 2, 3, and if α=14, the sequence will be 1, 2, 4.

输入样例 复制


输出样例 复制