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,,)