#K33372. Organize Books
Organize Books
Organize Books
You are given a list of books, each represented as a single string in the format (\texttt{title;author;year}). Your task is to sort the books primarily by their publication year in ascending order. For books published in the same year, sort them lexicographically by the author's name, and then by the book title if the authors are also identical. Finally, print each sorted book on its own line in the format (\texttt{title - author - year}).
inputFormat
The input is read from stdin. The first line contains an integer (n) representing the number of books. The following (n) lines each contain a book's details in the format: (\texttt{title;author;year}). You can assume that the year is a valid integer.
outputFormat
Print the sorted list of books to stdout. Each book should be printed on a new line in the format: (\texttt{title - author - year}).## sample
3
The Great Gatsby;F. Scott Fitzgerald;1925
To Kill a Mockingbird;Harper Lee;1960
1984;George Orwell;1949
The Great Gatsby - F. Scott Fitzgerald - 1925
1984 - George Orwell - 1949
To Kill a Mockingbird - Harper Lee - 1960
</p>