Ethan is the leader of a team with N members. He has assigned an error score...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Ethan is the leader of a team with N members. He has assigned an error score to each member in his team based on the bugs that he has found in that particular team member's task. Because the error score has increased to a significantly large value, he wants to give all the team members a chance to improve their error scores, thereby improving their reputation in the organization. He introduces a new rule that whenever a team member completes a project successfully, the error score of that member decreases by a count P and the error score of all the other team members whose score is greater than zero decreases by a count Q. Write an algorithm to help Ethan find the minimum number of projects that the team must complete in order to make the error score of all the team members zero. Input The first line of the input consists of an integer- errorScore_size, representing the total number of team members (N). The second line consists of N space-separated integers- errorScore, representing the Initial error scores of the team members. The third line consists of an integer- compP, representing the count by which the error score of the team member who completes a project successfully decreases (P). The last line consists of an integer- othQ, representing the count by which the error score of the team member whose error score is greater than zero decreases (Q), Output Print an integer representing the minimum number of projects that the team must complete in order to make the error score of all the team members zero. If no project need to be completed then print 0. Constraints 1 ≤ errorScore_size ≤ 2*105 1 ≤ othQ ≤ compP ≤ 10⁹ 3 0≤ errorScore ≤ 10⁹ Note team member whose error score is greater than zero decreases (Q). Output Print an integer representing the minimum number of projects that the team must complete in order to make the error score of all the team members zero. If no project need to be completed then print 0. Constraints 1 errorScore sizes 2*40 1 ≤ othQ≤ comop ≤ 109 0 errorScores 10² Note The error score of any team member can never be less than zero. Example Input: 3 641 Output: Explanation: Firstly, the first team member completes a project successfully, the updated error score of the team members will be: 2 30. Then, when a second member completes a project successfully, the updated error score of the team members will be: 100. Then, when the first member completes another project successfully, the updated score of the team members will be: 0 0 0. So, the team needs to complete 3 projects to make the error score of all the team members zero. Ethan is the leader of a team with N members. He has assigned an error score to each member in his team based on the bugs that he has found in that particular team member's task. Because the error score has increased to a significantly large value, he wants to give all the team members a chance to improve their error scores, thereby improving their reputation in the organization. He introduces a new rule that whenever a team member completes a project successfully, the error score of that member decreases by a count P and the error score of all the other team members whose score is greater than zero decreases by a count Q. Write an algorithm to help Ethan find the minimum number of projects that the team must complete in order to make the error score of all the team members zero. Input The first line of the input consists of an integer- errorScore_size, representing the total number of team members (N). The second line consists of N space-separated integers- errorScore, representing the Initial error scores of the team members. The third line consists of an integer- compP, representing the count by which the error score of the team member who completes a project successfully decreases (P). The last line consists of an integer- othQ, representing the count by which the error score of the team member whose error score is greater than zero decreases (Q), Output Print an integer representing the minimum number of projects that the team must complete in order to make the error score of all the team members zero. If no project need to be completed then print 0. Constraints 1 ≤ errorScore_size ≤ 2*105 1 ≤ othQ ≤ compP ≤ 10⁹ 3 0≤ errorScore ≤ 10⁹ Note team member whose error score is greater than zero decreases (Q). Output Print an integer representing the minimum number of projects that the team must complete in order to make the error score of all the team members zero. If no project need to be completed then print 0. Constraints 1 errorScore sizes 2*40 1 ≤ othQ≤ comop ≤ 109 0 errorScores 10² Note The error score of any team member can never be less than zero. Example Input: 3 641 Output: Explanation: Firstly, the first team member completes a project successfully, the updated error score of the team members will be: 2 30. Then, when a second member completes a project successfully, the updated error score of the team members will be: 100. Then, when the first member completes another project successfully, the updated score of the team members will be: 0 0 0. So, the team needs to complete 3 projects to make the error score of all the team members zero.
Expert Answer:
Answer rating: 100% (QA)
Here is the solution for the given question Algorithm to solve the given problem 1 Read the input va... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
solve this code in python3 paste with proper intendent blocks by pressing (CTRL+SHIFT+V),Also please provide code screenshot, Thank you. please dont use any built in function. QUESTION: As you are a...
-
In Prob. 5.62 it was difficult to solve for because it appeared in both power and flow coefficients. Rescale the problem, using the data of Fig. P5.61, to make a plot of dimensionless power versus...
-
In this context, kindly write a 2 page report on CSR obstacles faced by the following two companies in Canadian Context: Canadore-Stanford College Canadian Tire
-
After its move in 1990 to La Junta, Colorado, and its new initiatives, the DeBourgh Manufacturing Company began an upward climb of record sales. Suppose the figures shown here are the DeBourgh...
-
During an audit of a companys cash balance on a company with operations in only one country, the auditor is most concerned with which management assertion? a. Existence. b. Rights and Obligations. c....
-
Superior Markets, Inc., operates three stores in a large metropolitan area. A segmented absorption costing income statement for the company for the last quarter is given below: The North Store has...
-
Pick an industry and a product or service. Engage in a creative-thinking process, as outlined in Chapter 11, to generate an improved offering. Do the same to create an entirely new offering that uses...
-
1. Trace the path of the medication list and denote possible failure points. Construct a process flowchart of the existing process and create a new chart of an improved process. 2. Was the medication...
-
Make a Relational Model Table and Define Keys from Entity Relation Diagram Q2: Design the World Music Association Database using given ERD. ORCHESTRA "Orchestra Name City Country Music Director...
-
DeBauge Realtors, Inc., is a realty firm owned by Jeff and Kristi DeBauge. The DeBauge family owns 100% of the corporations stock. The following summarized data (in thousands) are taken from the...
-
Question 1: Suppose that we have a process that produces two types of an item: Blue Item and Orange Item. Both of the items require the same pure sequential operations: 01, 02, 03. 01 and 03 are...
-
What are specific information processing behavior concerns that may breakdown frontier analysis?
-
What is an Early Payment Discount? 2. Why would you create a special term? What report can you run to see if there are any bills with discounts?
-
Can you explain the concept of a bank reconciliation statement in a simplified manner?
-
How do you handle errors or mistakes found during the bank reconciliation process? Explain briefly
-
Icey Industries manufactures air conditioning units. The company is a subsidiary of Icey Group and operates as an investment centre. Icey Group requires a cost of capital of 7 per cent. Extracts from...
-
1. Identify five global/national trends that you consider will impact Houston organizations. Explain. 2. Of the trends identified in #1, select two that will have the most impact in the MDCOB....
-
At the beginning of its fiscal year, Lakeside Inc. leased office space to LTT Corporation under a seven-year operating lease agreement. The contract calls for quarterly rent payments of $25,000 each....
-
One method for measuring the speed of sound uses standing waves. A cylindrical tube is open at both ends, and one end admits sound from a tuning fork. A movable plunger is inserted into the other end...
-
A converging lens (f = 12.0 cm) is held 8.00 cm in front of a newspaper that has a print size with a height of 2.00 mm. Find (a) The image distance (in cm) (b) The height (in mm) of the magnified...
-
The drawing shows a uniform electric field that points in the negative y direction; the magnitude of the field is 3600 N/C. Determine the electric potential difference (a) VB - VA between points A...
-
Database centralization is one of a number of distribution options, but it violates the rule that data should be managed and stored in close proximity to its users. Discuss the reasons why many data...
-
Use the information in the preceding question to create a prototype of the report; use an automated tool such as Microsoft Access (or if you prefer, you can create a prototype the old-fashioned way...
-
What are the common deletion rules to enforce referential integrity?
Study smarter with the SolutionInn App