长为H的格子里面放n个长为h的格子 最多会有n+1个空隙

要使每一个空隙长度都小于h (H-h*n)/(n+1)<h

n>(H/h-1)/2

#include<bits/stdc++.h>
int main()
{
int W,H,w,h;
while(scanf("%d%d%d%d",&W,&H,&w,&h)==4)
{
int x=(int)ceil((W*1.0/w-1)/2),y=(int)ceil((H*1.0/h-1)/2);
if(W%w==0&&(W/w)%2==1)
x++;
if(H%h==0&&(H/h)%2==1)
y++;
printf("%d\n",x*y);
}
return 0;
}

HNU 12850 Garage的更多相关文章

  1. HNU 12906 Battleship

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12906 解题报告:题目意思看了很久都没懂,就是一个10*10的 ...

  2. HNU 12888 Encryption(map容器)

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12890&courseid=274 解题报告:输入一个有 ...

  3. HNU 12886 Cracking the Safe(暴力枚举)

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12886&courseid=274 解题报告:输入4个数 ...

  4. HNU 12885 Bad Signal(模拟)

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12885&courseid=274 解题报告:一共有n个 ...

  5. HNU 12868 Island (简单题)

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12868&courseid=272 解题报告:输入n*m ...

  6. HNU 12869 Sequence(循环节)

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12869 解题报告:看到n的范围这么大,一看就是找规律,把前30 ...

  7. Greedy --- HNU 13320 Please, go first

    Please, go first Problem's Link: http://acm.hnu.cn/online/?action=problem&type=show&id=13320 ...

  8. HNU 13308 Help cupid

    Help cupid Problem's Link: http://acm.hnu.cn/online/?action=problem&type=show&id=13308&c ...

  9. HNU 12847 Dwarf Tower(最短路+队列优化)

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12847 解题报告:有n样物品,编号从1到n第i样物品可以通过金 ...

随机推荐

  1. 新 Azure SQL 数据库服务等级的性能

    4 月 24 日,我们发布了 SQL Database 基本级(预览版)和标准级(预览版)新服务等级的预览版以及新的业务连续性功能.在本博客文章中,我们将深入探究 SQL Database 中新等级的 ...

  2. 强烈推荐一款CSS导航菜单

    强烈推荐一款CSS导航菜单,用到政府学校类网站上超级不错,有点类似站长网菜单的味道,只不过颜色不一样而已,这种菜单还不是真正意义上的“下拉”菜单,应该叫滑出菜单吧?反正比较不错,不多说了. <! ...

  3. 区间dp-hdu-4745-Two Rabbits

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4745 题目意思: 给n个环状的数,A.B两人沿相反的方向走,每单位时间走一步,要求相同时间两人到达相 ...

  4. Cocos2d-x Render-NewCulling

    .cpp layout->setBackGroundImageScale9Enabled(true); layout->setBackGroundImage("green_edi ...

  5. android xml布局文件属性说明

    android xml布局文件属性说明 [摘]android xml布局文件属性说明 LinearLayout和RelativeLayout 共有属性:java代码中通过btn1关联次控件androi ...

  6. sctf pwn400

    这个题目在这个链接中分析得很透彻,不再多余地写了.http://bruce30262.logdown.com/posts/245613-sctf-2014-pwn400 exploit: from s ...

  7. JqueryUI-2

    本文在于巩固基础 jQuery UI Widgets jQuery UI Widgets控件-Accordion <!DOCTYPE html> <html> <head ...

  8. Zepto.js touch模块深入分析 解决手机点击事件

    源码: // Zepto.js // (c) 2010-2015 Thomas Fuchs // Zepto.js may be freely distributed under the MIT li ...

  9. Spring-----自定义属性编辑器

    转载自:http://blog.csdn.net/hekewangzi/article/details/51712963

  10. windows系统——mysql自动定时备份数据库的最佳方法

    网上有很多关于window下Mysql自动备份的方法,可是真的能用的也没有几个,有些说的还非常的复杂,难以操作. 我们都知道mssql本身就自带了计划任务可以用来自动备份,可是mysql咱们要怎么样自 ...