Sphere Pyramid#1436

Sphere Pyramid

1 secondo
64 megabyte
Molto facile

A science museum has an exhibition of decorative spheres arranged in the shape of a pyramid. Each sphere rests exactly on two spheres from the row below it. The spheres in the bottom row are fixed on the shelf, and each subsequent row has one sphere less than the previous row.

The base of each sphere is a circle of radius . The minimum distance between the centers of neighboring spheres is , and the maximum is .

You need to find the coordinates of the center of one of the spheres in the pyramid.

Input

The first line contains the number — the number of spheres in the bottom row. The next lines give the -coordinates of the centers of the spheres in the bottom row (the -coordinates of all these spheres are ). Each coordinate is a real number with exactly decimal places. The coordinates are given from left to right.

Next, two lines follow: the integer is the number of the row containing the target sphere. The rows are numbered from bottom to top, starting with one. The integer is the index of the target sphere in its row. The spheres in each row are numbered from left to right, starting with one.

Output

Output two numbers on two lines: the first line is the -coordinate of the center of the target sphere with exactly decimal places, and the second line is the -coordinate of the center of the target sphere with exactly decimal places.

To avoid the case when the required coordinates and are rounded in the wrong direction due to calculation errors, all tests satisfy the following condition: the numbers 1000 \cdot x and 1000 \cdot y are at least away from the closest half-integers (i.e. numbers of the form x + 0.5 for an integer ).

Constraints

  1. 1 \leq N \leq 5.

  2. Coordinates of bottom row spheres are real numbers from to inclusive, each with exactly digits after the decimal point. If and are two numbers in neighboring positions, then is between A + 2 and A + 3 inclusive.

  3. 1 \leq \mathrm{row} \leq N.

  4. 1 \leq \mathrm{index} \leq N - \mathrm{row} + 1.

Esempi

Esempio 1

Loading
Loading