Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely

image text in transcribed

What joy! Petya's parents went on a business trip for the whole year and the playful kid is left all by himself. Petya got absolutely happy. He jumped on the bed and threw pillows all day long, until... Today Petya opened the cupboard and found a scary note there. His parents had left him with duties: he should water their favourite flower all year, each day, in the morning, in the afternoon and in the evening. "Wait a second!"- thought Petya. He know for a fact that if he fulfills the parents' task in the i-th (1 12) month of the year, then the flower will grow by ai centimeters, and if he doesn't water the flower in the i-th month, then the flower won't grow this month. Petya also knows that try as he might, his parents won't believe that he has been watering the flower if it grows strictly less than by k centimeters Help Petya choose the minimum number of months when he will water the flower, given that the flower should grow no less than by k centimeters Input The first line contains exactly one integer k (OSks 100). The next line contains twelve space-separated integers: the i-th (1 Si

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions