Language: C++

// last update 2015/05/29

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

typedef complex<double> P;
typedef vector<P> G;

const double eps = 1e-8;

bool equals(double a, double b) { return abs(a - b) < eps; }

bool equals(P a, P b) {
  return equals(a.real(), b.real()) && equals(a.imag(), b.real());
}

namespace std {
  bool operator < (const P &a, const P b) {
    return ( a.real() != b.real()
             ? a.real() < b.real() : a.imag() < b.imag() );
  }
}

struct L : public vector<P> {
  L(P a, P b) {
    push_back(a), push_back(b);
  }
};

struct C {
  P p;
  double r;
  C() {}
  C(P p, double r) : p(p), r(r) {}
};

double dot  (P a, P b) { return a.real()*b.real() + a.imag()*b.imag(); }
double cross(P a, P b) { return a.real()*b.imag() - a.imag()*b.real(); }

bool isOrthogonal(P a, P b) { return equals(dot(a, b), 0.0); }
bool isParallel  (P a, P b) { return equals(cross(a, b), 0.0); }

P project(P s1, P s2, P p) {
  P base = s2 - s1;
  double t = dot(p - s1, base)/norm(base);
  return s1 + base*t;
}

P reflect(P s1, P s2, P p) { return p + (project(s1, s2, p) - p)*2.0; }

P getRotateP(P p, double rad, P o = P(0, 0)) {
  P q = p - o;
  return o + P(q.real()*cos(rad) - q.imag()*sin(rad),
               q.real()*sin(rad) + q.imag()*cos(rad));
}

namespace CCW {
  enum { COUNTER_CLOCKWISE = 1, CLOCKWISE = -1,
         ONLINE_BACK = 2, ONLINE_FRONT = -2,
         ONSEGMENT = 0 };
}

int ccw(P p0, P a, P b) {
  a -= p0;
  b -= p0;
  if(cross(a, b) > eps) return 1;
  if(cross(a, b) < -eps) return -1;
  if(dot(a, b) < -eps) return 2;
  if(norm(b)-norm(a) > eps) return -2;
  return 0;
}

// 0:螟夜Κ, 1:蠅?阜, 2:蜀?Κ
int contain(C c, P p) {
  if(abs(c.p - p) - c.r <  -eps) return 2;
  if(abs(c.p - p) - c.r >  eps) return 0;
  return 1;
}

// 轤ケ縺悟、夊ァ貞ス「縺ョ蜀?Κ/蠅?阜/螟夜Κ縺ョ縺ゥ縺薙↓縺ゅｋ縺九ｒ蛻、螳壹☆繧具シ?// 0:螟夜Κ, 1:蠅?阜, 2:蜀?Κ
// by Spaghetti Source
int contain(const vector<P> &g, const P &p) {
  int n = g.size();
  int in = 0;
  for(int i = 0; i < n; ++i) {
    P a = g[i] - p, b = g[(i+1)%n] - p;
    if(a.imag() > b.imag()) swap(a, b);
    if(a.imag() < eps && eps < b.imag() && cross(a, b) < -eps) in = !in;
    if(abs(cross(a, b)) < eps && dot(a, b) < eps) return 1;
  }
  return in * 2;
}

// 邱壼?縺ィ邱壼?縺ョ莠、蟾ョ蛻、螳壹?
// T蟄励ｄL蟄励∩縺溘＞縺ォ縺ェ縺」縺ヲ縺?ｋ譎ゅｂtrue繧定ソ斐☆縺後?
// 縺薙ｌ繧帝勁螟悶＠縺溘＞蝣エ蜷医↓ <= 繧?< 縺ォ螟画峩縺励※繧ゅ≧縺セ縺上＞縺九↑縺??
bool isIntersect(P a1, P a2, P b1, P b2) {
  return ( ccw(a1, a2, b1) * ccw(a1, a2, b2) <= 0 &&
           ccw(b1, b2, a1) * ccw(b1, b2, a2) <= 0 );
}

double getDistanceLP(P s1, P s2, P p) {
  return abs(cross(s2 - s1, p - s1)/abs(s2 - s1));
}

