#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int) 1e9 + 23111992;
const ll LINF = (ll) 1e18 + 23111992;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ull isqrt(ull k) {ull r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int myrand() {return abs((int) mt());}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

#define EPS 1e-9
struct point_t {
    double x, y;
    point_t() : x(0), y(0) {}
    point_t(double x, double y) : x(x), y(y) {}
    point_t(const point_t& p) : x(p.x), y(p.y) {}
    int operator < (const point_t& rhs) const {return make_pair(y, x) < make_pair(rhs.y, rhs.x);}
    int operator == (const point_t& rhs) const {return make_pair(y, x) == make_pair(rhs.y, rhs.x);}
    point_t operator + (const point_t& p) const {return point_t(x + p.x, y + p.y);}
    point_t operator - (const point_t& p) const {return point_t(x - p.x, y - p.y);}
    point_t operator * (double c) const {return point_t(x * c, y * c);}
    point_t operator / (double c) const {return point_t(x / c, y / c);}
};
double cross(point_t p, point_t q) {return p.x * q.y - p.y * q.x;}
double area(point_t a, point_t b, point_t c) {return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;}
double area2(point_t a, point_t b, point_t c) {return cross(a, b) + cross(b, c) + cross(c, a);}
double dot(point_t p, point_t q) {return p.x * q.x + p.y * q.y;}
double dist(point_t p, point_t q) {return sqrt(dot(p - q, p - q));}
double dist2(point_t p, point_t q) {return dot(p - q, p - q);}
point_t RotateCCW90(point_t p) {return point_t(-p.y, p.x);}
point_t RotateCW90(point_t p) {return point_t(p.y, -p.x);}
point_t RotateCCW(point_t p, double t) {return point_t(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));}
int sign(double x) {return x < -EPS ? -1 : x > EPS;}
int sign(double x, double y) {return sign(x - y);}
ostream& operator << (ostream& os, const point_t& p) {
    os << "(" << p.x << "," << p.y << ")";
    return os;
}

void chemthan() {
    int n, d; cin >> n >> d;
    static int a[234567];
    FOR(i, 0, n) cin >> a[i];
    int m; cin >> m;
    while (m--) {
        int x; cin >> x;
        int k = lower_bound(a, a + n, x) - a;
        if (k < n && a[k] == x) {
            if (k && a[k - 1] == x - 1) {
                cout << prec(9) << PI << "\n";
            }
            else {
                cout << prec(9) << PI / 2 << "\n";
            }
            continue;
        }
        if (k == 0) {
            cout << prec(9) << atan(1.0 / (a[k] - x)) << "\n";
        }
        else if (k == n) {
            if (x == a[n - 1] + 1) {
                cout << prec(9) << PI / 2 << "\n";
            }
            else {
                cout << prec(9) << atan(1.0 / (x - a[n - 1] - 1)) << "\n";
            }
        }
        else {
            int e = min(a[k] - x, x - a[k - 1] - 1);
            double res = e ? atan(1.0 / e) : PI / 2;
            static bitset<7000> f, g;
            f.reset(), g.reset();
            for (int i = k; i < k + 7000 && i < n && a[i] - x < 7000; ++i) {
                f[a[i] - x] = 1;
            }
            for (int i = k - 1; i > k - 7000 && i >= 0 && x - a[i] - 1 < 7000; --i) {
                g[x - a[i] - 1] = 1;
            }
            static vector<double> dp(7005, -1);
            auto func = [&] (int d) {
                double& res = dp[d];
                if (res != -1) return res;
                point_t p(d, -1);
                double l = 0, r = PI / 2;
                FOR(it, 0, 100) {
                    double m = (l + r) / 2;
                    point_t q = RotateCCW(p, m);
                    if (q.y < 1) {
                        l = m;
                    }
                    else {
                        r = m;
                    }
                }
                return res = (l + r) / 2;
            };
            int t = (f & g)._Find_first();
            if (t != -1) {
                chkmax(res, (double) atan(1.0 / t) * 2);
            }
            t = (f & (g << 1))._Find_first();
            if (t != 7000) {
                chkmax(res, func(t));
            }
            t = ((f << 1) & g)._Find_first();
            if (t != 7000) {
                chkmax(res, func(t));
            }
            cout << prec(9) << res << "\n";
        }
    }
}

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0), cin.tie(0);
    if (argc > 1) {
        assert(freopen(argv[1], "r", stdin));
    }
    if (argc > 2) {
        assert(freopen(argv[2], "wb", stdout));
    }
    chemthan();
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int) 1e9 + 23111992;
const ll LINF = (ll) 1e18 + 23111992;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ull isqrt(ull k) {ull r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int myrand() {return abs((int) mt());}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

#define EPS 1e-9
struct point_t {
    double x, y;
    point_t() : x(0), y(0) {}
    point_t(double x, double y) : x(x), y(y) {}
    point_t(const point_t& p) : x(p.x), y(p.y) {}
    int operator < (const point_t& rhs) const {return make_pair(y, x) < make_pair(rhs.y, rhs.x);}
    int operator == (const point_t& rhs) const {return make_pair(y, x) == make_pair(rhs.y, rhs.x);}
    point_t operator + (const point_t& p) const {return point_t(x + p.x, y + p.y);}
    point_t operator - (const point_t& p) const {return point_t(x - p.x, y - p.y);}
    point_t operator * (double c) const {return point_t(x * c, y * c);}
    point_t operator / (double c) const {return point_t(x / c, y / c);}
};
double cross(point_t p, point_t q) {return p.x * q.y - p.y * q.x;}
double area(point_t a, point_t b, point_t c) {return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;}
double area2(point_t a, point_t b, point_t c) {return cross(a, b) + cross(b, c) + cross(c, a);}
double dot(point_t p, point_t q) {return p.x * q.x + p.y * q.y;}
double dist(point_t p, point_t q) {return sqrt(dot(p - q, p - q));}
double dist2(point_t p, point_t q) {return dot(p - q, p - q);}
point_t RotateCCW90(point_t p) {return point_t(-p.y, p.x);}
point_t RotateCW90(point_t p) {return point_t(p.y, -p.x);}
point_t RotateCCW(point_t p, double t) {return point_t(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));}
int sign(double x) {return x < -EPS ? -1 : x > EPS;}
int sign(double x, double y) {return sign(x - y);}
ostream& operator << (ostream& os, const point_t& p) {
    os << "(" << p.x << "," << p.y << ")";
    return os;
}

void chemthan() {
    int n, d; cin >> n >> d;
    static int a[234567];
    FOR(i, 0, n) cin >> a[i];
    int m; cin >> m;
    while (m--) {
        int x; cin >> x;
        int k = lower_bound(a, a + n, x) - a;
        if (k < n && a[k] == x) {
            if (k && a[k - 1] == x - 1) {
                cout << prec(9) << PI << "\n";
            }
            else {
                cout << prec(9) << PI / 2 << "\n";
            }
            continue;
        }
        if (k == 0) {
            cout << prec(9) << atan(1.0 / (a[k] - x)) << "\n";
        }
        else if (k == n) {
            if (x == a[n - 1] + 1) {
                cout << prec(9) << PI / 2 << "\n";
            }
            else {
                cout << prec(9) << atan(1.0 / (x - a[n - 1] - 1)) << "\n";
            }
        }
        else {
            int e = min(a[k] - x, x - a[k - 1] - 1);
            double res = e ? atan(1.0 / e) : PI / 2;
            static bitset<8000> f, g;
            f.reset(), g.reset();
            for (int i = k; i < k + 8000 && i < n && a[i] - x < 8000; ++i) {
                f[a[i] - x] = 1;
            }
            for (int i = k - 1; i > k - 8000 && i >= 0 && x - a[i] - 1 < 8000; --i) {
                g[x - a[i] - 1] = 1;
            }
            auto func = [&] (int d) {
                point_t p(d, -1);
                double l = 0, r = PI / 2;
                FOR(it, 0, 50) {
                    double m = (l + r) / 2;
                    point_t q = RotateCCW(p, m);
                    if (q.y < 1) {
                        l = m;
                    }
                    else {
                        r = m;
                    }
                }
                return (l + r) / 2;
            };
            int t = (f & g)._Find_first();
            if (t != -1) {
                chkmax(res, (double) atan(1.0 / t) * 2);
            }
            t = (f & (g << 1))._Find_first();
            if (t != 8000) {
                chkmax(res, func(t));
            }
            t = ((f << 1) & g)._Find_first();
            if (t != 8000) {
                chkmax(res, func(t));
            }
            cout << prec(9) << res << "\n";
        }
    }
}

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0), cin.tie(0);
    if (argc > 1) {
        assert(freopen(argv[1], "r", stdin));
    }
    if (argc > 2) {
        assert(freopen(argv[2], "wb", stdout));
    }
    chemthan();
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int) 1e9 + 23111992;
const ll LINF = (ll) 1e18 + 23111992;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ull isqrt(ull k) {ull r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int myrand() {return abs((int) mt());}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

#define EPS 1e-9
struct point_t {
    double x, y;
    point_t() : x(0), y(0) {}
    point_t(double x, double y) : x(x), y(y) {}
    point_t(const point_t& p) : x(p.x), y(p.y) {}
    int operator < (const point_t& rhs) const {return make_pair(y, x) < make_pair(rhs.y, rhs.x);}
    int operator == (const point_t& rhs) const {return make_pair(y, x) == make_pair(rhs.y, rhs.x);}
    point_t operator + (const point_t& p) const {return point_t(x + p.x, y + p.y);}
    point_t operator - (const point_t& p) const {return point_t(x - p.x, y - p.y);}
    point_t operator * (double c) const {return point_t(x * c, y * c);}
    point_t operator / (double c) const {return point_t(x / c, y / c);}
};
double cross(point_t p, point_t q) {return p.x * q.y - p.y * q.x;}
double area(point_t a, point_t b, point_t c) {return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;}
double area2(point_t a, point_t b, point_t c) {return cross(a, b) + cross(b, c) + cross(c, a);}
double dot(point_t p, point_t q) {return p.x * q.x + p.y * q.y;}
double dist(point_t p, point_t q) {return sqrt(dot(p - q, p - q));}
double dist2(point_t p, point_t q) {return dot(p - q, p - q);}
point_t RotateCCW90(point_t p) {return point_t(-p.y, p.x);}
point_t RotateCW90(point_t p) {return point_t(p.y, -p.x);}
point_t RotateCCW(point_t p, double t) {return point_t(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));}
int sign(double x) {return x < -EPS ? -1 : x > EPS;}
int sign(double x, double y) {return sign(x - y);}
ostream& operator << (ostream& os, const point_t& p) {
    os << "(" << p.x << "," << p.y << ")";
    return os;
}

