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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 10E: Write a program named DemoJobs for Harolds Home Services. The program should instantiate several Job...
icon
Related questions
Question

Use C Programming Language and Struct

•1<N< 50000
•1< IDA;, IDB, < 10°
•1< [TitleA¡|,|Author A;|, |TitleB|, |Author B;| < 6
Sample Input (standard input)
1 Merry John
з Нарру Рaul
3
2 Quiet Vann
4 Liber Primus
6 Ace Mike
1 Merry John
з Нарру Рaul
3
1 Merry Jhon
з Наару Raul
5 Ace Mike
Sample Output (standard output)
Case #1:
Case #2:
2
3
245
Transcribed Image Text:•1<N< 50000 •1< IDA;, IDB, < 10° •1< [TitleA¡|,|Author A;|, |TitleB|, |Author B;| < 6 Sample Input (standard input) 1 Merry John з Нарру Рaul 3 2 Quiet Vann 4 Liber Primus 6 Ace Mike 1 Merry John з Нарру Рaul 3 1 Merry Jhon з Наару Raul 5 Ace Mike Sample Output (standard output) Case #1: Case #2: 2 3 245
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<T<3
Transcribed Image Text: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<T<3
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT