CF48C.The Race

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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α>=10 is Vanya's favorite number, it is not necessarily integer). Petrol stations are located on the motorway at an interval of 100100 kilometers, i.e. the first station is located 100100 kilometers away from the city A, the second one is 200200 kilometers away from the city A, the third one is 300300 kilometers away from the city A and so on. The Huff-puffer spends 1010 liters of petrol every 100100 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α=43.21 , then the car will be fuelled up for the first time at the station number 44 , when there'll be 3.213.21 petrol liters left. After the fuelling up the car will have 46.4246.42 liters. Then Vanya stops at the station number 88 and ends up with 6.42+43.21=49.636.42+43.21=49.63 liters. The next stop is at the station number 1212 , 9.63+43.21=52.849.63+43.21=52.84 . The next stop is at the station number 1717 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.

输入格式

The first line contains an integer nn ( 1<=n<=10001<=n<=1000 ) which represents the number of petrol stations where Vanya has stopped. The next line has nn space-separated integers which represent the numbers of the stations. The numbers are positive and do not exceed 10610^{6} , 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α>=10 , to which such a succession of stops corresponds.

输出格式

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".

输入输出样例

  • 输入#1

    3
    1 2 4
    

    输出#1

    unique
    5
    
  • 输入#2

    2
    1 2
    

    输出#2

    not unique
    

说明/提示

In the second example the answer is not unique. For example, if α=10α=10 , we'll have such a sequence as 11 , 22 , 33 , and if α=14α=14 , the sequence will be 11 , 22 , 44 .

首页