Question: in java or c++, complete the function below, kindly consider the constraints also New Year is approaching, and Tim, the tortoise, needs to prepare n




![A[i] time to make the batter and B[i] time to bake, no](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3ad6ab458b_67466f3ad6a54e5f.jpg)



New Year is approaching, and Tim, the tortoise, needs to prepare n fruit cakes for the kids in the neighborhood. Baking cake is easy (at least for Tim), you first need to prepare the batter and then bake it. To prepare the ith cake, it takes A[i] time to make the batter and B[i] time to bake, no time is lost in any other process. Tim has a large oven, which allows him to bake several cakes simultaneously, but he can only make the batter for a cake one at a time. Being the fastest tortoise. Tim wants to do everything quickly, Come up with a strategy that allows Tim to finish making all these cakes as soon as possible Input Format The first line contains an integer, n denoting the number of elements in A and B Each line i of the n subsequent lines (where sun) contains an integer describing Ali Input Format The first line contains an integer, n, denoting the number of elements in A and B. Each line i of the n subsequent lines (where 0 Si
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
