#C4123. Categorize Watching Habit
Categorize Watching Habit
Categorize Watching Habit
In this problem, you are given the number of episodes watched, the timestamps (in seconds) when each episode started, and a maximum allowed break time between consecutive episodes to be counted within the same session. Your task is to determine the user's watching habit category based on the average number of episodes per session.
Define a session as a consecutive sequence of episodes such that the difference between starting times of adjacent episodes is at most (t) seconds. If the gap is larger than (t), then a new session starts. Let (S) be the list of session lengths and define the average number of episodes per session as (\text{average} = \frac{\sum S}{|S|}). The categories are determined as follows:
- If (\text{average} \ge 5), the category is Binge-Watcher.
- If (3 \le \text{average} < 5), the category is Regular-Watcher.
- Otherwise, the category is Casual-Watcher.
Note: If no episodes are watched (i.e. (n = 0)), then the category is considered Casual-Watcher.
inputFormat
The input is given via standard input in the following format:
- The first line contains a single integer (n) denoting the number of episodes watched.
- The second line contains (n) space-separated integers representing the timestamps (in seconds) at which each episode started. If (n = 0), this line will be empty.
- The third line contains a single integer (t), the maximum allowed break (in seconds) between episodes to be considered part of the same session.
outputFormat
Output a single line to standard output containing one of the strings: Binge-Watcher, Regular-Watcher, or Casual-Watcher based on the user's watching habit.## sample
10
0 1800 3600 5400 7200 10800 12600 14400 16200 18000
3600
Binge-Watcher