Company: Merck Sharp & Dohme

Difficulty: medium

Problem Statement

Ethan is the leader of a team with N members. He has assigned an error score to each member of his team, based on the bugs he has found in that team member's task. Because the error scores have grown to uncomfortably large values, Ethan wants to give the whole team a chance to bring them down. He introduces the following rule. Whenever a team member completes a project successfully: the error score of that member decreases by compP , and the error score of every other team member whose error score is currently greater than zero decreases by othQ . An error score can never become less than zero: every decrease is applied as max(0, score - amount) . Any team member may complete a project, and projects are completed one at a time. Write a program that finds the minimum number of projects the team must complete in total so that the error score of every team member becomes zero. Input Format The first line contains an integer errorScore_size , the number of team members ( N ). The seco

More Merck Sharp & Dohme OA questionsInterview experiences