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 was 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 you compute how many flowers Gardon can buy at most?





Input

Input have serveral test cases. Each case has two lines.

The first line contains two integers: N and M. M means how much money Gardon have.

N integers following, means the prices of differnt flowers.





Output

For each case, print how many flowers Gardon can buy at most.

You may firmly assume the number of each kind of flower is enough.





Sample Input

2 5

2 3





Sample Output

2

代码:

#include<stdio.h>
int main(){
int a,n,m,b,i;
while((scanf("%d%d",&n,&m))!=EOF){
b=100000000;
for(i=0;i<n;i++)
{
scanf("%d",&a);
if(a<b) b=a;
}
printf("%d\n",m/b); }
return 0;
}

hdu 1587的更多相关文章

  1. hdu 1587 Flowers

    Flowers Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Su ...

  2. HDOJ(HDU) 1587 Flowers(水、、)

    Problem Description As you know, Gardon trid hard for his love-letter, and now he's spending too muc ...

  3. HDU 1587 Flowers【贪心】

    题意:给出n种花的价钱,和总的金额m,问最多能够买到多少朵花.先排序,然后就是便宜的花在能够买的范围内能够多买就多买 #include<iostream> #include<cstd ...

  4. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  5. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

  6. HDU ACM 题目分类

    模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...

  7. 转载:hdu 题目分类 (侵删)

    转载:from http://blog.csdn.net/qq_28236309/article/details/47818349 基础题:1000.1001.1004.1005.1008.1012. ...

  8. hdu 分类

    HDU分类 http://www.cnblogs.com/ACMan/archive/2012/05/26/2519550.html#2667329 努力A完.方便自己系统A题 不断更新中...... ...

  9. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

随机推荐

  1. CentOS磁盘分区、格式化并挂载外置存储的方法

    1.划分外置存储主分区: 假设该外置存储在linux系统中被识别为/dev/sdb,使用fdisk /dev/sdb进入分区工具操作界面. 按p键打印当前外置存储分区情况,如果显示为空,则表示此外置存 ...

  2. 关于extern对变量的使用

    extern 是声明全局的变量的意思. 例如在一个工程中有两个cpp,一个是test.cpp一个是main.cpp . 我们在test.cpp中定义了一个int num;但是我们在main.cpp中想 ...

  3. c++11-bind的用法

    bind函数 在c++11之前,要绑定某个函数.函数对象或者成员函数的不同参数值需要用到不同的转换器,如bind1st.bind2nd.fun_ptr.mem_fun和mem_fun_ref等.在c+ ...

  4. javascript的prototype原理理解

    prototype是函数的内置属性,每一个function都拥有这样一个属性,在js的面向对象编程上,prototype发挥着强大的作用. 某天,春哥问我你知道prototype的原理吗?我突然懵了, ...

  5. 方便代理下单的EcStore收货地址一键分析插件,同时支持淘宝/京东/一号店

    使用EcStore开展分销的网站,代理需要经常代客下单,每个客户收货地址都不同,要选择和填写多个内容才能完成地址输入:省.市.区.详细地址.收货人姓名.手机电话等,非常麻烦,也容易输入错误.安装EcS ...

  6. phpmyadmin开启远程服务器连接

     1.修改 braries/config.default.php,将 $cfg['AllowArbitraryServer'] 的值由 false 改成 true. 2.有其他需求的也可以自己在这里修 ...

  7. Ubuntu下给Sublime Text 3添加用python3运行文件

    Ubuntu14.04: 菜单栏:Tools-Build System-New Build System { "cmd": ["python3", " ...

  8. 学习hadoop

    一.笔记本触摸板关闭方法 1.在windows下有官方驱动. 2.ubuntu下没有 操作方法如下: 1,终端操作 临时禁止触摸板:sudo modprobe -r psmouse 开启触摸板:sud ...

  9. CoreData的数据迁移

    CoreData的数据迁移   很多人说CoreData坑多,现在才感觉到,今天上午写代码的时候,发现了一个大问题. 过程如下,之前我自己给coredata的实体添加了几个字段,后来网上的一个用户说我 ...

  10. Golden Pyramid

    Golden Pyramid Our Robo-Trio need to train for future journeys and treasure hunts. Stephan has built ...