double getDistanceSP(P s1, P s2, P p) {
  if(dot(s2 - s1, p - s1) < 0.0) return abs(p - s1);
  if(dot(s1 - s2, p - s2) < 0.0) return abs(p - s2);
  return getDistanceLP(s1, s2, p);
}

double getDistance(P a1, P a2, P b1, P b2) {
  if(isIntersect(a1,a2,b1,b2)) return 0.0;
  return min(min(getDistanceSP(a1,a2,b1), getDistanceSP(a1,a2,b2)),
             min(getDistanceSP(b1,b2,a1), getDistanceSP(b1,b2,a2)));
}

// 逶エ邱壹→蜀??莠、蟾ョ蛻、螳壹?謌サ繧雁?縺ッ莠、轤ケ縺ョ謨ー縲?int isIntersect(P s1, P s2, C c) {
  double d = getDistanceLP(s1, s2, c.p);
  if(equals(d, c.r)) return 1;
  else if(d < c.r) return 2;
  else return 0;
}

// 蜀?→蜀??莠、蟾ョ蛻、螳壹?
//  0 : 莠、蟾ョ縲∝?蛹?↑縺?//  1 : 螟夜Κ縺ァ1轤ケ縺ィ謗・縺吶ｋ
//  2 : 2轤ケ縺ァ莠、蟾ョ
// -1 : 蜀?桁縺励※謗・縺吶ｋ
// -2 : 螳悟?縺ォ蜀?桁
int isIntersect(C a, C b) {
  double x = a.p.real() - b.p.real();
  double y = a.p.imag() - b.p.imag();
  double s = a.r + b.r;
  double d = x*x + y*y;
  s *= s;
  if(equals(d, s)) return 1;
  if(d > s) return 0;
  double r = abs(a.r - b.r);
  r *= r;
  if(equals(d, r)) return -1;
  if(d > r) return 2;
  return -2;
}

// 逶エ邱壹→逶エ邱壹?莠、轤ケ縲?P getCrossP(P a1, P a2, P b1, P b2) {
  P a = a2 - a1;
  P b = b2 - b1;
  // cross 縺ョ隨ヲ蜿キ髢「菫ゅ≠繧?  return a1 + a * cross(b, b1 - a1)/cross(b, a);
}

// 逶エ邱壹→蜀??莠、轤ケ縲?vector<P> getCrossPLC(P s1, P s2, C c) {
  vector<P> v;
  P p = project(s1, s2, c.p);
  double dist = getDistanceLP(s1, s2, c.p);
  if (equals(dist, c.r)) {
    v.push_back(p);
  } else if (dist < c.r) {
    double h = abs(p - c.p);
    double d = sqrt(c.r * c.r - h * h);
    P base = s2 - s1;
    // push_back縺吶ｋ鬆?分縺ッ驥崎ヲ?    v.push_back(p - d * base / abs(base));
    v.push_back(p + d * base / abs(base));
  }
  return v;
}

// 蜀?→蜀??莠、轤ケ縲?vector<P> getCrossP(C c1, C c2) {
  vector<P> v;
  int cp = isIntersect(c1,c2);
  if(cp == 0 || cp == -2) return v;
  
  double ll = norm(c1.p - c2.p);
  double A = ( c1.r * c1.r - c2.r * c2.r + ll ) / ( 2.0 * ll );
  P base = c2.p - c1.p;

  if(abs(cp) == 1) {
    v.push_back(c1.p + A*base);
  } else {
    P n(-base.imag(), base.real());
    n /= abs(n);
    double h = sqrt(c1.r * c1.r - A*A*ll);
    v.push_back(c1.p + A*base + h*n);
    v.push_back(c1.p + A*base - h*n);
  }
  return v;
}

// 2縺、縺ョ繝吶け繝医Ν縺ョ縺ェ縺呵ァ?0 <= rad <= PI)
// AOJ2233縺ァ繝舌げ縺」縺溘?縺ァ譖エ譁ー(2015/05/29)
double getAngle(P a, P b) {
  double v = dot(a, b) / (abs(a) * abs(b));
  if(v > 1.0) return 0;
  if(v < -1.0) return M_PI;
  return acos(v);
}

// a -> b 縺ク縺ョ隗貞コヲ縺ョ遘サ蜍暮?(0 <= rad < 2*PI)
double getAngleVector(P a, P b) {
  double A = arg(a);
  double B = arg(b);
  double rad = B-A;
  rad = fmod(rad, M_PI*2.0);
  if(rad < 0.0) rad += M_PI*2.0;
  return rad;
}

