Bookshelf Lili and Bibi has just graduated from highschool. They're now in the same university. As both are bestfriends since kindergarten, they chose to share a dormitory room. Right before the first day of college, they both live in the same room. Lili and Bibi both like to read. Each of them has collections of their favourite books. Of course they brought them there. Each book has descriptions: ID(integer), title(string), and author(string). Lili has N books, while Bibi has M books. They both sorted the books by its ID in ascending order. Sadly, there are only one bookshelf in the dormitory room. They both want to organize their books in one bookshelf, Of course in a sorted ID in ascending order. However, they consider the ID as the first priority of sorting factors, if two books has the same ID, they sort it by its title lexicographically in ascending order. Two books with the same ID may have a different title or author. Lili doesn't have two books with the same ID, neither does Bibi. But they both can have books with the same ID and same title on each of their collections. If they both have books with the same ID and same title, Bibi let Lili to put her book first in the bookshelf. Bibi wants to know in which order for each of her books after their books are organized in the same bookshelf. Format Input There are T testcases. Every testcase consists an integer N. Followed by N lines consist of IDA, TitleA;, and Author A; which describes i-th book ID, i-th book title, and i-th book author respectively from Lili's collection for each line. The next line consists an integer M. Followed by M lines consist of IDB;, TitleB;, and Author B; which describes i-th book ID, i-th book title, and i-th book author respectively from BiBi's collection for each line. Format Output Output T testcases with format "Case #X:" as header, where X indicates the testcase number and then followed by M lines of an integer Rank; for each line where Rank; means in which order Bibi's i-th books in the shelf for each line. Constraints •1
Bookshelf Lili and Bibi has just graduated from highschool. They're now in the same university. As both are bestfriends since kindergarten, they chose to share a dormitory room. Right before the first day of college, they both live in the same room. Lili and Bibi both like to read. Each of them has collections of their favourite books. Of course they brought them there. Each book has descriptions: ID(integer), title(string), and author(string). Lili has N books, while Bibi has M books. They both sorted the books by its ID in ascending order. Sadly, there are only one bookshelf in the dormitory room. They both want to organize their books in one bookshelf, Of course in a sorted ID in ascending order. However, they consider the ID as the first priority of sorting factors, if two books has the same ID, they sort it by its title lexicographically in ascending order. Two books with the same ID may have a different title or author. Lili doesn't have two books with the same ID, neither does Bibi. But they both can have books with the same ID and same title on each of their collections. If they both have books with the same ID and same title, Bibi let Lili to put her book first in the bookshelf. Bibi wants to know in which order for each of her books after their books are organized in the same bookshelf. Format Input There are T testcases. Every testcase consists an integer N. Followed by N lines consist of IDA, TitleA;, and Author A; which describes i-th book ID, i-th book title, and i-th book author respectively from Lili's collection for each line. The next line consists an integer M. Followed by M lines consist of IDB;, TitleB;, and Author B; which describes i-th book ID, i-th book title, and i-th book author respectively from BiBi's collection for each line. Format Output Output T testcases with format "Case #X:" as header, where X indicates the testcase number and then followed by M lines of an integer Rank; for each line where Rank; means in which order Bibi's i-th books in the shelf for each line. Constraints •1
Chapter16: Graphics
Section: Chapter Questions
Problem 2GZ
Related questions
Question
Use C
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT