HNU 12850 Garage
长为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的更多相关文章
- HNU 12906 Battleship
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12906 解题报告:题目意思看了很久都没懂,就是一个10*10的 ...
- HNU 12888 Encryption(map容器)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12890&courseid=274 解题报告:输入一个有 ...
- HNU 12886 Cracking the Safe(暴力枚举)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12886&courseid=274 解题报告:输入4个数 ...
- HNU 12885 Bad Signal(模拟)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12885&courseid=274 解题报告:一共有n个 ...
- HNU 12868 Island (简单题)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12868&courseid=272 解题报告:输入n*m ...
- HNU 12869 Sequence(循环节)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12869 解题报告:看到n的范围这么大,一看就是找规律,把前30 ...
- Greedy --- HNU 13320 Please, go first
Please, go first Problem's Link: http://acm.hnu.cn/online/?action=problem&type=show&id=13320 ...
- HNU 13308 Help cupid
Help cupid Problem's Link: http://acm.hnu.cn/online/?action=problem&type=show&id=13308&c ...
- HNU 12847 Dwarf Tower(最短路+队列优化)
题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12847 解题报告:有n样物品,编号从1到n第i样物品可以通过金 ...
随机推荐
- linux下维护服务器之常用命令
linux下维护服务器之常用命令! 第1套如下: 正则表达式: 1.如何不要文件中的空白行和注释语句: [root@localhost ~]# grep -v '^$' 文件名 |grep -v '^ ...
- linux中的strings命令简介2
摘自:http://blog.csdn.net/stpeace/article/details/46641069 linux中的strings命令简介 之前我们聊过linux strings的用法和用 ...
- eclipse ctrl链接设置
选择[Window]菜单 Preferences ——>General——>Editors——>Text Editors——>Hyperlinking
- ASP.NET MVC 3 配置EF自动生成模型
Tools(工具) => 扩展工具 => Nuget Tools(工具) => Nuget=>程序包管理器控制台 Nuget 程序包管理器 => Install-Pac ...
- 【27前端】字体图标 Font Face
设计师做的高保真原型图,难免会用到艺术字体. 采用切片的方式,简单,粗暴,节省时间.除了retina屏其它兼容性也是一流.但是在修改的时候,会花很大的力气.即使只是修改文字大小,也需要重新切图,更别说 ...
- UVA 1617 Laptop
题意: 有n条长度为1的线段,确定他们的起点,必须是整数,使得第i条线段在[ri,di]之间.最后输出空隙的最小值 分析: 原始数据排序,排序的规则是先按照右端点排序,右端点相同的情况下,再按照左端点 ...
- jQuery基础---Ajax基础教程
jQuery基础---Ajax基础 内容提纲: 1.Ajax 概述 2.load()方法 3.$.get()和$.post() 4.$.getScript()和$.getJSON() 5.$.ajax ...
- L13 DNS
DNS: 根 root 分布式. 服务于终端客户,也服务于其他dns服务器.对其他dns服务器提供数据 是域名资料数据库,也是解析服务提供者.用户接入进来,可以得到解析的服务 仅管理下一级dns服务器 ...
- 读书笔记-实用单元测试(英文版) Pragmatic Unit Testing in C# with NUnit
读书笔记-实用单元测试(英文版) Pragmatic Unit Testing in C# with NUnit Author: Andrew Hunt ,David Thomas with Matt ...
- ios消息的交互方式
注意这些都是界面回传(即从第二个界面传到第一个界面,从第一个界面传到第二个界面的时候用第二个界面的属性即可) iOS消息的交互方式有4种,分别为:通知,代理,block,kvo 现在我们对这个4中 ...