#P1152. 欢乐的跳

欢乐的跳

Description

An integer array with nn elements is called a jolly jumper if the absolute differences between each pair of consecutive elements include all integers in [1,n1][1, n-1]. For example, the array {1,4,2,3}\{1,4,2,3\} is a jolly jumper because the absolute differences are 3,2,13, 2, 1.

Given an array, your task is to determine whether it is a jolly jumper.

Input Format

Each test case starts with an integer n(1n1000)n(1 \le n \le 1000), followed by nn space-separated integers in [108,108][-10^8, 10^8].

Output Format

For each test case, output one line. If the array is a jolly jumper, output Jolly; otherwise, output Not jolly.

4 1 4 2 3

Jolly

5 1 4 2 -1 6
Not jolly

Hint

1n10001 \le n \le 1000

Translated by ChatGPT 5