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...
-
Why invest capital in purely competitive industries with equilibrium margins that are razor thin and entrants that erode quasi profits? Suppose volume is not exceptionally large, why then?
-
Refer to Exhibit 14.8 and the accompanying discussion in the text. Demonstrate that the flexiblebudget variance for PVC during October 2019 was $1,680F. SCHMIDT MACHINERY COMPANY Income Statement For...
-
What is the process for starting an appeal?
-
Record the following transactions on the books of Kuist Co. (Omit cost of goods sold entries.) (a) On July 1, Kuist Co. sold merchandise on account to Firer Inc. for $23,000, terms 2/10, n/30. (b) On...
-
1.What factors may have caused Warren Buffet to miss out on the historic coronavirus sell-off?
-
Pecos Company acquired 100 percent of Suaro's outstanding stock for $1,450,000 cash on 1/1/2014, when Suaro had the following balance sheet: Cash - $37,000 Liabilities - ($422,000) Receivables -...
-
Sulfur, S 8 , andoxygen, O 2 , react to form sulfurtrioxide, SO 3 , in the (unbalanced) chemicalreaction below. In a laboratory experiment, you begin with 20.1 gS 8 and 29.6 g O 2 . You produce 43.2...
-
How does postmodernist literature challenge traditional narrative structures, and in what ways does it reflect broader cultural shifts in the late 20th century ?
-
Texas health care provider ordered to pay former employees for mandating prayer and religious discussions by Don Byrd, BJC.com, Mar 29, 2021 A Shepherd, Texas health care clinic has been ordered to...
-
Frank's girlfriend works in a store, and he is going to meet her. When he arrives at the store, he sees his girlfriend at the counter facing a masked man with a gun pointed at her. Frank wants to...
-
Write an appropriate C++ program segment that use any repetition (loop) statements to perform the following steps: Prompt the user to input two integers: num1 and num2 (Assume: num1 must be less than...
-
A printer is publishing multiple copies of a specific document. While printing this document, ink is being used at a rate of r(t) = 0.2(1 + cos(t)),measured in ounces/min. If the printer started the...
-
What amount of money invested today at 2.67% compounded semiannually will have an accumulated value of $468,500 in 8 years from now. Round all answers to two decimal places if necessary.
-
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...
-
The table below lists the patients seen last month at Community Hospital with their age and cholesterol reading. Create a table using common age categories and these ranges for cholesterol. Community...
-
Decide whether the following statements have a positive or negative correlation: 1. Positive correlation 2. Negative correlation a. b. c d. e. People who suffer from depression have higher rates of...
-
1. Indicate whether a table or a graph is the preferred method of presentation in the following situations: a. Distribution by site, sex, race, and time period of all cancers in your healthcare...
Study smarter with the SolutionInn App