void chemthan() {
    int n, d; cin >> n >> d;
    static int a[234567];
    FOR(i, 0, n) cin >> a[i];
    int m; cin >> m;
    while (m--) {
        int x; cin >> x;
        int k = lower_bound(a, a + n, x) - a;
        if (k < n && a[k] == x) {
            if (k && a[k - 1] == x - 1) {
                cout << prec(9) << PI << "\n";
            }
            else {
                cout << prec(9) << PI / 2 << "\n";
            }
            continue;
        }
        if (k == 0) {
            cout << prec(9) << atan(1.0 / (a[k] - x)) << "\n";
        }
        else if (k == n) {
            if (x == a[n - 1] + 1) {
                cout << prec(9) << PI / 2 << "\n";
            }
            else {
                cout << prec(9) << atan(1.0 / (x - a[n - 1] - 1)) << "\n";
            }
        }
        else {
            int e = min(a[k] - x, x - a[k - 1] - 1);
            double res = e ? atan(1.0 / e) : PI / 2;
            static bitset<7500> f, g;
            f.reset(), g.reset();
            for (int i = k; i < k + 7500 && i < n && a[i] - x < 7500; ++i) {
                f[a[i] - x] = 1;
            }
            for (int i = k - 1; i > k - 7500 && i >= 0 && x - a[i] - 1 < 7500; --i) {
                g[x - a[i] - 1] = 1;
            }
            auto func = [&] (int d) {
                point_t p(d, -1);
                double l = 0, r = PI / 2;
                FOR(it, 0, 50) {
                    double m = (l + r) / 2;
                    point_t q = RotateCCW(p, m);
                    if (q.y < 1) {
                        l = m;
                    }
                    else {
                        r = m;
                    }
                }
                return (l + r) / 2;
            };
            int t = (f & g)._Find_first();
            if (t != -1) {
                chkmax(res, (double) atan(1.0 / t) * 2);
            }
            t = (f & (g << 1))._Find_first();
            if (t != 7500) {
                chkmax(res, func(t));
            }
            t = ((f << 1) & g)._Find_first();
            if (t != 7500) {
                chkmax(res, func(t));
            }
            cout << prec(9) << res << "\n";
        }
    }
}

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0), cin.tie(0);
    if (argc > 1) {
        assert(freopen(argv[1], "r", stdin));
    }
    if (argc > 2) {
        assert(freopen(argv[2], "wb", stdout));
    }
    chemthan();
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int) 1e9 + 23111992;
const ll LINF = (ll) 1e18 + 23111992;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ull isqrt(ull k) {ull r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int myrand() {return abs((int) mt());}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

#define EPS 1e-9
struct point_t {
    double x, y;
    point_t() : x(0), y(0) {}
    point_t(double x, double y) : x(x), y(y) {}
    point_t(const point_t& p) : x(p.x), y(p.y) {}
    int operator < (const point_t& rhs) const {return make_pair(y, x) < make_pair(rhs.y, rhs.x);}
    int operator == (const point_t& rhs) const {return make_pair(y, x) == make_pair(rhs.y, rhs.x);}
    point_t operator + (const point_t& p) const {return point_t(x + p.x, y + p.y);}
    point_t operator - (const point_t& p) const {return point_t(x - p.x, y - p.y);}
    point_t operator * (double c) const {return point_t(x * c, y * c);}
    point_t operator / (double c) const {return point_t(x / c, y / c);}
};
double cross(point_t p, point_t q) {return p.x * q.y - p.y * q.x;}
double area(point_t a, point_t b, point_t c) {return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;}
double area2(point_t a, point_t b, point_t c) {return cross(a, b) + cross(b, c) + cross(c, a);}
double dot(point_t p, point_t q) {return p.x * q.x + p.y * q.y;}
double dist(point_t p, point_t q) {return sqrt(dot(p - q, p - q));}
double dist2(point_t p, point_t q) {return dot(p - q, p - q);}
point_t RotateCCW90(point_t p) {return point_t(-p.y, p.x);}
point_t RotateCW90(point_t p) {return point_t(p.y, -p.x);}
point_t RotateCCW(point_t p, double t) {return point_t(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));}
int sign(double x) {return x < -EPS ? -1 : x > EPS;}
int sign(double x, double y) {return sign(x - y);}
ostream& operator << (ostream& os, const point_t& p) {
    os << "(" << p.x << "," << p.y << ")";
    return os;
}

void chemthan() {
    int n, d; cin >> n >> d;
    static int a[234567];
    FOR(i, 0, n) cin >> a[i];
    int m; cin >> m;
    while (m--) {
        int x; cin >> x;
        int k = lower_bound(a, a + n, x) - a;
        if (k < n && a[k] == x) {
            if (k && a[k - 1] == x - 1) {
                cout << prec(9) << PI << "\n";
            }
            else {
                cout << prec(9) << PI / 2 << "\n";
            }
            continue;
        }
        if (k == 0) {
            cout << prec(9) << atan(1.0 / (a[k] - x)) << "\n";
        }
        else if (k == n) {
            if (x == a[n - 1] + 1) {
                cout << prec(9) << PI / 2 << "\n";
            }
            else {
                cout << prec(9) << atan(1.0 / (x - a[n - 1] - 1)) << "\n";
            }
        }
        else {
            int e = min(a[k] - x, x - a[k - 1] - 1);
            double res = e ? atan(1.0 / e) : PI / 2;
            static bitset<7500> f, g;
            f.reset(), g.reset();
            for (int i = k; i < k + 7500 && i < n && a[i] - x < 7500; ++i) {
                f[a[i] - x] = 1;
            }
            for (int i = k - 1; i > k - 7500 && i >= 0 && x - a[i] - 1 < 7500; --i) {
                g[x - a[i] - 1] = 1;
            }
            auto func = [&] (int d) {
                point_t p(d, -1);
                double l = 0, r = PI / 2;
                FOR(it, 0, 40) {
                    double m = (l + r) / 2;
                    point_t q = RotateCCW(p, m);
                    if (q.y < 1) {
                        l = m;
                    }
                    else {
                        r = m;
                    }
                }
                return (l + r) / 2;
            };
            int t = (f & g)._Find_first();
            if (t != -1) {
                chkmax(res, (double) atan(1.0 / t) * 2);
            }
            t = (f & (g << 1))._Find_first();
            if (t != 7500) {
                chkmax(res, func(t));
            }
            t = ((f << 1) & g)._Find_first();
            if (t != 7500) {
                chkmax(res, func(t));
            }
            cout << prec(9) << res << "\n";
        }
    }
}

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0), cin.tie(0);
    if (argc > 1) {
        assert(freopen(argv[1], "r", stdin));
    }
    if (argc > 2) {
        assert(freopen(argv[2], "wb", stdout));
    }
    chemthan();
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int) 1e9 + 23111992;
const ll LINF = (ll) 1e18 + 23111992;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ull isqrt(ull k) {ull r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int myrand() {return abs((int) mt());}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

#define EPS 1e-9
struct point_t {
    double x, y;
    point_t() : x(0), y(0) {}
    point_t(double x, double y) : x(x), y(y) {}
    point_t(const point_t& p) : x(p.x), y(p.y) {}
    int operator < (const point_t& rhs) const {return make_pair(y, x) < make_pair(rhs.y, rhs.x);}
    int operator == (const point_t& rhs) const {return make_pair(y, x) == make_pair(rhs.y, rhs.x);}
    point_t operator + (const point_t& p) const {return point_t(x + p.x, y + p.y);}
    point_t operator - (const point_t& p) const {return point_t(x - p.x, y - p.y);}
    point_t operator * (double c) const {return point_t(x * c, y * c);}
    point_t operator / (double c) const {return point_t(x / c, y / c);}
};
double cross(point_t p, point_t q) {return p.x * q.y - p.y * q.x;}
double area(point_t a, point_t b, point_t c) {return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;}
double area2(point_t a, point_t b, point_t c) {return cross(a, b) + cross(b, c) + cross(c, a);}
double dot(point_t p, point_t q) {return p.x * q.x + p.y * q.y;}
double dist(point_t p, point_t q) {return sqrt(dot(p - q, p - q));}
double dist2(point_t p, point_t q) {return dot(p - q, p - q);}
point_t RotateCCW90(point_t p) {return point_t(-p.y, p.x);}
point_t RotateCW90(point_t p) {return point_t(p.y, -p.x);}
point_t RotateCCW(point_t p, double t) {return point_t(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));}
int sign(double x) {return x < -EPS ? -1 : x > EPS;}
int sign(double x, double y) {return sign(x - y);}
ostream& operator << (ostream& os, const point_t& p) {
    os << "(" << p.x << "," << p.y << ")";
    return os;
}

