Problem: Arkady reached the n-th level in Township game, so Masha decided to bake a pie for him! Of course, the pie has a shape of convex n-gon, i.e. a polygon with n vertices.

Arkady decided to cut the pie in two equal in area parts by cutting it by a straight line, so that he can eat one of them and give the other to Masha. There is a difficulty because Arkady has already put a knife at some point of the pie, so he now has to cut the pie by a straight line passing trough this point.

Help Arkady: find a line that passes through the point Arkady has put a knife into and cuts the pie into two parts of equal area, or determine that it's impossible. Your program has to quickly answer many queries with the same pie, but different points in which Arkady puts a knife.

Input

The first line contains two integers n and q (3 ≤ n ≤ 104, 1 ≤ q ≤ 105) — the number of vertices in the pie and the number of queries.

n line follow describing the polygon vertices in clockwise order. The i-th of these line contains two integers xi and yi ( - 106 ≤ xi, yi ≤ 106) — the coordinates of the i-th vertex. It is guaranteed that the polygon is strictly convex, in particular, no three vertices line on the same line.

An empty line follows.

q lines follow describing the query points. The i-th of these lines contain two integers xi and yi ( - 106 ≤ xi, yi ≤ 106) — the coordinates of the point in which Arkady puts the knife in the i-th query. In is guaranteed that in each query the given point is strictly inside the polygon, in particular, is not on its edges.

Output

For each query print single integer — the polar angle of the line that is the answer for the corresponding query, in radians. The angle should be in the segment [0;π], the angles are measured from the direction of OX axis in counter-clockwise order. For example, the polar angle of the OY axis is <image>. If there is no answer in that query, print -1.

If there are several answers, print any of them. Your answer is considered correct if the difference between the areas of the parts divided by the total area of the polygon doesn't exceed 10 - 4 by absolute value. In other words, if a and b are the areas of the parts after the cut, then your answer is correct if and only of <image>.

Examples

Input

3 1
0 0
0 3
3 0

1 1


Output

2.67794504460098710000


Input

5 3
6 5
6 3
5 0
0 0
0 5

5 4
3 3
5 2


Output

0.60228734612690049000
1.27933953226473580000
2.85805511179015910000

Solution (in JAVA):

Solution:
import java.util.*;

public class Test {

    class P {
        double x;
        double y;

        P(double xx, double yy) {
            x = xx;
            y = yy;
        }

        P (P a, P b) {
            x = b.x - a.x;
            y = b.y - a.y;
        }

        P() {
        }

        P set(double xx, double yy) {
            x = xx;
            y = yy;

            return this;
        }

        P set(P a, P b) {
            x = b.x - a.x;
            y = b.y - a.y;

            return this;
        }

        public String toString() {
            return "(" + x + "," + y + ")";
        }

    }

    class L {
        P d;
        P p;

        L(P p, P d) {
            this.p = p;
            this.d = d;

            this.a = d.y;
            this.b = -d.x;
            this.c = -a*p.x - b*p.y;
        }

        // ax + by + c = 0;
        double a, b, c;
    }

    int n, q;
    P[] p;
    double totalArea = 0;
    double[] areas;
    P d = new P();

    Scanner sca = new Scanner(System.in);

    void start() {
        n = sca.nextInt(); q = sca.nextInt();
        p = new P[n];
        for (int i = 0; i < n; i++)
            p[i] = new P(sca.nextInt(), sca.nextInt());

        areas = new double[n*4 + 1];

        for (int i = 0; i < 4*n; i++) {
            P p1 = p[(i + 1) % n], p0 = p[i % n];
            areas[i + 1] = areas[i] + (p1.x - p0.x)*(p1.y + p0.y);
        }

        for (int i = 0; i < n; i++) {
            P p1 = p[(i + 1) % n], p0 = p[i % n];
            totalArea = totalArea + (p1.x - p0.x)*(p1.y + p0.y);
        }

        for (int i = 0; i < q; i++) {
            P q = new P(sca.nextInt(), sca.nextInt());
            solve(q);
        }

    }

    P intersect(L l0, L l1) {
        double d = l0.a*l1.b - l0.b*l1.a;
        return new P((l0.b*l1.c - l0.c*l1.b) / d,
                (l0.c*l1.a - l0.a*l1.c) / d);
    }

    double ant(P v1, P v2) {
        return v1.x*v2.y - v1.y*v2.x;
    }

    void solve(P q) {
        double start = 0, end = Math.PI;
        double zero = 0;
        boolean found = false;
        double ans = -1;

        P p0 = new P(), p1 = new P(), p2 = new P();

        for (int it = 0; it < 60; it++) {
            double mid = (start + end) / 2;
            if (mid == start || mid == end) break;
            if (it == 0) mid = start;
            d.set(Math.cos(mid), d.y = Math.sin(mid));
            L l = new L(q, d);
            boolean reverse = false;
            if (ant(d, p0.set(p[0], p[1])) < 0) {
                d.x = -d.x; d.y = -d.y;
                l = new L(q, d);
                reverse = true;
            }
            int ll = 0, rr = n - 1;

            while (ll < rr) {
                int i = (ll + rr + 1) / 2;
                int j = (i + 1) % n;
                if (ant(d, p0.set(p[i], p[j])) >= 0 &&
                        ant(d, p0.set(p1.set(p[i], p[1]), p2.set(p[0], p[i]))) >= 0) ll = i;
                else rr = i - 1;
            }
            int maxId = (ll + 1) % n;
            ll = maxId + 1; rr = maxId + n - 1;
            while (ll < rr) {
                int i = (ll + rr) / 2;
                int j = i + 1;
                if (ant(d, p0.set(p[i % n], p[j % n])) < 0) ll = i + 1;
                else rr = i;
            }
            int minId = ll;
            int last, first;
            {
                ll = maxId; rr = minId;
                while (ll < rr) {
                    int i = (ll + rr + 1) / 2;
                    if (ant(d, p0.set(q, p[i % n])) > 0) ll = i;
                    else rr = i - 1;
                }
                last = ll + n;
            }
            {
                ll = minId; rr = maxId + n;
                while (ll < rr) {
                    int i = (ll + rr) / 2;
                    if (ant(d, p0.set(q, p[i % n])) <= 0) ll = i + 1;
                    else rr = i;
                }
                first = ll;
            }

            L lFirst = new L(p[first % n], new P(p[first % n], p[(first - 1) % n]));
            P inFirst = intersect(lFirst, l);
            L lLast = new L(p[last % n], new P(p[last % n], p[(last + 1) % n]));
            P inLast = intersect(lLast, l);
            double res = 0;
            res += (p[first % n].x - inFirst.x)*(p[first % n].y + inFirst.y);
            res += areas[last] - areas[first];
            res += (inLast.x - p[last % n].x)*(p[last % n].y + inLast.y);
            res += (inFirst.x - inLast.x)*(inFirst.y + inLast.y);
            if (reverse) {
                res = totalArea - res;
            }
            if (it == 0) {
                zero = res;
                continue;
            }
            {
                double res1 = 0.5*res;
                double res2 = 0.5*(totalArea - res);
                double diff = Math.abs(res1 - res2);
                double sum = 0.5*totalArea;
                if (diff / sum < 1e-4) {
                    found = true;
                    ans = mid;
                    break;
                }
            }
            if ((res > 0.5*totalArea) == (zero > 0.5*totalArea)) start = mid;
            else end = mid;
        }
        System.out.println(found ? ans : 0.5*(start + end));
    }

    public static void main(String[] args) {

        new Test().start();
    }
}