eolymp
bolt
Try our new interface for solving problems
Problems

Little Mammoth

Little Mammoth

Time limit 1 second
Memory limit 64 MiB

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 data

The first line of the input file contains x_c, y_c and r — coordinates of the entrance to the cave and the distance little mammoth is allowed to walk from it.

Next line contains x_1, y_1, x_2, and y_2 — 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.

Output data

Output the area of the part of the field where little mammoth can eat grass. Your answer must be accurate up to 10^{-6}.

Examples

Input example #1
0 0 5
3 3 7 7
Output example #1
0.5474263651
Source 2004 Petrozavodsk, Summer, Andrew Stankevich Contest 7, August 22, Problem F