// 2縺、縺ョ逶エ邱壹↓謗・縺吶ｋ蜊雁セв縺ョ蜀?C getC(P a1, P a2, P b1, P b2, double r) {
  P a = a2 - a1;
  P b = b2 - b1;
  if(cross(a, b) < 0) swap(a, b);
  P p = getCrossP(a1, a2, b1, b2);
  double rad = getAngle(a, b);
  double alpha = arg(a);
  double d = r/sin(rad/2.0);
  C res;
  res.r = r;
  res.p = p + d * P(cos(alpha + rad/2.0), sin(alpha + rad/2.0));
  return res;
}

// 繝倥Ο繝ウ縺ョ蜈ャ蠑上ｒ逕ィ縺?※荳芽ァ貞ス「縺ョ3霎コ縺ョ髟キ縺輔°繧蛾擇遨阪ｒ豎ゅａ繧?double heron(double a, double b, double c) {
  double s = (a+b+c)/2.0;
  return sqrt(s*(s-a)*(s-b)*(s-c));
}

// 螟夊ァ貞ス「縺ョ髱「遨?隨ヲ蜿キ莉倥″)
double getArea(vector<P> &G) {
  int n = G.size();
  double S = 0;
  for(int i = 0; i < n; ++i) {
    S += cross(G[i], G[(i+1)%n]);
  }
  return S/2.0;
}

double getTriArea(P a, P b, P c) {
  return cross(b-a, c-a) / 2.0;
}

double getSectorArea(P a, P b, C c) {
  return getAngleVector(a-c.p, b-c.p) * c.r * c.r / 2.0;
}

double getBowArea(P a, P b, C c) { // a,b is a chord of c.
  return getSectorArea(a, b, c) - getTriArea(a, b, c.p);
}

double getArea(P a, P b, C c) {
  int d = 1;
  if(cross(a,b) < 0.0) {
    d = -1;
    swap(a, b);
  }
  if(cross(a, b) < eps) return 0;

  G t(3);
  t[0] = P(0, 0), t[1] = a, t[2] = b;

  if(contain(c, t[0]) && contain(c, t[1]) && contain(c, t[2])) {
    return d * getTriArea(t[0], t[1], t[2]);
  }

  if(getDistanceSP(t[0], t[1], c.p) - c.r > -eps &&
     getDistanceSP(t[1], t[2], c.p) - c.r > -eps &&
     getDistanceSP(t[2], t[0], c.p) - c.r > -eps) {
    if(cross(t[1] - t[0], c.p - t[0]) > -eps &&
       cross(t[2] - t[1], c.p - t[1]) > -eps &&
       cross(t[0] - t[2], c.p - t[2]) > -eps) {
      return d * (c.r * c.r * M_PI);
    } else {
      return 0;
    }
  }

  double S = c.r * c.r * M_PI;
  vector<P> cp(6);
  vector<int> exist(6);
  for(int i = 0; i < 3; ++i) {
    P p = t[i], q = t[(i+1)%3];
    if(getDistanceLP(p, q, c.p) - c.r > -eps) {
      if(cross(q - p, c.p - p) < 0) return 0;
      continue;
    }
    if(getDistanceSP(p, q, c.p) - c.r > -eps) continue;
    vector<P> v = getCrossPLC(t[i], t[(i+1)%3], c);
    if(v.size() == 2 && !equals(v[0], v[1])) {
      S -= getBowArea(v[0], v[1], c);
      for(int j = 0; j < v.size(); ++j) {
        int k = (i*2 + j*3) % 6;
        cp[k] = v[j];
        exist[k] = true;
      }
    }
  }
  for(int i = 0; i < 3; ++i) {
    int a = i*2, b = i*2+1;
    if(!exist[a] || !exist[b]) continue;
    if(contain(c, t[i]) == 2 && !equals(cp[a], cp[b])) {
      S += getBowArea(cp[a], cp[b], c) + getTriArea(t[i], cp[a], cp[b]);
    }
  }
  return S * d;
}

