Phineas goes to school after the lockdown is over and finds out that all his N−1N−1 friends have turned into bullies. So he himself too starts disliking his friends. The teacher Dr Doof wants to distribute MM marks to his NN students (including Phineas). Dr Doof is busy in his experiments and so wants the students to distribute MM marks among themselves such that each student gets a non negative integer marks or gets expelled. So he makes a plan. He makes all of his NN students stand in an line and then the NthNth student is made the leader. The task of the leader is to propose the distribution of MM marks among all the students present. Then a voting is carried out and all present students ( including the leader) can vote either for or against the distribution.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Phineas goes to school after the lockdown is over and finds out that all his N−1N−1 friends have turned into bullies. So he himself too starts disliking his friends. The teacher Dr Doof wants to distribute MM marks to his NN students (including Phineas). Dr Doof is busy in his experiments and so wants the students to distribute MM marks among themselves such that each student gets a non negative integer marks or gets expelled. So he makes a plan.

He makes all of his NN students stand in an line and then the NthNth student is made the leader. The task of the leader is to propose the distribution of MM marks among all the students present. Then a voting is carried out and all present students ( including the leader) can vote either for or against the distribution.

  • If the distribution is voted for by at least 50%50% of the students present, then it is is approved with the leader becoming the deciding student and the process ends.
  • Otherwise the last KK present students are expelled ( including the leader ). and the (N−K)th(N−K)th student is appointed as the new leader and the process is repeated.

If there are ≤K≤K students left and the distribution is not approved, then all the present students will get expelled.

Following are the characteristics of each of the NN students and everyone knows about it.

  • Everyone wants to maximize the marks they get or at least try not to get expelled (i.e. every student prefers getting 00 marks over getting expelled).
  • Each of them have turned into bullies ( including Phineas ) and so given a choice of getting the same marks and expel more students, then they would go for it.
  • If there are multiple distribution proposals maximizing the leader's marks that would be accepted (voted for by atleast 50%50% of the students) then he will propose the lexicographically smallest such distribution.
    ( As an example: If N=6,M=10N=6,M=10 and (0,0,4,1,0,5)(0,0,4,1,0,5), (0,3,0,0,2,5)(0,3,0,0,2,5) and (2,3,0,0,0,5)(2,3,0,0,0,5) are the possible proposals that will be accepted, and 5 is the maximum marks the leader can get, then he'll propose (0,0,4,1,0,5)(0,0,4,1,0,5))
  • Each of them are brilliant logical thinkers.

Phineas is confused and wants your help to know at what position he must stand so that he will be the deciding student if everyone thinks optimally and what maximum marks can he get being at that position.

 

Input:

1

4 1 2

Output:

4 1

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY