编程介的小学生 2016-12-27 11:54 采纳率: 20.5%
浏览 1093
已采纳

核电站 Nuclear Plants

Description

The Great Plain of Algorithmia plays an extremely important role in the agriculture of the Bandulu Kingdom: this is the only place where barley (Hordeum vulgare), an essential ingredient of beer, can be produced. Unfortunately, it is not possible to grow barley on the full area of the plain, as several nuclear plants have recently been built, and you cannot grow barley near a nuclear plant (since you do not want to produce giant-size, aggressive, man-eating barley-mutants). Your task is to write a program that determines the size of the area that can be used for growing barley.

The Great Plain of Algorithmia is an n x m km2 rectangle, the coordinates of the four corners being (0, 0),(0, m),(n, 0) and (n, m) . There are two types of nuclear plants: small and large. You are not allowed to grow barley within 0.58km of a small nuclear plant or within 1.31km of a large nuclear plant.
Input

The input contains several blocks of test cases. Each block begins with a line containing four integers: 1 ≤ n, m ≤ 10000 describe the size of the plain, ks ≤ 100 is the number of small nuclear plants, and kl ≤ 100 is the number of large nuclear plants. The next ks lines describe the coordinates of the small nuclear plants, each line contains two integers 0 ≤ x ≤ n and 0 ≤ y ≤ m . The next kl lines describe the large nuclear plants in a similar fashion.

The input is terminated by a block with n = m = ks = kl = 0 .

Output

For each test case, you have to output a single line containing the area that can be used for growing barley. This number should be a real value with two digits of precision. To avoid rounding problems, we accept solutions with a maximum of ±0.01 error.

Sample Input

10 10 2 2
2 2
4 4
5 6
1 8
10 10 1 0
5 5
0 0 0 0
Sample Output

87.46
98.94

  • 写回答

1条回答 默认 最新

  • threenewbee 2016-12-27 16:37
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器