Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please give me answer. i will upvote from 5 ids. You have been invited to work in Willy Wonka's chocolate factory The factory is a

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

please give me answer. i will upvote from 5 ids.

You have been invited to work in Willy Wonka's chocolate factory The factory is a magical place where there are infinite quantities of chocolate of different types present, There are N different types of chocolate which are pressed into balls and dropped by a funnel. It is given that there are N such funnel since each funnel delivers balls of only one type of chocolate The number of chocolate balls delivered per second is given to you in an array rate. This means that the Tunnel produces ratei) chocolate balls per second It is given that there is a container present beneath each funnel which collects all the chocolates being produced by the respective funnel Additionally you are given the inventory of chocolates present in each of the It is given that there is a container present beneath each funnel which collects all the chocolates being produced by the respective funnel Additionally you are given the inventory of chocolates present in each of the N containers already in array available. This means that the amount of chocolate present in the container from the previous days production is available[t] You will switch on all the funnels at once Your task now is to perform the following operations 1. You will shut down only one funnel at a time 2. You will then empty the container beneath the respective funnel You will repeat the above steps till all the containers are emptied. However, once you have switched off a individual funnel you can no longer restart it. It is given that it takes you one second to remove a chocolate ball However, once you have switched off a individual funnel you can no longer restart it. It is given that it takes you one second to remove a chocolate ball of any type from the container Additionally, you are not allowed to emply a container before you switch off the funnel above it You need to find the minimum time required to empty all the containers Since the answer can be very large retum it modulo 10^9+7 Nole . It is mandatory for you to empty the container beneath a funnel after shutting it down before you are allowed to switch off any other funnel C It takes zero seconds for you to shut down a funnel Input Format The first line contains an integer N denoting the number of containers Each line i of the N subsequent lines (Where 0 SIN) contains an integer describing ratei Input Format The first line contains an integer, N, denoting the number of containers Each line i of the N subsequent lines (where 0 SIN) contains an integer describing ratei Each line 1 of the N subsequent lines (where 0 Si

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

3.What are the Importance / Role of Bank in Business?

Answered: 1 week ago