#C12220. Task Manager System

    ID: 41624 Type: Default 1000ms 256MiB

Task Manager System

Task Manager System

You are required to implement a task management system. The system manages tasks with the following attributes: title, description, due date (in the format \(YYYY\text{-}MM\text{-}DD\)), priority (an integer), and a completed flag.

The system should support the following commands (each command is given in one line):

  • ADD title description due_date priority: Adds a new task with the given attributes. Each new task gets an auto-incremented ID starting from 1.
  • REMOVE id: Removes the task with the specified id.
  • MODIFY id title description due_date priority: Modifies the corresponding task with the new attributes.
  • MARK_COMPLETED id: Marks the task with the specified id as completed.
  • IS_OVERDUE id current_date: Checks if the task is overdue. A task is considered overdue if its due date is less than the given current_date (in \(YYYY\text{-}MM\text{-}DD\) format) and it has not been marked as completed. Print Yes if overdue, otherwise No.
  • RETRIEVE_DUE: Prints the IDs of all tasks sorted in increasing order of their due dates. (All tasks, regardless of completion status, should be listed.)
  • RETRIEVE_PRIORITY: Prints the IDs of all tasks sorted in increasing order of their priority (if priorities are equal, sort by id in ascending order).
  • GET_PENDING: Prints the IDs of all pending (not completed) tasks sorted by due date in increasing order.

All commands and outputs are read from stdin and written to stdout.

inputFormat

The first line of input contains an integer n representing the number of commands. Each of the following n lines contains one command. The command formats are as described in the problem statement.

outputFormat

For each command that produces output (IS_OVERDUE, RETRIEVE_DUE, RETRIEVE_PRIORITY, and GET_PENDING), print the result on a separate line. For commands that output a list of task IDs, output the IDs separated by a single space.

## sample
10
ADD Task1 Report 2023-10-15 2
ADD Task2 Website 2023-10-10 1
IS_OVERDUE 1 2023-10-20
MARK_COMPLETED 2
MODIFY 1 NewTask NewDesc 2023-10-20 1
RETRIEVE_DUE
RETRIEVE_PRIORITY
GET_PENDING
REMOVE 2
RETRIEVE_DUE
Yes

2 1 1 2 1 1

</p>