Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can You Guess the Guest? Bibi is celebrating her 2 1 st birthday party. She invites you and another 5 friends to join the party.

Can You Guess the Guest?
Bibi is celebrating her 21st birthday party. She invites you and another 5 friends to join
the party. Lucky to you and her friends, you will get a private room to enjoy the party
with Bibi.
Bibi decided to play with her 5 friends (except you) because Bibi wants your help. Her
friends (those five friends) will think of a random number (
Mi). Then, Bibi will give
them some pieces of blank paper.
Firstly, the
i
th person should add his/her chosen number
Mi with
Mi
itself and then write
the result on the blank paper. Then, they should put the paper they wrote before to
Bibis bag. Then, Bibi ask them to shake each others hands. If
i
th person shake hands
with
j
th person, then both of
i
th and
j
th person should write
Mi
+
Mj
in their paper and
put the paper into the bag. This procedure stops when everyone already shakes each
others hands.
After that, Bibi should guess the possible 5 numbers that her friends just think about.You
should help Bibi to determine those 5 numbers. It is guaranteed that the solution exists
and unique.
Format Input
Input consists of one integer
T, number of test case given by Bibi. For each test case,
there is a line with 25 integers
S, the addition result written by her 5 friends (sum of
Mi
and
Mj
for every possible
i and
j).
Format Output
Output should be expressed in format Case #
X: Y1
Y2
Y3
Y4
Y5-
X is the number of the
test case (starting from 1), and followed by 5 integer
Y , the 5 numbers in non-decreasing
sequence.
Constraints 1<= T <=10
4
1
<=
Mi
<=10
7
1
<=
S
<=
2
\times 10
7

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_2

Step: 3

blur-text-image_3

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

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

How many edit and revision sessions do they perform on shorte ?

Answered: 1 week ago

Question

How do they research and outline writing projects?

Answered: 1 week ago