Equipment Box

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1105    Accepted Submission(s): 261

Problem Description
There is a large room in the Pyramid called Room-of-No-Return. Its floor is covered by rectangular tiles of equal size. The name of the room was chosen because of the very high number of traps and mechanisms in it. The ACM group has spent several years studying the secret plan of this room. It has made a clever plan to avoid all the traps. A specially trained mechanic was sent to deactivate the most feared trap called Shattered Bones. After deactivating the trap the mechanic had to escape from the room. It is very important to step on the center of the tiles only; he must not touch the edges. One wrong step and a large rock falls from the ceiling squashing the mechanic like a pancake. After deactivating the trap, he realized a horrible thing: the ACM plan did not take his equipment box into consideration. The box must be laid onto the ground because the mechanic must have both hands free to prevent contact with other traps. But when the box is laid on the ground, it could touch the line separating the tiles. And this is the main problem you are to solve.

Input
The input consists of T test cases. The number of them (T) is given on the first line of the input. Each test case consists of a single line. The line contains exactly four integer numbers separated by spaces: A, B, X and Y. A and Bindicate the dimensions of the tiles, X and Y are the dimensions of the equipment box (1 <= A, B, X, Y <= 50000).

Output
Your task is to determine whether it is possible to put the box on a single tile -- that is, if the whole box fits on a single tile without touching its border. If so, you are to print one line with the sentence "Escape is possible.". Otherwise print the sentence "Box cannot be dropped.".

Sample Input
2
10 10 8 8
8 8 10 10

Sample Output
Escape is possible.
Box cannot be dropped.

Source
Central Europe 1999

Recommend
Eddy

#include<math.h>
#include<stdio.h>
bool judge(double A,double B,double X,double Y)
{
if (A*B<=X*Y) return false;
if (A<=X) return false;
if (A>X && B>Y) return true;
double len=sqrt(X*X+Y*Y);
double A0=asin(A*1.0/len);
double A1=atan(X*1.0/Y);
double A2=A0-A1;
double A3=atan(B*1.0/A);
double A4=A2+A3;
double l=len*sin(A4);
if (l<B) return true;
else return false;
}
int main()
{
int T;
scanf("%d",&T);
double A,B,X,Y;
while (T--)
{
scanf("%lf%lf%lf%lf",&A,&B,&X,&Y);
if (A>B)
{
double tmp=A;
A=B;
B=tmp;
}
if (X>Y)
{
double tmp=X;
X=Y;
Y=tmp;
}
if (judge(A,B,X,Y)) printf("Escape is possible.\n");
else printf("Box cannot be dropped.\n");
}
return 0;
}

Equipment Box[HDU1110]的更多相关文章

  1. HDU 1110 Equipment Box (判断一个大矩形里面能不能放小矩形)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1110 Equipment Box Time Limit: 2000/1000 MS (Java/Oth ...

  2. POJ 1380 Equipment Box (暴力枚举)

    Equipment Box 题目链接: http://acm.hust.edu.cn/vjudge/contest/130510#problem/B Description There is a la ...

  3. HOJ题目分类

    各种杂题,水题,模拟,包括简单数论. 1001 A+B 1002 A+B+C 1009 Fat Cat 1010 The Angle 1011 Unix ls 1012 Decoding Task 1 ...

  4. 2018年暑假ACM个人训练题7 题解报告

    A:HDU 1060 Leftmost Digit(求N^N的第一位数字 log10的巧妙使用) B:(还需要研究一下.....) C:HDU 1071 The area(求三个点确定的抛物线的面积, ...

  5. Virtual Box配置CentOS7网络(图文教程)

    之前很多次安装CentOS7虚拟机,每次配置网络在网上找教程,今天总结一下,全图文配置,方便以后查看. Virtual Box可选的网络接入方式包括: NAT 网络地址转换模式(NAT,Network ...

  6. Linux监控工具介绍系列——OSWatcher Black Box

      OSWatcher Balck Box简介 OSWatcher Black Box (oswbb)是Oracle开发.提供的一个小巧,但是实用.强大的系统工具,它可以用来抓取操作系统的性能指标,用 ...

  7. 使用packer制作vagrant centos box

    使用packer制作vagrant box:centos 制作vagrant box,网上有教程,可以自己step by step的操作.不过直接使用虚拟在VirtualBox中制作vagrant b ...

  8. 快速打造跨平台开发环境 vagrant + virtualbox + box

    工欲善其事必先利其器,开发环境 和 开发工具 就是 我们开发人员的剑,所以我们需要一个快并且好用的剑 刚开始做开发的时候的都是把开发环境 配置在 自己的电脑上,随着后面我们接触的东西越来越多,慢慢的电 ...

  9. CSS3伸缩盒Flexible Box

    这是一种全新的布局,在移动端非常实用,IE对此布局的相关的兼容不是很好,Firefox.Chrome.Safrai等需要加浏览器前缀. 先说说这种布局的特点: 1)移动端由于屏幕宽度都不一样,在布局的 ...

随机推荐

  1. 第13章 使用Bind提供域名解析服务

    章节简述: 本章节将让您理解DNS服务程序的原理,学习正向解析与反向解析实验,掌握DNS主服务器.从服务器.缓存服务器的部署方法. 够熟练配置区域信息文件与区域数据文件,以及通过使用分离解析技术让不同 ...

  2. 第8章 Iptables与Firewalld防火墙

    章节简述: 红帽RHEL7系统已经用firewalld服务替代了iptables服务,新的防火墙管理命令firewall-cmd与图形化工具firewall-config. 本章节基于数十个防火墙需求 ...

  3. Python socket 详解

    socket()函数用于根据指定的地址族.数据类型和协议来分配一个套接口的描述字及其所用的资源.如果协议protocol未指定(等于0),则使用缺省的连接方式. 对于使用一给定地址族的某一特定套接口, ...

  4. 二模Day2题解

    小明搬家 题目描述 小明要搬家了,大家都来帮忙. 小明现在住在第N楼,总共K个人要把X个大箱子搬上N楼. 最开始X个箱子都在1楼,但是经过一段混乱的搬运已经乱掉了.最后大家发现这样混乱地搬运过程效率太 ...

  5. TCP/IP详解学习笔记(5)-- ICMP:internet 控制报文协议

    1.概述      ICMP是(Internet Control Message Protocol)Internet控制报文协议.它是TCP/IP协议族的一个子协议,用于在IP主机.路由器之间传递控制 ...

  6. spring中context:property-placeholder/元素

    1.有些参数在某些阶段中是常量 比如 :a.在开发阶段我们连接数据库时的连接url,username,password,driverClass等 b.分布式应用中client端访问server端所用的 ...

  7. petri网学习心得

    本文转载自duxw,如给您带来不便之处,请联系博主. 1.Petri网书籍:<petri网导论>,吴哲辉 非常适合初学者.概念清晰,容易理解. 2.工作流书籍:<Workflow M ...

  8. XShell上传下载命令

    参考:https://www.centos.bz/2012/12/xshell-securecrtrz-sz-upload-download/ 上传文件时,执行rz就会弹出文件选择对话框来选择文件.下 ...

  9. 【python】linux将python改为默认3.4版本

    Python3.4默认是安装在/usr/local/lib/python3.4目录下,需要删除默认python link文件,重新建立连接关系. 使用ln -s命令来修改,命令如下: sudo rm ...

  10. 【python】lxml-The E-factory

    来自:http://lxml.de/tutorial.html lxml中的E-factory可以用个简单快速的生成XML和HTML >>> from lxml.builder im ...