#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int maxn = 11000;
int n, Q;
double V;
inline int dblc(double x) { return (x > eps) - (x < -eps); }
struct Tcxx {
  double x, y;
  int w;
} A[maxn];
namespace Ninit {
double Fx(double sita) {
  double t = V * sin(sita) / 4.9;
  return V * cos(sita) * t;
}
inline bool cmp(const Tcxx &a, const Tcxx &b) { return a.x < b.x; }
void init() {
  int i;
  cin >> n >> V;
  for (i = 1; i <= n; ++i) scanf("%lf", &A[i].x), A[i].w = i;
  sort(A + 1, A + n + 1, cmp);
  for (i = 1; i <= n; ++i) A[i].y = Fx(A[i].x);
}
}  // namespace Ninit
namespace Nsolve {
inline bool cmp(const Tcxx &a, const Tcxx &b) { return a.w < b.w; }
inline double Fy(double x, double sita) {
  double t = x / (V * cos(sita));
  return V * sin(sita) * t - 4.9 * t * t;
}
double B[maxn];
void solve() {
  double xi, yi, u;
  int i, l, r, t;
  for (i = 1; i <= n + 1; ++i) B[i] = 1e30;
  for (cin >> Q; Q; --Q) {
    scanf("%lf%lf", &xi, &yi);
    for (l = 0, r = n + 1; l + 1 < r; dblc(A[t].y - xi) <= 0 ? l = t : r = t)
      t = l + r >> 1;
    for (r = n + 1; l + 1 < r; dblc(Fy(xi, A[t].x) - yi) <= 0 ? l = t : r = t)
      t = l + r >> 1;
    B[l] = min(B[l], xi);
  }
  for (i = n; i >= 1; --i)
    B[i] = min(B[i + 1], B[i]), A[i].y = min(A[i].y, B[i]);
  sort(A + 1, A + n + 1, cmp);
  for (i = 1; i <= n; ++i)
    printf("%.6lf %.6lf\n", A[i].y, Fy(A[i].y, A[i].x) + 1e-7);
}
}  // namespace Nsolve
int main() {
  Ninit::init();
  Nsolve::solve();
  return 0;
}