// 螟夊ァ貞ス「縺ィ蜀??蜈ア騾夐Κ蛻??髱「遨?隨ヲ蜿キ莉倥″)
double getArea(G g, C c) {
  int n = g.size();
  double res = 0;
  for(int i = 0; i < n; ++i) {
    res += getArea(g[i], g[(i+1)%n], c);
  }
  return res;
}

// 荳芽ァ貞ス「縺ョ蜀?磁蜀??蜊雁セ?double getIncircleR(P p1, P p2, P p3) {
  double a = abs(p1 - p2);
  double b = abs(p2 - p3);
  double c = abs(p3 - p1);
  return heron(a,b,c)*2.0/(a+b+c);
}

vector<P> convex_hull(vector<P> ps) {
  int n = ps.size(), k = 0;
  sort(ps.begin(), ps.end());
  vector<P> ch(2*n);
  for(int i = 0; i < n; ch[k++] = ps[i++])
    while(k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
  for(int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--])
    while(k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k;
  ch.resize(k-1);
  return ch;
}

vector<P> convex_cut(vector<P> ps, P p1, P p2, int dir = CCW::CLOCKWISE) {
  vector<P> v;
  for(int i = 0; i < ps.size(); ++i) {
    P a = ps[i];
    P b = ps[(i+1)%ps.size()];
    if(ccw(p1, p2, a) != dir) v.push_back(a);
    if(ccw(p1, p2, a)*ccw(p1, p2, b) == -1)
      v.push_back(getCrossP(a, b, p1, p2));
  }
  return v;
}

// 繧ュ繝」繝ェ繝代?豕輔ｒ逕ィ縺?※螟夊ァ貞ス「縺ョ譛?ｂ驕?＞?帝?轤ケ縺ョ霍晞屬繧定ソ斐☆
// O(NlogN)
// by Ari book
double caliper(const vector<P> &ps) {
  vector<P> qs = convex_hull(ps);
  int n = qs.size();
  if(n == 2) {
    return abs(qs[0] - qs[1]);
  }
  int i = 0, j = 0;
  for(int k = 0; k < n; ++k) {
    if(!(qs[i] < qs[k])) i = k;
    if(qs[j] < qs[k]) j = k;
  }
  double res = 0;
  int si = i, sj = j;
  while(i != sj || j != si) {
    res = max(res, abs(qs[i] - qs[j]));
    if(cross((qs[(i+1)%n] - qs[i]), (qs[(j+1)%n] - qs[j])) < 0) {
      i = (i+1)%n;
    } else {
      j = (j+1)%n;
    }
  }
  return res;
}

vector<L> getTangent(C a, C b) {
  vector<L> res;
  bool swapped = false;
  if (a.r > b.r) {
    swap(a, b);
    swapped = true;
  }
  if (a.p == b.p) return res;
  P base = b.p - a.p;
  for (double s = -1; s <= 1; ++++s) {
    double c, d, ee;
    ee = norm(base);
    d = b.r + a.r * s;
    if (ee - d * d < 0.0) continue;
    c = sqrt(ee - d * d);
    if (c < eps) {
      P v = base * P(0, 1);
      P m = b.p - base * b.r / abs(base);
      res.push_back(L(m, m + v));
    } else {
      for (double t = -1; t <= 1; ++++t) {
        P rotate(c / sqrt(ee), d / sqrt(ee) * t);
        P v = -base * rotate * s;
        P nv = v / abs(v) * P(0, t);
        res.push_back(L(a.p + nv * a.r, b.p - nv * b.r * s));
      }
    }
  }
  if (swapped) {
    for (int i = 0; i < res.size(); ++i) {
      swap(res[i][0], res[i][1]);
    }
  }
  return res;
}

// aoj 2201
int main(void) {
  int N;
  vector<P> p;
  vector<double> r, m;
  while(cin >> N && N) {
    p.resize(N);
    r.resize(N);
    m.resize(N);
    for(int i = 0; i < N; ++i) {
      cin >> p[i].real() >> p[i].imag() >> r[i] >> m[i];
    }
    if(N == 1) {
      cout << 1 << endl;
      continue;
    }
    vector<L> ls;
    for(int i = 0; i < N; ++i) {
      for(int j = i+1; j < N; ++j) {
	vector<L> tmp;
	tmp = getTangent(C(p[i], r[i]), C(p[j], r[j]));
	for(int k = 0; k < tmp.size(); ++k) ls.push_back(tmp[k]);
	tmp = getTangent(C(p[i], r[i]+m[i]), C(p[j], r[j]));
	for(int k = 0; k < tmp.size(); ++k) ls.push_back(tmp[k]);
	tmp = getTangent(C(p[i], r[i]), C(p[j], r[j]+m[j]));
	for(int k = 0; k < tmp.size(); ++k) ls.push_back(tmp[k]);
	tmp = getTangent(C(p[i], r[i]+m[i]), C(p[j], r[j]+m[j]));
	for(int k = 0; k < tmp.size(); ++k) ls.push_back(tmp[k]);
      }
    }

    int res = 0;
    for(int k = 0; k < ls.size(); ++k) {
      int cnt = 0;
      for(int i = 0; i < N; ++i) {
	double d = getDistanceLP(ls[k][0], ls[k][1], p[i]);
	if((equals(d, r[i]) || d > r[i]) &&
	   (equals(d-r[i], m[i]) || d-r[i] < m[i])) ++cnt;
      }
      res = max(res, cnt);
    }
    cout << res << endl;
  }
  return 0;
}

Compiler output:
a.cc:119:28: error: 's1' was not declared in this scope; did you mean 'y1'?
  119 |   double d = getDistanceLP(s1, s2, c.p);
      |                            ^~
      |                            y1
a.cc:119:32: error: 's2' was not declared in this scope
  119 |   double d = getDistanceLP(s1, s2, c.p);
      |                                ^~
a.cc:119:36: error: 'c' was not declared in this scope
  119 |   double d = getDistanceLP(s1, s2, c.p);
      |                                    ^
a.cc:120:3: error: expected unqualified-id before 'if'
  120 |   if(equals(d, c.r)) return 1;
      |   ^~
a.cc:121:3: error: expected unqualified-id before 'else'
  121 |   else if(d < c.r) return 2;
      |   ^~~~
a.cc:122:3: error: expected unqualified-id before 'else'
  122 |   else return 0;
      |   ^~~~
a.cc:123:1: error: expected declaration before '}' token
  123 | }
      | ^
