Flowers
Time limit:1000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)
Total submission (s): 3066 Accepted Submission (s): 2052
Problem Descriptionas you know, Gardon Trid hard for him love-letter, and now he's spending too much time on choosing flow ERs 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?
Inputinput 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.
Outputfor each case, print how many flowers Gardon can buy at the most.
Firmly assume the number of each kind of flower is enough.
Sample Input
2 52 3
Sample Output
2HintHintgardon can buy 5=2+3,at most 2 flower, but he cannot buy 3 flower with 5 yuan.
Authordygg
SOURCE is so simple! Ya's balls.
#include <iostream>using namespace Std;int main () {int N,m,ls[1000];while (cin>>n>>m) {for (int i=0;i <n;i++) cin>>ls[i];int min=10000000;for (int j=0;j<n;j++) if (ls[j]<min) min=ls[j];cout<<m/min <<endl;} return 0;}
Hangzhou Electric HDU ACM 1587 Flowers