Need help in this question!

Правка en1, от JulitoPeligro, 2022-07-22 14:05:23

Alice is a little girl, she lovest o eat cakes too much. There are N cakes in a line and an array of tastes is given to her, the i'th of them has taste[i]. She is allowed to choose at most K distinct subarrays of the array and eat all the cakes in the subarrays (the subarray can't intersect each other), such that the total taste of the cakes is exactly M. Since Alcie is very little, she wants to eat a minimum possible number of cakes such that the total taste is exactly M.

If possible, print minimum number of cakes alice can each such that the total taste is M otherwise print -1.

1 =< N <= 100 1 =< K <= N 1 =< M <= 600 1 =< TASTE[i] <= 100

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский JulitoPeligro 2022-07-22 14:05:23 683 Initial revision (published)