void chemthan() {
    int n, d; cin >> n >> d;
    static int a[234567];
    FOR(i, 0, n) cin >> a[i];
    int m; cin >> m;
    while (m--) {
        int x; cin >> x;
        int k = lower_bound(a, a + n, x) - a;
        if (k < n && a[k] == x) {
            if (k && a[k - 1] == x - 1) {
                cout << prec(9) << PI << "\n";
            }
            else {
                cout << prec(9) << PI / 2 << "\n";
            }
            continue;
        }
        if (k == 0) {
            cout << prec(9) << atan(1.0 / (a[k] - x)) << "\n";
        }
        else if (k == n) {
            if (x == a[n - 1] + 1) {
                cout << prec(9) << PI / 2 << "\n";
            }
            else {
                cout << prec(9) << atan(1.0 / (x - a[n - 1] - 1)) << "\n";
            }
        }
        else {
            int e = min(a[k] - x, x - a[k - 1] - 1);
            double res = e ? atan(1.0 / e) : PI / 2;
            static bitset<8000> f, g;
            f.reset(), g.reset();
            for (int i = k; i < k + 8000 && i < n && a[i] - x < 8000; ++i) {
                f[a[i] - x] = 1;
            }
            for (int i = k - 1; i > k - 8000 && i >= 0 && x - a[i] - 1 < 8000; --i) {
                g[x - a[i] - 1] = 1;
            }
            auto func = [&] (int d) {
                point_t p(d, -1);
                double l = 0, r = PI / 2;
                FOR(it, 0, 30) {
                    double m = (l + r) / 2;
                    point_t q = RotateCCW(p, m);
                    if (q.y < 1) {
                        l = m;
                    }
                    else {
                        r = m;
                    }
                }
                return (l + r) / 2;
            };
            int t = (f & g)._Find_first();
            if (t != -1) {
                chkmax(res, (double) atan(1.0 / t) * 2);
            }
            t = (f & (g << 1))._Find_first();
            if (t != 8000) {
                chkmax(res, func(t));
            }
            t = ((f << 1) & g)._Find_first();
            if (t != 8000) {
                chkmax(res, func(t));
            }
            cout << prec(9) << res << "\n";
        }
    }
}

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0), cin.tie(0);
    if (argc > 1) {
        assert(freopen(argv[1], "r", stdin));
    }
    if (argc > 2) {
        assert(freopen(argv[2], "wb", stdout));
    }
    chemthan();
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")

