Tired of boring WFH , Apollo decided to open a fast food restaurant, called KabaleoLitetextbf{Kabaleo Lite}KabaleoLite. The restaurant serves n kinds of food, numbered from 1 to n. The profit for the i-th kind of food is aia_iai. Profit may be negative because it uses expensive ingredients. On the first day, Apollo prepared bib_ibi dishes of the i-th kind of food. The peculiarity of Apollo's restaurant is the procedure of ordering food. For each visitor Apollo himself chooses a set of dishes that this visitor will receive. When doing so, Apollo is guided by the following rules: every visitor should receive at least one dish. each visitor should receive continuous kinds of food started from the first food. And the visitor will receiveexactly 1 dish for each kind of food. For example, a visitor may receive 1 dish of the 1st kind of food, 1 dish of the 2nd kind of food, 1 dish of the 3rd kind of food. What's the maximum number of visitors Apollo can feed?And he wants to know the maximum possible profits he can earn to have the maximum of visitors.
Tired of boring WFH (work from home), Apollo decided to open a fast food restaurant, called Kabaleo Litetextbf{Kabaleo Lite}Kabaleo Lite. The restaurant serves n kinds of food, numbered from 1 to n. The profit for the i-th kind of food is aia_iai. Profit may be negative because it uses expensive ingredients. On the first day, Apollo prepared bib_ibi dishes of the i-th kind of food. The peculiarity of Apollo's restaurant is the procedure of ordering food. For each visitor Apollo himself chooses a set of dishes that this visitor will receive. When doing so, Apollo is guided by the following rules: every visitor should receive at least one dish. each visitor should receive continuous kinds of food started from the first food. And the visitor will receive exactly 1 dish for each kind of food. For example, a visitor may receive 1 dish of the 1st kind of food, 1 dish of the 2nd kind of food, 1 dish of the 3rd kind of food. What's the maximum number of visitors Apollo can feed? And he wants to know the maximum possible profits he can earn to have the maximum of visitors.
