Editorial for Sasha y la merienda
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
La solución consiste en, para cada , simular el proceso de comer frutas, es decir, buscar el mayor
tal que la suma de las frutas es menor o igual a
, y al final reportar la máxima cantidad de frutas que se pudieron comer, o sea, el máximo
para algún
.
Complejidad .
Comments