#define ms(s, n) memset(s, n, sizeof(s))
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORd(i, a, b) for (int i = (a) - 1; i >= (b); --i)
#define FORall(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); ++it)
#define sz(a) int((a).size())
#define present(t, x) (t.find(x) != t.end())
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define prec(n) fixed<<setprecision(n)
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
const int MOD = (int) 1e9 + 7;
const int FFTMOD = 119 << 23 | 1;
const int INF = (int) 1e9 + 23111992;
const ll LINF = (ll) 1e18 + 23111992;
const ld PI = acos((ld) -1);
const ld EPS = 1e-9;
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline ll fpow(ll n, ll k, int p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
template<class T> inline int chkmin(T& a, const T& val) {return val < a ? a = val, 1 : 0;}
template<class T> inline int chkmax(T& a, const T& val) {return a < val ? a = val, 1 : 0;}
inline ull isqrt(ull k) {ull r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline int mult(int a, int b, int p = MOD) {return (ll) a * b % p;}
inline int inv(int a, int p = MOD) {return fpow(a, p - 2, p);}
inline int sign(ld x) {return x < -EPS ? -1 : x > +EPS;}
inline int sign(ld x, ld y) {return sign(x - y);}
mt19937 mt(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int myrand() {return abs((int) mt());}
#define db(x) cerr << #x << " = " << (x) << " ";
#define endln cerr << "\n";

#define EPS 1e-9
struct point_t {
    double x, y;
    point_t() : x(0), y(0) {}
    point_t(double x, double y) : x(x), y(y) {}
    point_t(const point_t& p) : x(p.x), y(p.y) {}
    int operator < (const point_t& rhs) const {return make_pair(y, x) < make_pair(rhs.y, rhs.x);}
    int operator == (const point_t& rhs) const {return make_pair(y, x) == make_pair(rhs.y, rhs.x);}
    point_t operator + (const point_t& p) const {return point_t(x + p.x, y + p.y);}
    point_t operator - (const point_t& p) const {return point_t(x - p.x, y - p.y);}
    point_t operator * (double c) const {return point_t(x * c, y * c);}
    point_t operator / (double c) const {return point_t(x / c, y / c);}
};
double cross(point_t p, point_t q) {return p.x * q.y - p.y * q.x;}
double area(point_t a, point_t b, point_t c) {return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;}
double area2(point_t a, point_t b, point_t c) {return cross(a, b) + cross(b, c) + cross(c, a);}
double dot(point_t p, point_t q) {return p.x * q.x + p.y * q.y;}
double dist(point_t p, point_t q) {return sqrt(dot(p - q, p - q));}
double dist2(point_t p, point_t q) {return dot(p - q, p - q);}
point_t RotateCCW90(point_t p) {return point_t(-p.y, p.x);}
point_t RotateCW90(point_t p) {return point_t(p.y, -p.x);}
point_t RotateCCW(point_t p, double t) {return point_t(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));}
int sign(double x) {return x < -EPS ? -1 : x > EPS;}
int sign(double x, double y) {return sign(x - y);}
ostream& operator << (ostream& os, const point_t& p) {
    os << "(" << p.x << "," << p.y << ")";
    return os;
}

void chemthan() {
    int n, d; cin >> n >> d;
    static int a[234567];
    FOR(i, 0, n) cin >> a[i];
    int m; cin >> m;
    while (m--) {
        int x; cin >> x;
        int k = lower_bound(a, a + n, x) - a;
        if (k < n && a[k] == x) {
            if (k && a[k - 1] == x - 1) {
                cout << prec(9) << PI << "\n";
            }
            else {
                cout << prec(9) << PI / 2 << "\n";
            }
            continue;
        }
        if (k == 0) {
            cout << prec(9) << atan(1.0 / (a[k] - x)) << "\n";
        }
        else if (k == n) {
            if (x == a[n - 1] + 1) {
                cout << prec(9) << PI / 2 << "\n";
            }
            else {
                cout << prec(9) << atan(1.0 / (x - a[n - 1] - 1)) << "\n";
            }
        }
        else {
            int e = min(a[k] - x, x - a[k - 1] - 1);
            double res = e ? atan(1.0 / e) : PI / 2;
            static bitset<8000> f, g;
            f.reset(), g.reset();
            for (int i = k; i < k + 8000 && i < n && a[i] - x < 8000; ++i) {
                f[a[i] - x] = 1;
            }
            for (int i = k - 1; i > k - 8000 && i >= 0 && x - a[i] - 1 < 8000; --i) {
                g[x - a[i] - 1] = 1;
            }
            auto func = [&] (int d) {
                point_t p(d, -1);
                double l = 0, r = PI / 2;
                FOR(it, 0, 30) {
                    double m = (l + r) / 2;
                    point_t q = RotateCCW(p, m);
                    if (q.y < 1) {
                        l = m;
                    }
                    else {
                        r = m;
                    }
                }
                return (l + r) / 2;
            };
            int t = (f & g)._Find_first();
            if (t != -1) {
                chkmax(res, (double) atan(1.0 / t) * 2);
            }
            t = (f & (g << 1))._Find_first();
            if (t != 8000) {
                chkmax(res, func(t));
            }
            t = ((f << 1) & g)._Find_first();
            if (t != 8000) {
                chkmax(res, func(t));
            }
            cout << prec(9) << res << "\n";
        }
    }
}

int main(int argc, char* argv[]) {
    ios_base::sync_with_stdio(0), cin.tie(0);
    if (argc > 1) {
        assert(freopen(argv[1], "r", stdin));
    }
    if (argc > 2) {
        assert(freopen(argv[2], "wb", stdout));
    }
    chemthan();
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


#include <algorithm>
#include <cassert>
#include <cmath>
#include <iostream>
#include <vector>
using namespace std;

namespace IO {
const int BUFFER_SIZE = 1 << 15;

char input_buffer[BUFFER_SIZE];
int input_pos = 0, input_len = 0;

char output_buffer[BUFFER_SIZE];
int output_pos = 0;

char number_buffer[100];
uint8_t lookup[100];

void _update_input_buffer() {
    input_len = fread(input_buffer, sizeof(char), BUFFER_SIZE, stdin);
    input_pos = 0;

    if (input_len == 0)
        input_buffer[0] = EOF;
}

inline char next_char(bool advance = true) {
    if (input_pos >= input_len)
        _update_input_buffer();

    return input_buffer[advance ? input_pos++ : input_pos];
}

template <typename T>
inline void read_int(T &number) {
    bool negative = false;
    number = 0;

    while (!isdigit(next_char(false)))
        if (next_char() == '-')
            negative = true;

    do {
        number = 10 * number + (next_char() - '0');
    } while (isdigit(next_char(false)));

    if (negative)
        number = -number;
}

template <typename T, typename... Args>
inline void read_int(T &number, Args &... args) {
    read_int(number);
    read_int(args...);
}

inline void read_double(double &number) {
    bool negative = false;
    number = 0;

    while (!isdigit(next_char(false)))
        if (next_char() == '-')
            negative = true;

    do {
        number = 10 * number + (next_char() - '0');
    } while (isdigit(next_char(false)));

    if (next_char(false) == '.') {
        next_char();

        for (double multiplier = 0.1; isdigit(next_char(false)); multiplier *= 0.1)
            number += multiplier * (next_char() - '0');
    }

    if (negative)
        number = -number;
}

void _flush_output() {
    fwrite(output_buffer, sizeof(char), output_pos, stdout);
    output_pos = 0;
}

inline void write_char(char c) {
    if (output_pos == BUFFER_SIZE)
        _flush_output();

    output_buffer[output_pos++] = c;
}

template <typename T>
inline void write_int(T number, char after = '\0') {
    if (number < 0) {
        write_char('-');
        number = -number;
    }

    int length = 0;

    while (number >= 10) {
        uint8_t lookup_value = lookup[number % 100];
        number /= 100;
        number_buffer[length++] = (lookup_value & 15) + '0';
        number_buffer[length++] = (lookup_value >> 4) + '0';
    }

    if (number != 0 || length == 0)
        write_char(number + '0');

    for (int i = length - 1; i >= 0; i--) write_char(number_buffer[i]);

    if (after)
        write_char(after);
}

inline void write_double(double number, char after = '\0', int places = 6) {
    if (number < 0) {
        write_char('-');
        number = -number;
    }

    assert(number <= 9e18);

    number += 0.5 * pow(0.1, places);
    long long floored = (long long)number;
    write_int(floored);

    if (places > 0) {
        write_char('.');
        number = (number - floored) * pow(10.0, places);
        floored = (long long)number;
        int length = 0;

        for (int i = 0; i < places / 2; i++) {
            uint8_t lookup_value = lookup[floored % 100];
            floored /= 100;
            number_buffer[length++] = (lookup_value & 15) + '0';
            number_buffer[length++] = (lookup_value >> 4) + '0';
        }

        if (places % 2)
            number_buffer[length++] = floored + '0';

        assert(length == places);

        for (int i = places - 1; i >= 0; i--) write_char(number_buffer[i]);
    }

    if (after)
        write_char(after);
}

void init() {
    bool exit_success = atexit(_flush_output) == 0;
    assert(exit_success);

    for (int i = 0; i < 100; i++) lookup[i] = (i / 10 << 4) + i % 10;
}
}

const int OFFSET = 5;
const int D_MAX = 7050;
const int INF = 1e9 + 5;

int N;
vector<int> A;
double angle_save[D_MAX];

inline double single_angle(int distance) {
    if (angle_save[distance] < 0)
        angle_save[distance] = atan2(1, distance);

    return angle_save[distance];
}

double solve(int x) {
    static int index = 0;

    while (index < N && A[index] < x) index++;

    int left = index - 1, right = index;
    int left_dist = INF, right_dist = INF;
    double answer = 0;

    if (left >= 0)
        left_dist = x - 1 - A[left];

    if (right < N)
        right_dist = A[right] - x;

    int start_dist = min(left_dist, right_dist);
    answer = single_angle(start_dist);

    while (left >= 0 && right < N) {
        left_dist = x - 1 - A[left];
        right_dist = A[right] - x;

        if (max(left_dist, right_dist) > 2 * start_dist + OFFSET)
            break;

        if (abs(left_dist - right_dist) <= 1) {
            answer = max(answer, 2 * single_angle(max(left_dist, right_dist)));
            break;
        }

        if (left_dist < right_dist)
            left--;
        else
            right++;
    }
    return answer;
}
int main() {
    IO::init();
    fill(angle_save, angle_save + D_MAX, -1);
    int D;
    IO::read_int(N, D);
    A.resize(N);
    for (int &a : A) IO::read_int(a);
    int M;
    IO::read_int(M);
    while (M-- > 0) {
        int x;
        IO::read_int(x);
        IO::write_double(solve(x), '\n', 9);
    }
    return 0;
}


#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;

const double PI = 2 * acosl(0);

double get_angle(int distance) {
	return asinl(1.L /
		sqrt((long double) distance * distance + 1));
}

int main() {
	debug() << imie(PI);
	int n, magic_d;
	scanf("%d%d", &n, &magic_d);
	vector<int> a(n);
	vector<int> s;
	//~ set<int> s;
	for(int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
		s.push_back(a[i]);
		s.push_back(a[i]+1);
		//~ s.insert(a[i]);
		//~ s.insert(a[i] + 1);
	}

	sort(s.begin(), s.end());
	s.resize( unique(s.begin(), s.end()) - s.begin() );

	int a_i = 0, s_i = 0;

	int q;
	scanf("%d", &q);
	while(q--) {
		int x;
		scanf("%d", &x);
		while(a_i < n && a[a_i] < x) {
			++a_i;
		}
		while(s_i < (int) s.size() && s[s_i] < x) {
			++s_i;
		}
		// a_i is the first building that is
		// on the right from x
		if(a_i == n || a_i == 0) {
			printf("%.10lf\n", PI / 2);
			continue;
		}
		assert(1 <= a_i && a_i <= n - 1);
		assert(a[a_i] >= x);
		if(x == a[a_i] && x == a[a_i-1] + 1) {
			printf("%.10lf\n", PI);
			continue;
		}
		int distance = min(a[a_i] - x, x - a[a_i-1] - 1);
		double answer = get_angle(distance);

		// two pointers
		int A = s_i - 1;
		for(int B = s_i; B < (int) s.size(); ++B) {
			if(s[B] - x >= 2 * distance) {
				break;
			}
			while(A >= 0 && s[B] - x > x - s[A]) {
				--A;
			}
			if(A < 0) {
				break;
			}
			if(s[B] - x == x - s[A]) {
				answer = max(answer, 2 * get_angle(x - s[A]));
				break;
			}
		}

		//~ for(int d = 1; d <= magic_d * 2; ++d) {
			//~ if(s.count(x + d) && s.count(x - d)) {
				//~ answer = max(answer, 2 * get_angle(d));
			//~ }
		//~ }
		printf("%.10lf\n", answer);
	}
}


#include "bits/stdc++.h"
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

using ll = long long;

const double PI = 2 * acosl(0);

double get_angle(int distance) {
	return asinl(1.L /
		sqrt((long double) distance * distance + 1));
}

int main() {
	debug() << imie(PI);
	int n, magic_d;
	scanf("%d%d", &n, &magic_d);
	vector<int> a(n);
	vector<int> s;
	//~ set<int> s;
	for(int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
		s.push_back(a[i]);
		s.push_back(a[i]+1);
		//~ s.insert(a[i]);
		//~ s.insert(a[i] + 1);
	}

	sort(s.begin(), s.end());
	s.resize( unique(s.begin(), s.end()) - s.begin() );

	int a_i = 0, s_i = 0;

	int q;
	scanf("%d", &q);
	while(q--) {
		int x;
		scanf("%d", &x);
		while(a_i < n && a[a_i] < x) {
			++a_i;
		}
		while(s_i < (int) s.size() && s[s_i] < x) {
			++s_i;
		}
		// a_i is the first building that is
		// on the right from x
		if(a_i == n || a_i == 0) {
			printf("%.10lf\n", PI / 2);
			continue;
		}
		assert(1 <= a_i && a_i <= n - 1);
		assert(a[a_i] >= x);
		if(x == a[a_i] && x == a[a_i-1] + 1) {
			printf("%.10lf\n", PI);
			continue;
		}
		int distance = min(a[a_i] - x, x - a[a_i-1] - 1);
		double answer = get_angle(distance);

		// two pointers
		int A = s_i - 1;
		for(int B = s_i; B < (int) s.size(); ++B) {
			if(s[B] - x >= 2 * distance + 2) {
				break;
			}
			while(A >= 0 && s[B] - x > x - s[A]) {
				--A;
			}
			if(A < 0) {
				break;
			}
			if(s[B] - x == x - s[A]) {
				answer = max(answer, 2 * get_angle(x - s[A]));
				break;
			}
		}

		//~ for(int d = 1; d <= magic_d * 2; ++d) {
			//~ if(s.count(x + d) && s.count(x - d)) {
				//~ answer = max(answer, 2 * get_angle(d));
			//~ }
		//~ }
		printf("%.10lf\n", answer);
	}
}


//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=1000*1007;
using ld=long double;
const ld pi=2*acosl(0);

int n, d;
ll tab[nax];

int q;

ld kont(int a)
{
	return atan(1.0/a);
}

ld kont(int a, int b)
{
	assert(abs(a-b)<=1);
	return 2*kont(max(a, b));
}

void out(ld v)
{
	printf("%.11lf\n", (double)v);
}

void query()
{
	ll x;
	scanf("%lld", &x);
	if (x==tab[0] || x==tab[n]+1)
	{
		out(pi/2);
		return;
	}
	int bsa=1;
	int bsb=n-1;
	while(bsa<bsb)
	{
		int bss=(bsa+bsb+2)>>1;
		if (x>tab[bss])
			bsa=bss;
		else
			bsb=bss-1;
	}
	int g=bsa;
	assert(x>tab[g] && x<=tab[g+1]);
	if (x==tab[g]+1 && x==tab[g+1])
	{
		out(pi);
		return;
	}
	if (x==tab[g]+1 || x==tab[g+1])
	{
		out(pi/2);
		return;
	}
	ld wyn=kont(min(tab[g+1]-x, x-tab[g]-1));
	int a=g;
	int b=g+1;
	const ll lim=min(tab[g+1]-x, x-tab[g]-1)*2+7;
	while(a>0 && b<=n && tab[b]-x<=lim)
	{
		if (abs( (x-tab[a]-1)-(tab[b]-x) )<=1)
			break;
		if (x-tab[a]-1<tab[b]-x)
			a--;
		else
			b++;
	}
	if (a>=1 && b<=n && abs( (x-tab[a]-1)-(tab[b]-x) )<=1)
		wyn=max(wyn, kont(x-tab[a]-1, tab[b]-x));
	out(wyn);
}

int main()
{
	scanf("%d%d", &n, &d);
	for (int i=1; i<=n; i++)
		scanf("%lld", &tab[i]);
	scanf("%d", &q);
	while(q--)
		query();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

const int MXN = 2e5;
const int MXD = 10;

int a[MXN];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(15);

	int n, d;
	cin >> n >> d;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}

	int m, cur = -MXD, l = 0, r = 0;
	bitset<MXD> left, right;
	cin >> m;
	while (m--) {
		int x;
		cin >> x;

		left <<= x - cur;
		while (l < n && a[l] < x) {
			if (x - a[l] > MXD) {
				++l;
				continue;
			}
			left[x - a[l] - 1] = 1;
			++l;
		}
		right >>= x - cur;
		while (r < n && a[r] < x + MXD) {
			if (a[r] < x) {
				++r;
				continue;
			}
			right[a[r] - x] = 1;
			++r;
		}
		cur = x;

		int s = min(left._Find_first(), right._Find_first());
		int d = min({(left & right)._Find_first(), ((left << 1) & right)._Find_first(), ((right << 1) & left)._Find_first()});
		double ans = atan2(1, s);
		if (d < MXD) {
			ans = max(ans, 2 * atan2(1, d));
		}

		cout << ans << '\n';
	}
}


#include <bits/stdc++.h>
using namespace std;

const int MXN = 2e5;
const int MXD = 7500;

int a[MXN];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(15);

	int n, d;
	cin >> n >> d;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}

	int m, cur = -MXD, l = 0, r = 0;
	bitset<MXD> left, right;
	cin >> m;
	while (m--) {
		int x;
		cin >> x;

		left <<= x - cur;
		while (l < n && a[l] < x) {
			if (x - a[l] > MXD) {
				++l;
				continue;
			}
			left[x - a[l] - 1] = 1;
			++l;
		}
		right >>= x - cur;
		while (r < n && a[r] < x + MXD) {
			if (a[r] < x) {
				++r;
				continue;
			}
			right[a[r] - x] = 1;
			++r;
		}
		cur = x;

		int s = min(left._Find_first(), right._Find_first());
		int d = min({(left & right)._Find_first(), ((left << 1) & right)._Find_first(), ((right << 1) & left)._Find_first()});
		double ans = atan2(1, s);
		if (d < MXD) {
			ans = max(ans, 2 * atan2(1, d));
		}

		cout << ans << '\n';
	}
}


