Hdoj (HDU) 1587 Flowers (water,,)

Source: Internet
Author: User

Problem Description
As you know, Gardon Trid hard for his love-letter, and now he's spending too much time on choosing flowers for Angel.
When Gardon entered the flower shop, he is frightened and dazed by thousands kinds of flowers.
"How can I choose!" Gardon shouted out.
Finally, Gardon–a No-eq man decided to buy flowers as many as possible.
Can compute how many flowers Gardon can buy at the most?

Input
Input has serveral test cases. Each case has a lines.
The first line contains, integers:n and M. means how much money Gardon has.
N integers following, means the prices of differnt flowers.

Output
For the case, the print how many flowers Gardon can buy at the most.
Firmly assume the number of each kind of flower is enough.

Sample Input
2 5
2 3

Sample Output
2

Hinthint
Gardon can buy 5=2+3,at most 2 flower, but he cannot buy 3 flower with 5 yuan.

Probably test instructions:
Input m n
Re-enter the price of M flower
Is that you have n yuan money, need to buy the most flowers, ask the most can buy how many flower!
A flower you can buy a lot of flowers!!!
So, just find the lowest price of the flower can be.

Import Java.util.Scanner; Public classmain{ Public Static void Main(string[] args) {Scanner SC =NewScanner (System.inch); while(Sc.hasnext ()) {intA = Sc.nextint ();intb = Sc.nextint ();intmin = Sc.nextint (); a--;intT while(a-->0) {T = Sc.nextint ();if(t<min)                {min=t; }} System. out. println (B/min); }    }}

Hdoj (HDU) 1587 Flowers (water,,)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.