Rogan Posted February 19, 2017 Share Posted February 19, 2017 Hey. Please help to solve the taskHead John very busy lately. And it does not have time to plan the time of your employees manually. So he asked Jerry programmer to write a program that will calculate how much of a certain type of problems his department will be able to solve in the past month.John knows that to solve this type of problem he needs n employees, each of which will deal with a specific case and can not replace the other. Each of these employees will be engaged in the same task ai hours. Total monthly employee fulfills bi hours. Besides John have Jerry, which can be given to the problem of maximum k hours. Jerry can do the work of any other employee, one hour is equal to one hour of Jerry any other employee.John need to understand how the tasks can be performed per month maximum knowing n, k, a1-n, and b1-nInput dataThe first line is followed by two positive integers n and k (1 ≤ n ≤ 50000, 1 ≤ k ≤ 109) - the number of employees and number of hours of programmer Jerry.In the second line followed by a sequence a1, a2, ..., an (1 ≤ ai ≤ 109), where the i-th number equals the number of hours the i-th employee, required for solving a problem.The third line should be a sequence of b1, b2, ..., bn (1 ≤ bi ≤ 109), where the i-th number equals the number of hours the i-th employee, who is at John.OutputPrint a single number - the maximum number of tasks that can make the employees of the department with the help of their available hours and programmer Jerry.Examples:Input data 3 1 2 1 4 11 3 16 The result of 4 Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/ Share on other sites More sharing options...
Jacques1 Posted February 19, 2017 Share Posted February 19, 2017 Do your own homework- Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543056 Share on other sites More sharing options...
Rogan Posted February 19, 2017 Author Share Posted February 19, 2017 (edited) Do your own homework- Prompt please, and I do not know exactly how to implement the algorithm. This olympiad task... Edited February 19, 2017 by Rogan Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543057 Share on other sites More sharing options...
requinix Posted February 19, 2017 Share Posted February 19, 2017 I can't even figure out the problem description, and the machine translation wasn't very helpful. I mean, Input data 3 1 2 1 4 11 3 16 The result of 43 employees, 1 something, 2,1,4 hours for the three employees to each solve a problem, 11,3,16 something else, and then somehow the result is 4? Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543060 Share on other sites More sharing options...
benanamen Posted February 20, 2017 Share Posted February 20, 2017 From the Forums Rules Users will not post their homework questions expecting to get their homework coded for them. If you have a question about part of the assignment that you do not understand, please post asking for an explanation rather than the code. Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543070 Share on other sites More sharing options...
requinix Posted February 20, 2017 Share Posted February 20, 2017 From the Forums RulesThat's right! I'm glad you've suddenly become familiar with the rules. Now how about giving OP a chance to redeem him/herself? Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543073 Share on other sites More sharing options...
benanamen Posted February 20, 2017 Share Posted February 20, 2017 Suddenly? I have never asked for homework help and I don't violate any of the other rules. What are you trying to say? Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543089 Share on other sites More sharing options...
ignace Posted February 21, 2017 Share Posted February 21, 2017 Shots fired! Quote Link to comment https://forums.phpfreaks.com/topic/303240-the-task-of-php/#findComment-1543133 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.