#include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define TRACE(x) cout << #x << " = " << x << endl
#define _ << " _ " <<

typedef long long llint;

const int MAXN = 1000;
const double eps = 1e-7;

inline bool lt(double x, double y) { return x+eps < y; }
inline bool gt(double x, double y) { return lt(y, x); }
inline bool eq(double x, double y) { return !lt(x, y) && !gt(x, y); }

struct Pt {
  double x, y;
  Pt operator - (const Pt &b) { return Pt{x-b.x, y-b.y}; }
};

inline double norm(const Pt &a) {
  return sqrt(a.x*a.x + a.y*a.y);
}

inline double ccw(const Pt &a, const Pt &b, const Pt &c) {
  return a.x * (b.y-c.y) + b.x * (c.y-a.y) + c.x * (a.y-b.y);
}

int n;
Pt P1[MAXN], P2[MAXN], P3[MAXN];
vector<Pt> H1, H2;

double rot1, rot2, ans;

bool load(void) {
  scanf("%d", &n);
  if (n == 0) return false;
  REP (i, n) scanf("%lf%lf", &P1[i].x, &P1[i].y);
  REP (i, n) scanf("%lf%lf", &P2[i].x, &P2[i].y);
  return true;
}

bool cmp(const Pt &a, const Pt &b) {
  if (!eq(a.x, b.x)) return lt(a.x, b.x);
  return lt(a.y, b.y);
}

void convex_hull(Pt *P, int n, vector<Pt> &h) {
  sort(P, P+n, cmp);

  int lsize = 0, usize = 0;
  vector<Pt> lo, up;
  for (int i = 0; i < n; ++i) {
    while (lsize >= 2 && !lt(ccw(lo[lsize-2], lo[lsize-1], P[i]), 0.0)) {
      --lsize;
      lo.pop_back();
    }
    lo.push_back(P[i]);
    ++lsize;
  }

  for (int i = n-1; i >= 0; --i) {
    while (usize >= 2 && !lt(ccw(up[usize-2], up[usize-1], P[i]), 0.0)) {
      --usize;
      up.pop_back();
    }
    up.push_back(P[i]);
    ++usize;
  }

  h.clear();
  for (int i = 0; i < lsize; ++i)
    h.push_back(lo[i]);
  for (int i = 1; i < usize-1; ++i)
    h.push_back(up[i]);
}

void translate(Pt *p, int n, double dx, double dy) {
  REP (i, n) p[i].x += dx, p[i].y += dy;
}

void rotate(Pt *p, int n, double cos_alpha, double sin_alpha) {
  REP (i, n) {
    double nx = p[i].x * cos_alpha - p[i].y * sin_alpha,
           ny = p[i].x * sin_alpha + p[i].y * cos_alpha;
    p[i] = Pt{nx, ny};
  }
}

bool check(int id) {
  for (int sgn: {-1, 1}) {
    memcpy(P3, P2, sizeof P2);
    translate(P3, n, -H2[id].x, -H2[id].y); 
    int nid = (id+1) % (int)H2.size();
    Pt v = H2[nid]-H2[id];
    rotate(P3, n, sgn*v.y/norm(v), sgn*v.x/norm(v));
    sort(P3, P3+n, cmp);

    bool ok = true;
    REP (i, n) {
      if (!eq(P1[i].x, P3[i].x)) { ok = false; break; }
      if (!eq(P1[i].y, P3[i].y)) { ok = false; break; }
    }
    if (ok) {
      rot2 = atan2(sgn*v.y, sgn*v.x);
      double tmp = rot2 - rot1 + 2*M_PI;
      while (gt(tmp, 2*M_PI)) tmp -= 2*M_PI;
      ans = min(ans, min(tmp, 2*M_PI-tmp));
    }
  }
  return false;
}

void solve(void) {
  if (n == 1) {
    printf("0.0\n");
    return;
  }

  ans = 10.0;

  convex_hull(P1, n, H1);
  convex_hull(P2, n, H2);

  translate(P1, n, -H1[0].x, -H1[0].y);
  Pt v = H1[1]-H1[0];
  rotate(P1, n, v.y/norm(v), v.x/norm(v));
  rot1 = atan2(v.y/norm(v), v.x/norm(v));
  sort(P1, P1+n, cmp);

  REP (i, n) check(i);
  printf("%.10lf\n", ans);
}


int main(void) {

  while (load()) solve();

  return 0;
}

Measured memory_bytes: 3496