#K9386. Unique Staff Booth Assignment
Unique Staff Booth Assignment
Unique Staff Booth Assignment
You are given a number n representing the number of different booth types and a list of n integers representing the number of staff members required for each booth. Your task is to determine whether it is possible to assign the booths such that the total number of staff members used in each assignment combination is unique.
In other words, if any two booth types have the same staff requirement, the assignment is considered impossible. Otherwise, the assignment is possible.
Note: The input values follow the format described below and the output should be exactly either Possible
or Impossible
.
The underlying mathematical condition can be represented in \( \LaTeX \) as:
[ \text{If } \forall i \neq j,\ s_i \neq s_j \text{ then assignment is \textbf{Possible}}, \text{ otherwise, it is \textbf{Impossible}}. ]
inputFormat
The input is given via standard input (stdin) and has the following format:
- An integer
n
on the first line, which represents the number of different booth types. - A line containing
n
space-separated integers, each representing the number of staff members required for the corresponding booth.
outputFormat
Output a single line to standard output (stdout) containing the string Possible
if the staff requirements are all unique. Otherwise, output Impossible
.
4
1 2 3 4
Possible