# YT14-HDU-盒子与瓷砖

### 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.".

```2
10 10 8 8
8 8 10 10
```

### Sample Output

```Escape is possible.
Box cannot be dropped.
```

```#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int N;
cin>>N;
while(N--)
{
double a, b, n, m, temp;
cin>>a>>b>>n>>m;
if(a > b)
{
temp = a;
a = b;
b = temp;
}
if(n > m)
{
temp = n;
n = m;
m = temp;
}
double x, y;
if(a >= n && b >= m)
{
cout<<"Escape is possible."<<endl;
continue;
}
else if((n > a && m > b) || (n > a && m < b))
{
cout<<"Box cannot be dropped."<<endl;
continue;
}
else
{
double c = sqrt(a * a + b * b);
if(c <= m)
{
cout<<"Box cannot be dropped."<<endl;
continue;
}
y = ((2 * a * n * n + sqrt((-4) * n * n * m * m *(a * a - m * m - n * n)))) / (2 * (n * n + m * m));
x = sqrt(n * n - y * y);
if(b - sqrt( m * m - (a - y) * (a - y)) >= x)
{
cout<<"Escape is possible."<<endl;
}
else
cout<<"Box cannot be dropped."<<endl;
}
}
return 0;
}
```

## HDU 5810 Balls and Boxes（盒子与球）

HDU 5810 Balls and Boxes(盒子与球) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Description 题目描述 Mr. Chopsticks is interested in random phenomena, and he conducts an experiment to study randomness. In the experiment

## 排列组合+组合数取模 HDU 5894

1 // 排列组合+组合数取模 HDU 5894 2 // 题意:n个座位不同,m个人去坐(人是一样的),每个人之间至少相隔k个座位问方案数 3 // 思路: 4 // 定好m个人 相邻人之间k个座位 剩下就剩n-(m+1)*k个座位 5 // 剩下座位去插m个不同的盒子==就等价n个相同的球放m个不同的盒子 6 // 然后组合数出来了 7 // 乘n的话是枚举座位,除m是去掉枚举第一个座位的时候,剩下人相邻的座位相对不变的情况 8 9 #include <iostream> 10 #incl

## HDU 1561&amp;HDU 3449 一类简单依赖背包问题

HDU 1561.这道是树形DP了,所谓依赖背包,就是选A前必须选B,这样的问题.1561很明显是这样的题了.把0点当成ROOT就好,然后选子节点前必须先选根,所以初始化数组每一行为该根点的值.由于多选了0点,所以记得把m++. #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; const int MAXN=22

## 【HDU】Card Collector

http://acm.hdu.edu.cn/showproblem.php?pid=4336 题意:n张卡片,每一次取一个盒子,盒子里装有卡片i的概率是p[i],求得到所有卡片所需要开的盒子的期望数(n<=20) #include <cstdio> #include <cstring> using namespace std; const int N=22; int n; double p[N], f[1<<N]; int main() { while(~scan