Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are N employees already working for a company and M new candidates eligible for the work. At the end of the financial year,

There are N employees already working for a company and M new candidates eligible for the work. At the end of the financial yOutput Format: Output a single integer denoting total number of employees working for the company after this process. Input C

There are N employees already working for a company and M new candidates eligible for the work. At the end of the financial year, each of the N employees demand for an increment. You are provided with the data of current_salary and the salary he/she expects. Also, there are M candidates we can recruit. We have the data of salary demanded by each eligible candidate. The company can spend maximum of X units of money. Now you have to decide whether we should give increment to the existing employee or hire a new employee. Our aim is to maximise the staff, considering that existing staff and new applicants are at same level of knowledge and experience. Input Format: First line: 3 integers N, M, X Each of the next N lines contains two integers a and bi, where ai is the current salary of the employee and b; is the salary he/she expects. Next line contains M integers c, corresponding to the salary demanded by th candidate. Output Format: Output a single integer denoting total number of employees working for the company after this process. Output Format: Output a single integer denoting total number of employees working for the company after this process. Input Constraints: 1 M 105 1 N 105 1 ai, bi, ci, X < 10 ai bi Sample Input % 5 3 20 10 15 78 8 10 15 17 200 300 10 2 7 Sample Output 6 Explanation The best way to tackle this problem is hire candidate 2 and 3, and retain the employee 1, 2, 3 and 4. So we will have a maximum of 6 employees at the end.

Step by Step Solution

3.45 Rating (161 Votes )

There are 3 Steps involved in it

Step: 1

We are using Greedy approach here You just need to calculate how much money does co... 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

Step: 3

blur-text-image

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

Practical financial management

Authors: William r. Lasher

5th Edition

0324422636, 978-0324422634

More Books

Students also viewed these Programming questions

Question

3. Quantitative research relies on deductive reasoning.

Answered: 1 week ago

Question

2. Identify examples of quantitative research.

Answered: 1 week ago

Question

1. Describe quantitative research and its assumptions.

Answered: 1 week ago