Language: C++

#include <cstdio>
#include <complex>
#include <algorithm>
#include <utility>
#include <iostream>
#define rep(i,n) for(int i=0;i<n;i++)
#define re real()
#define im imag()
using namespace std;
int main(){
	while(true){
		int n,mx=1;
		scanf("%d",&n);
		if(n==0) break;
		complex<double> p[300];
		rep(i,n) scanf("%lf%lf",&p[i].re,&p[i].im);
		rep(i,n) rep(j,i){
			double d=abs(p[i]-p[j]);
			if(d>2) continue;
			complex<double> c=(p[i]+p[j])/2.0,dis=(p[i]-p[j])/d*sqrt(1-d*d/4);
			swap(dis.re,dis.im);
			dis.im=-dis.im;
			complex<double> cen=c+dis;
			int cnt=0;
			rep(k,n) if(abs(cen-p[k])<=1.0000000001) cnt++;
			mx=max(mx,cnt);
			cen=c-dis;
			cnt=0;
			rep(k,n) if(abs(cen-p[k])<=1.0000000001) cnt++;
			mx=max(mx,cnt);
		}
		printf("%d\n",mx);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: lvalue required as unary '&' operand
    7 | #define re real()
      |                ^
a.cc:16:47: note: in expansion of macro 're'
   16 |                 rep(i,n) scanf("%lf%lf",&p[i].re,&p[i].im);
      |                                               ^~
a.cc:8:16: error: lvalue required as unary '&' operand
    8 | #define im imag()
      |                ^
a.cc:16:56: note: in expansion of macro 'im'
   16 |                 rep(i,n) scanf("%lf%lf",&p[i].re,&p[i].im);
      |                                                        ^~
a.cc:21:29: error: no matching function for call to 'swap(double, double)'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from /usr/include/c++/14/complex:44,
                 from a.cc:2:
/usr/include/c++/14/bits/move.h:226:5: note: candidate: 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = double; _Require<__not_<__is_tuple_like<_Tp> >, is_move_constructible<_Tp>, is_move_assignable<_Tp> > = void]' (near match)
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   conversion of argument 2 would be ill-formed:
a.cc:8:16: error: cannot bind non-const lvalue reference of type 'double&' to an rvalue of type 'double'
    8 | #define im imag()
      |                ^
a.cc:21:41: note: in expansion of macro 'im'
   21 |                         swap(dis.re,dis.im);
      |                                         ^~
In file included from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/istream:40,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45:
/usr/include/c++/14/bits/exception_ptr.h:229:5: note: candidate: 'void std::__exception_ptr::swap(exception_ptr&, exception_ptr&)'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
/usr/include/c++/14/bits/exception_ptr.h:229:25: note:   no known conversion for argument 1 from 'double' to 'std::__exception_ptr::exception_ptr&'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |          ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/sstream:1204:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_stringbuf<_CharT, _Traits, _Alloc>&, basic_stringbuf<_CharT, _Traits, _Alloc>&)'
 1204 |     swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1204:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/sstream:1212:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_istringstream<_CharT, _Traits, _Allocator>&, basic_istringstream<_CharT, _Traits, _Allocator>&)'
 1212 |     swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1212:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::__cxx11::basic_istringstream<_CharT, _Traits, _Allocator>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/sstream:1219:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_ostringstream<_CharT, _Traits, _Allocator>&, basic_ostringstream<_CharT, _Traits, _Allocator>&)'
 1219 |     swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1219:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::__cxx11::basic_ostringstream<_CharT, _Traits, _Allocator>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/sstream:1226:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_stringstream<_CharT, _Traits, _Allocator>&, basic_stringstream<_CharT, _Traits, _Allocator>&)'
 1226 |     swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1226:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Allocator>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/move.h:250:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> std::__enable_if_t<((bool)std::__is_swappable<_Tp>::value)> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
  250 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~
/usr/include/c++/14/bits/move.h:250:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types '_Tp [_Nm]' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1089:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value>::type std::swap(pair<_T1, _T2>&, pair<_T1, _T2>&)'
 1089 |     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |     ^~~~
/usr/include/c++/14/bits/stl_pair.h:1089:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::pair<_T1, _T2>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1106:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<(! std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value)>::type std::swap(pair<_T1, _T2>&, pair<_T1, _T2>&)' (deleted)
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::pair<_T1, _T2>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/bits/basic_string.h:4039:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> void std::swap(__cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 4039 |     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4039:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2805:5: note: candidate: 'template<class ... _Elements> typename std::enable_if<std::__and_<std::__is_swappable<_Elements>...>::value>::type std::swap(tuple<_UTypes ...>&, tuple<_UTypes ...>&)'
 2805 |     swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
      |     ^~~~
/usr/include/c++/14/tuple:2805:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::tuple<_UTypes ...>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/tuple:2823:5: note: candidate: 'template<class ... _Elements> typename std::enable_if<(! std::__and_<std::__is_swappable<_Elements>...>::value)>::type std::swap(tuple<_UTypes ...>&, tuple<_UTypes ...>&)' (deleted)
 2823 |     swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
      |     ^~~~
/usr/include/c++/14/tuple:2823:5: note:   template argument deduction/substitution failed:
a.cc:21:29: note:   mismatched types 'std::tuple<_UTypes ...>' and 'double'
   21 |                         swap(dis.re,dis.im);
      |                         ~~~~^~~~~~~~~~~~~~~
a.cc:8:16: error: lvalue required as left operand of assignment
    8 | #define im imag()
      |                ^
a.cc:22:29: note: in expansion of macro 'im'
   22 |                         dis.im=-dis.im;
      |                             ^~