Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mid-Year Gifts Lilis first university quiz is being held very soon. In fact, it is her last week of the semester right now, and she

Mid-Year Gifts

Lilis first university quiz is being held very soon. In fact, it is her last week of the

semester right now, and she is currently panicking because she understood precisely zero

percent of the entire semesters courses. She realizes that she cannot choose to cheat on

her quiz either, since her university has a strict no cheating policy - anyone cheating

will be expelled.

Suddenly, Lili had the bright idea of bribing her lecturers with what she calls mid-year

gifts. Lili has N quiz she needs to take at the end of this semester, and since each

quiz graded by a different lecturer, she needs to prepare N different gifts, one for each

lecturer (lecturers 1 through N).

Lili conveniently knows what each lecturer likes. She has prepared each item, wrapped in

fancy wrapping paper. She has also written the recipient of each gift on a piece of paper

attached to the gift and is ready to send her mid-year gifts to their relevant recipients.

However, since Lili knows she cannot deliver all the items sequentially (or risk being

discovered), she has decided on a very particular order in which she will send the items.

Considering this and the fact that she is not a very bright person (bright people dont

bribe others), she doubts her ability to get the correct gifts delivered to the correct lecturer.

Unfortunately for you, Lili has forcefully roped you into her scheme. You need to ensure

the gifts are delivered to their correct recipients by simulating the process and showing

Lili in sequential order which lecturer will get which gift after the delivery process. From

there, Lili can manually verify whether the recipients are correct.

Format Input

The first line contains a single integer N. The next N lines will contain a string Gi

, a

brief description of each gift, and an integer Ri

, the recipient of the i-th gift.

Format Output

For each of the N lecturers, output Lecturer #i: Gi, where Gi

is a brief description

the item received by the i-th lecturer.

Constraints

1 N 1000

1 |Gi

| 100

1 Ri N

Gi will only contain aplhanumeric characters.

Each lecturer is guaranteed to only receive one item.

Sample Input (standard input)

4

YBox420 3

PlashSpeed5 1

NinjidouSweet 4

PTX3090 2

Sample Output (standard output)

Lecturer #1: PlashSpeed5

Lecturer #2: PTX3090

Lecturer #3: YBox420

Lecturer #4: NinjidouSweet

Note :

Use C Language

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago