编程介的小学生 2017-04-12 15:07 采纳率: 20.5%
浏览 815
已采纳

Little Mammoth

It is well known that mammoths used to live in caves. This is a story of a little mammoth who lived in a cave with his mummy and daddy.

The mammoth was little and very cute. And he was very curious. He used to peep out of the cave and look around. And one day mummy said him:

“You are a big boy now, dear, so you may go out of the cave and take a little small walk around. But beware! There is a lot of danger outside. Horrible humans may try to catch you and make a dinner out of you! Do no walk further than r meters away from the cave entrance.”

And the little mammoth made the first step out of the cave. He was a good boy, so he decided not to violate mummy's order. But suddenly he saw a nice field of grass around. Nice, green, juicy, tasty grass! How could he stand it!

But no, those dangerous humans. Little mammoth thought for a while and decided that he would only eat the grass that he can reach not breaking mummy's recommendation.

The field of grass is a rectangle. Find out how much grass can little mammoth eat.

Input

There are several test cases in the input. The first line of each case contains xc , yc and r --- coordinates of the entrance to the cave and the distance little mammoth is allowed to walk from it.

Next line contains x1 , y1 , x2 , and y2 --- coordinates of two opposite corners of the grass field. Coordinate system is set up in such a way that field's sides are parallel to coordinate axes.

All numbers in the input file are integer and do not exceed 1000 by their absolute values, r > 0, both field sides are non-zero.

There is an empty new line between each case.
Output

Output the area of the part of the field where little mammoth can eat grass. Your answer must be accurate up to 10-6.
There should be an empty new line between each case.
Example

Input Output
0 0 5
3 3 7 7
0.547426365104

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-29 15:48
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效