Gerard the handyman

Gerard the handyman is a resourceful fellow. He loves to tinker with and
repair his bike. Unfortunately, he has lost one of his precious tools:
his ruler.

To compensate, he takes a bar of length 6 cm and marks two points on it,
at 1 cm and 4 cm. With these marks, he can now measure any integer
length from 1 to 6. Moreover, each measurement can be made in exactly
one way:

Given a bar of length n and k marked points given in increasing order,
please determine whether it is possible to measure all lengths from 1 to
n. Additionally, determine whether each measurable length can be
obtained in a unique way or in multiple ways.

Input

Input consists of several cases, each one with n and k, followed by the
positions p_(i) of the points. Assume 2 ≤ n ≤ 1000, 1 ≤ k < n, and
1 ≤ p₁ < p₂ < … < p_(k) < n.

Output

For every case, print “YES” or “NO” followed by “unique” or “multiple”,
depending on the answer.

Problem information

Author: Joan Alemany

Generation: 2026-01-25T11:06:06.427Z

© Jutge.org, 2006–2026.
https://jutge.org