/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <bitset>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 2e5 + 10, D = 2 * 7e3 + 10;

ll a[N];
bitset<D> to_left, to_right;

int main() {
	fast_cin();
	int n, d;
	cin >> n >> d;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	int m; cin >> m;
	int x = 0, r = 0, p = 1;
	while (m--) {
		int nx; cin >> nx;
		while (x < nx) {
			if (p <= n and nx > a[p]) {
				int shift = a[p] + 1 - x;
				x += shift;
				to_right >>= shift;
				to_left <<= shift;
				to_left[0] = 1;
				to_left[1] = 1;
				++p;
				to_right[0] = (p <= n and a[p] == x);
			} else {
				int shift = nx - x;
				x += shift;
				to_right >>= shift;
				to_left <<= shift;
			}
		}
		while (r + 1 <= n) {
			if (a[r + 1] < x) {
				++r;
				continue;
			} else if (a[r + 1] - x < D - 1) {
				to_right[a[r + 1] - x] = 1;
				to_right[a[r + 1] - x + 1] = 1;
				++r;
			} else {
				break;
			}
		}
		int cand = min(to_left._Find_first(), to_right._Find_first());
		ld ans = atan2(1, cand);
		cand = (to_left & to_right)._Find_first();
		// cand = min(cand, int((to_left & (to_right << 1))._Find_first()));
		// cand = min(cand, int(((to_left << 1) & to_right)._Find_first()));
		ans = max(ans, ld(2 * atan2(1, cand)));
		cout << fixed << setprecision(15) << ans << '\n';
	}
}


/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <bitset>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 2e5 + 10, D = 2 * 7e3 + 10;

ll a[N];
bitset<D> to_left, to_right;

int main() {
	fast_cin();
	int n, d;
	cin >> n >> d;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	int m; cin >> m;
	int x = 0, r = 0, p = 1;
	while (m--) {
		int nx; cin >> nx;
		while (x < nx) {
			if (p <= n and nx > a[p]) {
				int shift = a[p] + 1 - x;
				x += shift;
				to_right >>= shift;
				to_left <<= shift;
				to_left[0] = 1;
				++p;
			} else {
				int shift = nx - x;
				x += shift;
				to_right >>= shift;
				to_left <<= shift;
			}
		}
		while (r + 1 <= n) {
			if (a[r + 1] < x) {
				++r;
				continue;
			} else if (a[r + 1] - x < D) {
				to_right[a[r + 1] - x] = 1;
				++r;
			} else {
				break;
			}
		}
		int cand = min(to_left._Find_first(), to_right._Find_first());
		ld ans = atan2(1, cand);
		cand = (to_left & to_right)._Find_first();
		cand = min(cand, int((to_left & (to_right << 1))._Find_first()));
		cand = min(cand, int(((to_left << 1) & to_right)._Find_first()));
		ans = max(ans, ld(2 * atan2(1, cand)));
		cout << fixed << setprecision(15) << ans << '\n';
	}
}


/* cerberus97 - Hanit Banga */

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <bitset>

using namespace std;

#define pb push_back
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)

typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

const int N = 1e5 + 10, D = 2 * 7e3 + 10;

ll a[N];
bitset<D> to_left, to_right;

int main() {
	fast_cin();
	int n, d;
	cin >> n >> d;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}
	int m; cin >> m;
	int x = 0, r = 0, p = 1;
	while (m--) {
		int nx; cin >> nx;
		while (x < nx) {
			if (p <= n and nx > a[p]) {
				int shift = a[p] + 1 - x;
				x += shift;
				to_right >>= shift;
				to_left <<= shift;
				to_left[0] = 1;
				++p;
			} else {
				int shift = nx - x;
				x += shift;
				to_right >>= shift;
				to_left <<= shift;
			}
		}
		while (r + 1 <= n) {
			if (a[r + 1] < x) {
				++r;
				continue;
			} else if (a[r + 1] - x < D) {
				to_right[a[r + 1] - x] = 1;
				++r;
			} else {
				break;
			}
		}
		int cand = min(to_left._Find_first(), to_right._Find_first());
		ld ans = atan2(1, cand);
		cand = (to_left & to_right)._Find_first();
		cand = min(cand, int((to_left & (to_right << 1))._Find_first()));
		cand = min(cand, int(((to_left << 1) & to_right)._Find_first()));
		ans = max(ans, ld(2 * atan2(1, cand)));
		cout << fixed << setprecision(15) << ans << '\n';
	}
}


