Circular Island#1924

Circular Island

6 seconds
256 megabytes
Very hard

Andrew has made a significant discovery in geography: he has found an island that was previously unknown to the civilized world. This island is a perfect circle and is inhabited by two tribes: Java and Seeplusplus. After a brief contact with the aborigines, Andrew learned that the boundary between the tribes' lands is a straight line. Moreover, he knows the locations of several Java villages and several Seeplusplus villages (each village is, of course, located within or on the boundary of the corresponding tribe's land). Now, he needs to determine the minimal and maximal possible area of Java's land. Help him!

Input

The first line contains an integer — the radius of the island (1 \le r \le 10^9). The next line contains an integer (1 \le n \le 50000) — the number of Java villages. Each of the next lines contains two integers and — the coordinates of Java villages. The following line contains an integer (1 \le m \le 50000) — the number of Seeplusplus villages. Each of the next lines contains two integers and — the coordinates of Seeplusplus villages. The center of the island has coordinates , each village is within the island and at least away from the island's boundary. No two villages coincide. The input is guaranteed to be valid: there will always exist at least one straight line separating the Java villages from the Seeplusplus villages.

Output

Print two floating-point numbers separated by a space: the minimal and maximal possible area of Java's land. The area will be considered correct if it is within 10^{-6} relative error of the correct answer.

Examples

Example 1

Loading
Loading