#K69127. Role Assignment for Participants
Role Assignment for Participants
Role Assignment for Participants
You are given a single integer n
representing the number of participants in an event. Your task is to assign one of the three roles — volunteer
, organizer
, or guest
— to each participant. The assignment must satisfy the following conditions:
- Each role must be assigned to at least one participant.
- The difference between the number of participants assigned to any two roles must not exceed 1. In other words, if the counts of the three roles are \(a, b, c\), then \(|a - b| \le 1\), \(|b - c| \le 1\), and \(|c - a| \le 1\).
For example, if n = 5
, one valid assignment is:
volunteer organizer guest volunteer organizer
The solution should output the assigned roles in order, separated by a space.
inputFormat
The input consists of an integer n
on a single line from stdin, where n
(\(n \geq 3\)) is the number of participants.
outputFormat
Print a single line to stdout containing n
roles separated by a single space. The output must satisfy the assignment rules stated in the problem description.
3
volunteer organizer guest