#include<bits/stdc++.h>

using namespace std;
#define ll long long

inline char read() {
	static const int IN_LEN = 1000000;
	static char buf[IN_LEN], *s, *t;
	return (s==t?t=(s=buf)+fread(buf,1,IN_LEN,stdin),(s==t?-1:*s++):*s++);
}
template<class T>
inline void read(T &x) {
	static bool iosig;
	static char c;
	for (iosig=false, c=read(); !isdigit(c); c=read()) {
		if (c == '-') iosig=true;
		if (c == -1) return;
	}
	for (x=0; isdigit(c); c=read()) x=((x+(x<<2))<<1)+(c^'0');
	if (iosig) x=-x;
}

const double Pi = acos(-1);
const int N = 200005, M = 7008;
int n, d, m, a[N<<1];
bitset<M> l, r;
int main() {
	read(n), read(d);
	for(int i=1, x=0; i<=n; ++i) read(x), a[i*2-1]=x, a[i*2]=x+1;
	read(m);
	int x=1, y=1, p=0, last=0;
	while(m--){
		read(p), l<<=p-last, r>>=p-last, last=p;
		for(; x<=n<<1 && a[x]<=p; x++) if(p-a[x]<M) l[p-a[x]]=1;
		for(; y<=n<<1 && a[y]-p<M; y++) if(p<=a[y]) r[a[y++]-p]=1;
		if(x>2 && a[x-1]==p && a[x-2]==p) printf("%.15lf\n", Pi);
		else if(l[0]) printf("%.15lf\n", Pi/2);
		else printf("%.15lf\n", max(atan(1./min(l._Find_first(), r._Find_first())), 2*atan(1./(l&r)._Find_first())));
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
#define ll long long

inline char read() {
	static const int IN_LEN = 1000000;
	static char buf[IN_LEN], *s, *t;
	return (s==t?t=(s=buf)+fread(buf,1,IN_LEN,stdin),(s==t?-1:*s++):*s++);
}
template<class T>
inline void read(T &x) {
	static bool iosig;
	static char c;
	for (iosig=false, c=read(); !isdigit(c); c=read()) {
		if (c == '-') iosig=true;
		if (c == -1) return;
	}
	for (x=0; isdigit(c); c=read()) x=((x+(x<<2))<<1)+(c^'0');
	if (iosig) x=-x;
}

const double Pi = acos(-1);
const int N = 200005, M = 7008;
int n, d, m, a[N<<1];
bitset<M> l, r;
int main() {
	read(n), read(d);
	for(int i=1, x=0; i<=n; ++i) read(x), a[i*2-1]=x, a[i*2]=x+1;
	read(m);
	int x=1, y=1, p=0, last=0;
	while(m--){
		read(p), l<<=p-last, r>>=p-last, last=p;
		for(; x<=n<<1 && a[x]<=p; x++) if(p-a[x]<M) l[p-a[x]]=1;
		for(; y<=n<<1 && a[y]-p<M; y++) if(p<=a[y]) r[a[y]-p]=1;
		if(x>2 && a[x-1]==p && a[x-2]==p) printf("%.15lf\n", Pi);
		else if(l[0]) printf("%.15lf\n", Pi/2);
		else printf("%.15lf\n", max(atan(1./min(l._Find_first(), r._Find_first())), 2*atan(1./(l&r)._Find_first())));
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const ll INF = 1e18;

int main() {
    ll n, d;
    cin >> n >> d;
    VL a(n);
    REP(i,n) a[i] = lin();
    int m;
    cin >> m;
    VL p(m);
    REP(i,m) p[i] = lin();

    VD at(d + 1);
    REP(i,d+1) at[i] = atan2(1, i);

    int j = 0;
    REP(i,m){
        ll x = p[i];
        while (j < n && a[j] < x) j++;
        ll mi = INF;
        if (j < n) chmin(mi, a[j] - x);
        if (j > 0) chmin(mi, x - a[j - 1] - 1);
        double ans = at[mi];
        int jr = j;
        for (int jl = j - 1; jl >= 0 && x - a[jl] - 1 <= d; jl--){
            ll dl = x - a[jl] - 1;
            while (jr < n && a[jr] - x < dl - 1) jr++;
            if (jr == n || a[jr] - x >= d + 1) break;
            ll dr = a[jr] - x;
            if (abs(dl - dr) <= 1){
                chmax(ans, 2 * at[max(dl, dr)]);
                break;
            }
        }
        printf("%.15f\n", ans);
    }

    return 0;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const ll INF = 1e18;

int main() {
    ll n, d;
    cin >> n >> d;
    VL a(n);
    REP(i,n) a[i] = lin();
    int m;
    cin >> m;
    VL p(m);
    REP(i,m) p[i] = lin();

    int j = 0;
    REP(i,m){
        ll x = p[i];
        while (j < n && a[j] < x) j++;
        ll mi = INF;
        if (j < n) chmin(mi, a[j] - x);
        if (j > 0) chmin(mi, x - a[j - 1] - 1);
        double ans = atan2(1, mi);
        int jr = j;
        for (int jl = j - 1; jl >= 0 && x - a[jl] - 1 <= d; jl--){
            ll dl = x - a[jl] - 1;
            while (jr < n && a[jr] - x < dl - 1) jr++;
            if (jr == n || a[jr] - x >= d + 1) break;
            ll dr = a[jr] - x;
            if (abs(dl - dr) <= 1){
                chmax(ans, 2 * atan2(1, max(dl, dr)));
                break;
            }
        }
        printf("%.15f\n", ans);
    }

    return 0;


#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const ll INF = 1e18;

int main() {
    ll n, d;
    cin >> n >> d;
    VL a(n);
    REP(i,n) a[i] = lin();
    int m;
    cin >> m;
    VL p(m);
    REP(i,m) p[i] = lin();

    int j = 0;
    REP(i,m){
        ll x = p[i];
        while (j < n && a[j] < x) j++;
        ll mi = INF;
        if (j < n) chmin(mi, a[j] - x);
        if (j > 0) chmin(mi, x - a[j - 1] - 1);
        double ans = atan2(1, mi);
        int jr = j;
        for (int jl = j - 1; jl >= 0 && x - a[jl] - 1 <= 2 * d; jl--){
            ll dl = x - a[jl] - 1;
            while (jr < n && a[jr] - x < dl - 1) jr++;
            if (jr == n || a[jr] - x >= 2 * d + 1) break;
            ll dr = a[jr] - x;
            if (abs(dl - dr) <= 1){
                chmax(ans, 2 * atan2(1, max(dl, dr)));
                break;
            }
        }
        printf("%.15f\n", ans);
    }

    return 0;
}


#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

const ll INF = 1e18;

int main() {
    ll n, d;
    cin >> n >> d;
    VL a(n);
    REP(i,n) a[i] = lin();
    int m;
    cin >> m;
    VL p(m);
    REP(i,m) p[i] = lin();

    int j = 0;
    REP(i,m){
        ll x = p[i];
        while (j < n && a[j] < x) j++;
        ll mi = INF;
        if (j < n) chmin(mi, a[j] - x);
        if (j > 0) chmin(mi, x - a[j - 1] - 1);
        double ans = atan2(1, mi);
        int jr = j;
        for (int jl = j - 1; jl >= 0 && x - a[jl] - 1 <= d; jl--){
            ll dl = x - a[jl] - 1;
            while (jr < n && a[jr] - x < dl - 1) jr++;
            if (jr == n || a[jr] - x >= d + 1) break;
            ll dr = a[jr] - x;
            if (abs(dl - dr) <= 1){
                chmax(ans, 2 * atan2(1, max(dl, dr)));
                break;
            }
        }
        printf("%.15f\n", ans);
    }

    return 0;
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash {
	int operator()(int x) const { return x ^ RANDOM; }
};
gp_hash_table<int, int, chash> yra;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
		yra[a[i]]++;
	}
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				int x_l = x2 - (x - 1);
				if (yra[x_l + 1])
				{
					ans = min(ans, f(x2, x - (x_l + 1) - 1));
					break;
				}
				if (yra[x_l])
				{
					ans = min(ans, f(x2, x - (x_l) - 1));
					break;
				}
				if (yra[x_l - 1])
				{
					ans = min(ans, f(x2, x - (x_l - 1) - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (i >= 0 && x - L[i] < x2)
				{
					i--;
				}
				if (i < 0)
					break;
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (i + 1 < L.size())
				{
					if (abs(x2 - (x - L[i + 1] - 1)) <= 1)
					{
						ans = min(ans, f(x2, x - L[i + 1] - 1));
						break;
					}
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	vector<int>L = { (int) - 1e9, (int) - 1e9};
	vector<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int id = 0;
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (id < R.size() && R[id] < x)
		{
			L.push_back(R[id]);
			id++;
		}
		ld ans = MY_PI;
		if (id < R.size())
		{
			ans = min(ans, MY_PI - atan2l(1, R[id] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && id < R.size())
		{
			int i = L.size() - 1;
			for (int c = id; c < R.size() && c < id + 7007 && i >= ((int)L.size()) - 7007; c++)
			{
				int x1 = R[c];
				int x2 = x1 - x;
				while (x - L[i] < x2)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (x2 - (x - L[i - 1] - 1) == -1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	vector<int>L = { (int) - 1e9, (int) - 1e9};
	vector<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int id = 0;
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (id < R.size() && R[id] < x)
		{
			L.push_back(R[id]);
			id++;
		}
		ld ans = MY_PI;
		if (id < R.size())
		{
			ans = min(ans, MY_PI - atan2l(1, R[id] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && id < R.size())
		{
			int i = L.size() - 1;
			for (int c = id; c < R.size(); c++)
			{
				int x1 = R[c];
				int x2 = x1 - x;
				while (x - L[i] < x2)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (x2 - (x - L[i - 1] - 1) == -1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	if (x2 < x1)
		swap(x1, x2);
	if (x1 == x2)
	{
		return MY_PI - 2 * atan2l(1, x1);
	}
	ld xx = sqrtl(x2 * x2 + 1);
	return MY_PI - asinl(1 / ld(xx)) - atan2l(1, x2);
	return MY_PI;
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			int g = 0;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] - 1 < x2 && i >= 1)
				{
					i--;
				}
				ld ans1 = ans;
				ans = min(ans, f(x2, x - L[i] - 1));
				if (i + 1 < L.size())
					ans = min(ans, f(x2, x - L[i + 1] - 1));
				if (i - 1 >= 0)
					ans = min(ans, f(x2, x - L[i - 1] - 1));
				if (abs(ans1 - ans) > 1e-9)
					g++;
				if (g >= 2)
					break;
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	if (x2 < x1)
		swap(x1, x2);
	if (x1 == x2)
	{
		return MY_PI - 2 * atan2l(1, x1);
	}
	ld xx = sqrtl(x2 * x2 + 1);
	return MY_PI - asinl(1 / ld(xx)) - atan2l(1, x2);
	return MY_PI;
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] - 1 < x2 && i >= 1)
				{
					i--;
				}
				ld ans1 = ans;
				ans = min(ans, f(x2, x - L[i] - 1));
				if (i + 1 < L.size())
					ans = min(ans, f(x2, x - L[i + 1] - 1));
				if (i - 1 >= 0)
					ans = min(ans, f(x2, x - L[i - 1] - 1));
				if (abs(ans1 - ans) > 1e-9)
					break;
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] < x2 && i >= 1)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (i + 1 < L.size())
				{
					if (abs(x2 - (x - L[i + 1] - 1)) <= 1)
					{
						ans = min(ans, f(x2, x - L[i + 1] - 1));
						break;
					}
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	if (x2 < x1)
		swap(x1, x2);
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			int g = 0;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] - 1 < x2 && i >= 1)
				{
					i--;
				}
				ld ans1 = ans;
				ans = min(ans, f(x2, x - L[i] - 1));
				if (i + 1 < L.size())
					ans = min(ans, f(x2, x - L[i + 1] - 1));
				if (i - 1 >= 0)
					ans = min(ans, f(x2, x - L[i - 1] - 1));
				if (abs(ans1 - ans) > 1e-9)
					g++;
				if (g >= 2)
					break;
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	vector<int>L = { (int) - 1e9, (int) - 1e9};
	vector<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int id = 0;
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (id < R.size() && R[id] < x)
		{
			L.push_back(R[id]);
			id++;
		}
		ld ans = MY_PI;
		if (id < R.size())
		{
			ans = min(ans, MY_PI - atan2l(1, R[id] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && id < R.size())
		{
			int i = L.size() - 1;
			for (int c = id; c < R.size() && c < id + 3555 && i >= ((int)L.size()) - 3555; c++)
			{
				int x1 = R[c];
				int x2 = x1 - x;
				while (x - L[i] < x2)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (x2 - (x - L[i - 1] - 1) == -1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L = { -808080, -7070707};
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] < x2)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (abs(x2 - (x - L[i - 1] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	vector<int>L = { (int) - 1e9, (int) - 1e9};
	vector<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int id = 0;
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (id < R.size() && R[id] < x)
		{
			L.push_back(R[id]);
			id++;
		}
		ld ans = MY_PI;
		if (id < R.size())
		{
			ans = min(ans, MY_PI - atan2l(1, R[id] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && id < R.size())
		{
			int i = L.size() - 1;
			for (int c = id; c < R.size(); c++)
			{
				int x1 = R[c];
				int x2 = x1 - x;
				if (x2 > 2 * d + 3)
					break;
				while (x - L[i] < x2)
				{
					if (x - L[i] > 2 * d + 3)
						break;
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (x2 - (x - L[i - 1] - 1) == -1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	vector<int>L = { (int) - 1e9, (int) - 1e9};
	vector<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int id = 0;
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (id < R.size() && R[id] < x)
		{
			L.push_back(R[id]);
			id++;
		}
		ld ans = MY_PI;
		if (id < R.size())
		{
			ans = min(ans, MY_PI - atan2l(1, R[id] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && id < R.size())
		{
			int i = L.size() - 1;
			for (int c = id; c < R.size() && c < id + 14000 && i >= ((int)L.size()) - 14000; c++)
			{
				int x1 = R[c];
				int x2 = x1 - x;
				while (x - L[i] < x2)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (x2 - (x - L[i - 1] - 1) == -1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] - 1 < x2 && i >= 1)
				{
					i--;
				}
				ld ans1 = ans;
				ans = min(ans, f(x2, x - L[i] - 1));
				if (i + 1 < L.size())
					ans = min(ans, f(x2, x - L[i + 1] - 1));
				if (i - 1 >= 0)
					ans = min(ans, f(x2, x - L[i - 1] - 1));
				if (abs(ans1 - ans) > 1e-9)
					break;
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
3 5
0 5 7
9
0 1 2 3 4 5 6 7 8

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	if (x2 < x1)
		swap(x1, x2);
	if (x1 == x2)
	{
		return MY_PI - 2 * atan2l(1, x1);
	}
	return MY_PI - asinl(1 / ld(x2));
	return MY_PI;
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L;
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2(1, R[0] - x));
		}
		if (!L.empty())
		{
			ans = min(ans, MY_PI - atan2(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] - 1 < x2 && i >= 1)
				{
					i--;
				}
				ld ans1 = ans;
				ans = min(ans, f(x2, x - L[i] - 1));
				if (i + 1 < L.size())
					ans = min(ans, f(x2, x - L[i + 1] - 1));
				if (i - 1 >= 0)
					ans = min(ans, f(x2, x - L[i - 1] - 1));
				if (abs(ans1 - ans) > 1e-9)
					break;
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


/*input
2 7
0 4
3
1 3 4

*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ld MY_PI = acosl(-1);
ld f(int x1, int x2)
{
	if (abs(x1 - x2) > 1)
		return MY_PI;
	if (x1 == 0 && x2 == 0)
		return 0;
	return MY_PI - 2 * atan2l(1, max(x1, x2));
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n, d;
	cin >> n >> d;
	int a[n];
	for (int i = 0; i < n; i++)
		cin >> a[i];
	deque<int>L = { (int) - 1e9, (int) - 1e9};
	deque<int>R;
	for (int i = 0; i < n; i++)
		R.push_back(a[i]);
	int m;
	cin >> m;
	while (m--)
	{
		int x;
		cin >> x;
		while (!R.empty() && R[0] < x)
		{
			L.push_back(R[0]);
			R.pop_front();
		}
		ld ans = MY_PI;
		if (!R.empty())
		{
			ans = min(ans, MY_PI - atan2l(1, R[0] - x));
		}
		if (L.size() >= 3)
		{
			ans = min(ans, MY_PI - atan2l(1, x - L.back() - 1));
		}
		if (!L.empty() && !R.empty())
		{
			int i = L.size() - 1;
			for (int x1 : R)
			{
				int x2 = x1 - x;
				while (x - L[i] < x2)
				{
					i--;
				}
				if (abs(x2 - (x - L[i] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i] - 1));
					break;
				}
				if (abs(x2 - (x - L[i - 1] - 1)) <= 1)
				{
					ans = min(ans, f(x2, x - L[i - 1] - 1));
					break;
				}
			}
		}
		ans = MY_PI - ans;
		cout << fixed << setprecision(30) << ans << "\n";
	}
}


#include<bits/stdc++.h>
#define ldb long double
using namespace std;
const int MAXN = 2e5 + 7007;
const ldb PI = acosl(-1);
ldb cal1(int x) {return x == 0 ? PI / 2 : atan2l(1, x);}
ldb cal2(int x) {return x == 0 ? PI : atan2l(1, x) * 2;}
bool have[MAXN];
ldb ans[MAXN];
int main()
{
    int n, d; scanf("%d%d", &n, &d);
    int N = 0;
    for (int i = 1, x; i <= n; i++) scanf("%d", &x), have[x] = 1, N = max(N, x + 1);
    bitset<7001>lsta, rsta, res;
    lsta.reset(); rsta.reset();
    for (int i = 0; i <= d; i++) rsta[i] = have[i];
    for (int i = 0; i <= N; i++)
    {
        ans[i] = cal1(min(lsta._Find_first(), rsta._Find_first()));
        res = ((rsta | (rsta << 1)) & (lsta | (lsta << 1)));
        ans[i] = max(ans[i], cal2(res._Find_first()));
        lsta <<= 1; lsta[0] = have[i];
        rsta >>= 1; rsta[d] = have[i + d + 1];
    }
    int m; scanf("%d", &m);
    for (int i = 1, x; i <= m; i++)
    {
        scanf("%d", &x);
        printf("%.15lf\n", (double)ans[x]);
    }
    return 0;
}


#include<bits/stdc++.h>
#define ldb long double
using namespace std;
const int MAXN = 2e5 + 7007;
const ldb PI = acosl(-1);
ldb cal1(int x) {return x == 0 ? PI / 2 : atan2l(1, x);}
ldb cal2(int x) {return x == 0 ? PI : atan2l(1, x) * 2;}
int p[MAXN], q[MAXN];
ldb ans[MAXN];
int main()
{
    int n, d; scanf("%d%d", &n, &d); d++;
    int N = 0;
    for (int i = 1, x; i <= n; i++) scanf("%d", &p[i]);
    bitset<7007>lsta, rsta, res;
    lsta.reset(); rsta.reset();
    int pl = 1, pr = 1;
    while (p[pr] <= d && pr <= n) rsta[p[pr]] = 1, pr++;
    int m; scanf("%d", &m);
    for (int i = 1; i <= m; i++)
    {
        scanf("%d", &q[i]);
        lsta <<= (q[i] - q[i - 1]);
        while (p[pl] < q[i] && pl <= n)
        {
            if (q[i] - p[pl] > d) pl++;
            else lsta[q[i] - p[pl++] - 1] = 1;
        }
        rsta >>= (q[i] - q[i - 1]);
        while (p[pr] <= q[i] + d && pr <= n)
        {
            if (p[pr] < q[i]) pr++;
            else rsta[p[pr++] - q[i]] = 1;
        }
        ldb ans = cal1(min(lsta._Find_first(), rsta._Find_first()));
        res = ((rsta | (rsta << 1)) & (lsta | (lsta << 1)));
        ans = max(ans, cal2(res._Find_first()));
        printf("%.15lf\n", (double)ans);

    }
    return 0;
}


#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<math.h>

using namespace std;

const double pi = 3.1415926535897932384626433832795028;

int main() {
	cout.precision(17);

	int n, d;
	cin >> n >> d;
	vector<int> buildings;
	for (int i = 0; i < n; i++) {
		int num;
		cin >> num;
		buildings.push_back(num);
	}
	int m;
	cin >> m;
	int current = 0;
	for (int c = 1; c <= m; c++) {

		int x;
		cin >> x;
		double alpha = pi;
		while (current < n && buildings[current] < x) current++;
		int left = current - 1;
		int right = current;
		int dist;
		if (right < n && (left < 0 || buildings[right] - x <= x - buildings[left] - 1)) {
			dist = buildings[right] - x;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		else if (left >= 0 && (right >= n || buildings[right] - x > x - buildings[left] - 1)) {
			dist = x - buildings[left] - 1;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		bool cont = true;
		if (left < 0) cont = false;
		if (right >= n) cont = false;
		while (cont) {
			if (buildings[right] - x < x - buildings[left] - 2) right++;
			else if (buildings[right] - x > x - buildings[left]) left--;
			else {
				int dist2 = max(buildings[right] - x, x - buildings[left] - 1);
				double candidate;
				if (dist2 == 0) candidate = 0;
				else candidate = 2 * atan(1.0 / double(dist2));
				if (candidate > alpha) alpha = candidate;
				cont = false;
			}
			if (left < 0) cont = false;
			if (right >= n) cont = false;
			if (right >= 2 * dist + 5) cont = false;
		}

		cout << alpha;

	}

	return 0;
}


#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<math.h>

using namespace std;

const double pi = 3.1415926535897932384626433832795028;

int main() {
	cout.precision(17);

	int n, d;
	cin >> n >> d;
	vector<int> buildings;
	for (int i = 0; i < n; i++) {
		int num;
		cin >> num;
		buildings.push_back(num);
	}
	int m;
	cin >> m;
	int current = 0;
	for (int c = 1; c <= m; c++) {

		int x;
		cin >> x;
		double alpha = pi;
		while (current < n && buildings[current] < x) current++;
		int left = current - 1;
		int right = current;
		int dist;
		if (right < n && (left < 0 || buildings[right] - x <= x - buildings[left] - 1)) {
			dist = buildings[right] - x;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		else if (left >= 0 && (right >= n || buildings[right] - x > x - buildings[left] - 1)) {
			dist = x - buildings[left] - 1;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		bool cont = true;
		if (left < 0) cont = false;
		if (right >= n) cont = false;
		while (cont) {
			if (buildings[right] - x < x - buildings[left] - 2) right++;
			else if (buildings[right] - x > x - buildings[left]) left--;
			else {
				int dist2 = max(buildings[right] - x, x - buildings[left] - 1);
				double candidate;
				if (dist2 == 0) candidate = pi;
				else candidate = 2.0 * atan(1.0 / double(dist2));
				if (candidate > alpha) alpha = candidate;
				cont = false;
			}
			if (left < 0) cont = false;
			if (right >= n) cont = false;
			if (right >= 2 * dist + 5) cont = false;
		}

		cout << alpha << endl;

	}

	return 0;
}


#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<math.h>

using namespace std;

const double pi = 3.1415926535897932384626433832795028;

int main() {
	cout.precision(17);

	int n, d;
	cin >> n >> d;
	vector<int> buildings;
	for (int i = 0; i < n; i++) {
		int num;
		cin >> num;
		buildings.push_back(num);
	}
	int m;
	cin >> m;
	int current = 0;
	for (int c = 1; c <= m; c++) {

		int x;
		cin >> x;
		double alpha = pi;
		while (current < n && buildings[current] < x) current++;
		int left = current - 1;
		int right = current;
		int dist;
		if (right < n && (left < 0 || buildings[right] - x <= x - buildings[left] - 1)) {
			dist = buildings[right] - x;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		else if (left >= 0 && (right >= n || buildings[right] - x > x - buildings[left] - 1)) {
			dist = x - buildings[left] - 1;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		bool cont = true;
		if (left < 0) cont = false;
		if (right >= n) cont = false;
		while (cont) {
			if (buildings[right] - x < x - buildings[left] - 2) right++;
			else if (buildings[right] - x > x - buildings[left]) left--;
			else {
				int dist2 = max(buildings[right] - x, x - buildings[left] - 1);
				double candidate;
				if (dist2 == 0) candidate = pi;
				else candidate = 2.0 * atan(1.0 / double(dist2));
				if (candidate > alpha) alpha = candidate;
				cont = false;
			}
			if (left < 0) cont = false;
			if (right >= n) cont = false;
			if (right >= 3 * dist + 5) cont = false;
		}

		cout << alpha << endl;

	}

	return 0;
}


#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<math.h>

using namespace std;

const double pi = 3.1415926535897932384626433832795028;

int main() {
	cout.precision(17);

	int n, d;
	cin >> n >> d;
	vector<int> buildings;
	for (int i = 0; i < n; i++) {
		int num;
		cin >> num;
		buildings.push_back(num);
	}
	int m;
	cin >> m;
	int current = 0;
	for (int c = 1; c <= m; c++) {

		int x;
		cin >> x;
		double alpha = pi;
		while (current < n && buildings[current] < x) current++;
		int left = current - 1;
		int right = current;
		int dist;
		if (right < n && (left < 0 || buildings[right] - x <= x - buildings[left] - 1)) {
			dist = buildings[right] - x;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		else if (left >= 0 && (right >= n || buildings[right] - x > x - buildings[left] - 1)) {
			dist = x - buildings[left] - 1;
			if (dist == 0) alpha = pi / 2.0;
			else alpha = atan(1.0 / double(dist));
		}
		bool cont = true;
		if (left < 0) cont = false;
		if (right >= n) cont = false;
		while (cont) {
			if (buildings[right] - x < x - buildings[left] - 2) right++;
			else if (buildings[right] - x > x - buildings[left]) left--;
			else {
				int dist2 = max(buildings[right] - x, x - buildings[left] - 1);
				double candidate;
				if (dist2 == 0) candidate = pi;
				else candidate = 2.0 * atan(1.0 / double(dist2));
				if (candidate > alpha) alpha = candidate;
				cont = false;
			}
			if (left < 0) cont = false;
			if (right >= n) cont = false;
			if (right - x >= 2 * dist + 5) cont = false;
		}

		cout << alpha << endl;

	}

	return 0;
}