a.cc:146:9: error: 'a2' was not declared in this scope; did you mean 'a'?
  146 |   P a = a2 - a1;
      |         ^~
      |         a
a.cc:146:14: error: 'a1' was not declared in this scope; did you mean 'y1'?
  146 |   P a = a2 - a1;
      |              ^~
      |              y1
a.cc:147:9: error: 'b2' was not declared in this scope; did you mean 'b'?
  147 |   P b = b2 - b1;
      |         ^~
      |         b
a.cc:147:14: error: 'b1' was not declared in this scope; did you mean 'y1'?
  147 |   P b = b2 - b1;
      |              ^~
      |              y1
a.cc:149:1: error: expected declaration before '}' token
  149 | }
      | ^
a.cc:153:17: error: 's1' was not declared in this scope; did you mean 'y1'?
  153 |   P p = project(s1, s2, c.p);
      |                 ^~
      |                 y1
a.cc:153:21: error: 's2' was not declared in this scope
  153 |   P p = project(s1, s2, c.p);
      |                     ^~
a.cc:153:25: error: 'c' was not declared in this scope
  153 |   P p = project(s1, s2, c.p);
      |                         ^
a.cc:154:31: error: 's1' was not declared in this scope; did you mean 'y1'?
  154 |   double dist = getDistanceLP(s1, s2, c.p);
      |                               ^~
      |                               y1
a.cc:154:35: error: 's2' was not declared in this scope
  154 |   double dist = getDistanceLP(s1, s2, c.p);
      |                                   ^~
a.cc:154:39: error: 'c' was not declared in this scope
  154 |   double dist = getDistanceLP(s1, s2, c.p);
      |                                       ^
a.cc:155:3: error: expected unqualified-id before 'if'
  155 |   if (equals(dist, c.r)) {
      |   ^~
a.cc:157:5: error: expected unqualified-id before 'else'
  157 |   } else if (dist < c.r) {
      |     ^~~~
a.cc:164:3: error: expected unqualified-id before 'return'
  164 |   return v;
      |   ^~~~~~
a.cc:165:1: error: expected declaration before '}' token
  165 | }
      | ^
