#C6479. Baking Feast

    ID: 50243 Type: Default 1000ms 256MiB

Baking Feast

Baking Feast

You have been given the task of organizing a grand feast where cakes play a central role. For the feast to be successful, all types of cakes must be baked within the available total time. You are provided with an integer n representing the number of different cakes, a list of n positive integers where each integer indicates the baking time for a cake, and an integer T representing the total available time. Your job is to determine if the sum of the baking times is less than or equal to T. If it is, the feast is ready; otherwise, there is not enough time!

Note: All input will be read from standard input and the result should be output to standard output.

In mathematical terms, let \( b_1, b_2, \ldots, b_n \) be the baking times. The feast is ready if and only if:

[ \sum_{i=1}^{n} b_i \le T ]

inputFormat

The first line contains an integer n indicating the number of cakes.\nThe second line contains n space-separated integers representing the baking times of each cake.\nThe third line contains an integer T denoting the total available time.

outputFormat

Output a single line: "Feast is ready!" if the sum of the baking times is less than or equal to T; otherwise, output "Time is not enough!".## sample

4
45 30 60 20
160
Feast is ready!