a.cc:168:13: error: redefinition of 'std::vector<std::complex<double> > v'
  168 |   vector<P> v;
      |             ^
a.cc:152:13: note: 'std::vector<std::complex<double> > v' previously declared here
  152 |   vector<P> v;
      |             ^
a.cc:169:24: error: 'c1' was not declared in this scope; did you mean 'y1'?
  169 |   int cp = isIntersect(c1,c2);
      |                        ^~
      |                        y1
a.cc:169:27: error: 'c2' was not declared in this scope; did you mean 'cp'?
  169 |   int cp = isIntersect(c1,c2);
      |                           ^~
      |                           cp
a.cc:170:3: error: expected unqualified-id before 'if'
  170 |   if(cp == 0 || cp == -2) return v;
      |   ^~
a.cc:172:20: error: 'c1' was not declared in this scope; did you mean 'y1'?
  172 |   double ll = norm(c1.p - c2.p);
      |                    ^~
      |                    y1
a.cc:172:27: error: 'c2' was not declared in this scope; did you mean 'cp'?
  172 |   double ll = norm(c1.p - c2.p);
      |                           ^~
      |                           cp
a.cc:173:16: error: 'c1' was not declared in this scope; did you mean 'y1'?
  173 |   double A = ( c1.r * c1.r - c2.r * c2.r + ll ) / ( 2.0 * ll );
      |                ^~
      |                y1
a.cc:173:23: error: 'c1' was not declared in this scope; did you mean 'y1'?
  173 |   double A = ( c1.r * c1.r - c2.r * c2.r + ll ) / ( 2.0 * ll );
      |                       ^~
      |                       y1
a.cc:173:30: error: 'c2' was not declared in this scope; did you mean 'cp'?
  173 |   double A = ( c1.r * c1.r - c2.r * c2.r + ll ) / ( 2.0 * ll );
      |                              ^~
      |                              cp
a.cc:173:37: error: 'c2' was not declared in this scope; did you mean 'cp'?
  173 |   double A = ( c1.r * c1.r - c2.r * c2.r + ll ) / ( 2.0 * ll );
      |                                     ^~
      |                                     cp
a.cc:174:12: error: 'c2' was not declared in this scope; did you mean 'cp'?
  174 |   P base = c2.p - c1.p;
      |            ^~
      |            cp
a.cc:174:19: error: 'c1' was not declared in this scope; did you mean 'y1'?
  174 |   P base = c2.p - c1.p;
      |                   ^~
      |                   y1
a.cc:176:3: error: expected unqualified-id before 'if'
  176 |   if(abs(cp) == 1) {
      |   ^~
a.cc:178:5: error: expected unqualified-id before 'else'
  178 |   } else {
      |     ^~~~
a.cc:185:3: error: expected unqualified-id before 'return'
  185 |   return v;
      |   ^~~~~~
a.cc:186:1: error: expected declaration before '}' token
  186 | }
      | ^
a.cc:208:5: error: redefinition of 'P a'
  208 |   P a = a2 - a1;
      |     ^
a.cc:146:5: note: 'P a' previously declared here
  146 |   P a = a2 - a1;
      |     ^
a.cc:208:9: error: 'a2' was not declared in this scope; did you mean 'a'?
  208 |   P a = a2 - a1;
      |         ^~
      |         a
a.cc:208:14: error: 'a1' was not declared in this scope; did you mean 'y1'?
  208 |   P a = a2 - a1;
      |              ^~
      |              y1
a.cc:209:5: error: redefinition of 'P b'
  209 |   P b = b2 - b1;
      |     ^
a.cc:147:5: note: 'P b' previously declared here
  147 |   P b = b2 - b1;
      |     ^
a.cc:209:9: error: 'b2' was not declared in this scope; did you mean 'b'?
  209 |   P b = b2 - b1;
      |         ^~
      |         b
a.cc:209:14: error: 'b1' was not declared in this scope; did you mean 'y1'?
  209 |   P b = b2 - b1;
      |              ^~
      |              y1
a.cc:210:3: error: expected unqualified-id before 'if'
  210 |   if(cross(a, b) < 0) swap(a, b);
      |   ^~
a.cc:211:5: error: redefinition of 'P p'
  211 |   P p = getCrossP(a1, a2, b1, b2);
      |     ^
a.cc:153:5: note: 'P p' previously declared here
  153 |   P p = project(s1, s2, c.p);
      |     ^
a.cc:211:19: error: 'a1' was not declared in this scope; did you mean 'y1'?
  211 |   P p = getCrossP(a1, a2, b1, b2);
      |                   ^~
      |                   y1
a.cc:211:23: error: 'a2' was not declared in this scope; did you mean 'a'?
  211 |   P p = getCrossP(a1, a2, b1, b2);
      |                       ^~
      |                       a
a.cc:211:27: error: 'b1' was not declared in this scope; did you mean 'y1'?
  211 |   P p = getCrossP(a1, a2, b1, b2);
      |                           ^~
      |                           y1
a.cc:211:31: error: 'b2' was not declared in this scope; did you mean 'b'?
  211 |   P p = getCrossP(a1, a2, b1, b2);
      |                               ^~
      |                               b
a.cc:211:9: error: 'getCrossP' was not declared in this scope
  211 |   P p = getCrossP(a1, a2, b1, b2);
      |         ^~~~~~~~~
a.cc:214:10: error: redefinition of 'double d'
  214 |   double d = r/sin(rad/2.0);
      |          ^
a.cc:119:10: note: 'double d' previously defined here
  119 |   double d = getDistanceLP(s1, s2, c.p);
      |          ^
a.cc:214:14: error: 'r' was not declared in this scope
  214 |   double d = r/sin(rad/2.0);
      |              ^
a.cc:216:3: error: 'res' does not name a type
  216 |   res.r = r;
      |   ^~~
a.cc:217:3: error: 'res' does not name a type
  217 |   res.p = p + d * P(cos(alpha + rad/2.0), sin(alpha + rad/2.0));
      |   ^~~
a.cc:218:3: error: expected unqualified-id before 'return'
  218 |   return res;
      |   ^~~~~~
a.cc:219:1: error: expected declaration before '}' token
  219 | }
      | ^
a.cc:222:19: error: 'c' was not declared in this scope
  222 |   double s = (a+b+c)/2.0;
      |                   ^
a.cc:223:3: error: expected unqualified-id before 'return'
  223 |   return sqrt(s*(s-a)*(s-b)*(s-c));
      |   ^~~~~~
a.cc:224:1: error: expected declaration before '}' token
  224 | }
      | ^
a.cc: In function 'double getArea(P, P, C)':
a.cc:285:19: error: 'getCrossPLC' was not declared in this scope
  285 |     vector<P> v = getCrossPLC(t[i], t[(i+1)%3], c);
      |                   ^~~~~~~~~~~
a.cc: At global scope:
a.cc:316:10: error: conflicting declaration 'double a'
  316 |   double a = abs(p1 - p2);
      |          ^
a.cc:146:5: note: previous declaration as 'P a'
  146 |   P a = a2 - a1;
      |     ^
a.cc:316:18: error: 'p1' was not declared in this scope; did you mean 'y1'?
  316 |   double a = abs(p1 - p2);
      |                  ^~
      |                  y1
a.cc:316:23: error: 'p2' was not declared in this scope; did you mean 'p'?
  316 |   double a = abs(p1 - p2);
      |                       ^~
      |                       p
a.cc:317:10: error: conflicting declaration 'double b'
  317 |   double b = abs(p2 - p3);
      |          ^
a.cc:147:5: note: previous declaration as 'P b'
  147 |   P b = b2 - b1;
      |     ^
a.cc:317:18: error: 'p2' was not declared in this scope; did you mean 'p'?
  317 |   double b = abs(p2 - p3);
      |                  ^~
      |                  p
a.cc:317:23: error: 'p3' was not declared in this scope; did you mean 'p'?
  317 |   double b = abs(p2 - p3);
      |                       ^~
      |                       p
a.cc:318:18: error: 'p3' was not declared in this scope; did you mean 'p'?
  318 |   double c = abs(p3 - p1);
      |                  ^~
      |                  p
a.cc:318:23: error: 'p1' was not declared in this scope; did you mean 'y1'?
  318 |   double c = abs(p3 - p1