Language: C++

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

#define fo(i,s,t) for(int i = s; i <= t; ++ i)
#define fd(i,s,t) for(int i = s; i >= t; -- i)
#define bf(i,s) for(int i = head[s]; i; i = e[i].next)
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define VI vector<int>
#define sf scanf
#define pf printf
#define fp freopen
#define SZ(x) ((int)(x).size())
#define IF_DEBUG 0
typedef long long ll;
typedef double db;
const int inf = 1<<30;
const ll INF = 1ll<<60;
const db Inf = 1e20;
const db eps = 1e-9;
const db pi = acos(-1.0);

void gmax(int &a,int b){a = (a > b ? a : b);}
void gmin(int &a,int b){a = (a < b ? a : b);}

const int maxn = 200050;

int x1, y1, x2, y2, N, n, f[maxn], d[maxn], cnt;
struct node{int x, y;}a[maxn];
int bit[maxn], ans;
db Ans;

bool cmp(node a, node b){return a.x < b.x;}
void add(int x,int z){for(;x<=cnt;x+=x&-x)bit[x]=max(bit[x],z);}
int ask(int x,int ret = 0){for(;x;x-=x&-x)ret=max(ret,bit[x]);return ret;}
int main()
{
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	Ans = (abs(x1-x2)+abs(y1-y2))*100;
	scanf("%d",&N);
	fo(i,1,N) 
	{
		int x, y; scanf("%d%d",&x,&y);
		if(x < min(x1,x2) || x > max(x1,x2) || y < min(y1,y2) || y > max(y1,y2))
			continue;
		++ n;
		a[n] = (struct node){x,y};
	}
	sort(a+1,a+n+1,cmp);
	fo(i,1,n) d[++cnt] = a[i].y;
	sort(d+1,d+cnt+1);
	cnt = unique(d+1,d+cnt+1)-d-1;
	fo(i,1,n) a[i].y = lower_bound(d+1,d+cnt+1,a[i].y)-d;
	fo(i,1,n) {f[i] = ask(a[i].y)+1; add(a[i].y,f[i]); gmax(ans, f[i]);}
	if(ans > min(abs(x2-x1),abs(y2-y1))) Ans += (ans+1)*pi*5;
	else Ans += ans*pi*5;
	Ans -= ans*20;
	printf("%.12f",Ans);
	return 0;
}

Compiler output:
a.cc:31:9: error: 'int y1' redeclared as different kind of entity
   31 | int x1, y1, x2, y2, N, n, f[maxn], d[maxn], cnt;
      |         ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:42:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                               ~~^~~
a.cc:42:30: error: no matching function for call to 'abs(double (*)(double) noexcept)'
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                           ~~~^~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' (near match)
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
/usr/include/stdlib.h:980:12: note:   conversion of argument 1 would be ill-formed:
a.cc:42:33: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                               ~~^~~
      |                                 |
      |                                 double (*)(double) noexcept
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' (near match)
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note:   conversion of argument 1 would be ill-formed:
a.cc:42:33: error: invalid conversion from 'double (*)(double) noexcept' to '__int128' [-fpermissive]
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                               ~~^~~
      |                                 |
      |                                 double (*)(double) noexcept
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' (near match)
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note:   conversion of argument 1 would be ill-formed:
a.cc:42:33: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                               ~~^~~
      |                                 |
      |                                 double (*)(double) noexcept
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' (near match)
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note:   conversion of argument 1 would be ill-formed:
a.cc:42:33: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                               ~~^~~
      |                                 |
      |                                 double (*)(double) noexcept
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
  445 |     _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note:   template argument deduction/substitution failed:
a.cc:42:30: note:   mismatched types 'const std::valarray<_Tp>' and 'double (*)(double) noexcept'
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                           ~~~^~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
  445 |     _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note:   template argument deduction/substitution failed:
a.cc:42:30: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'double (*)(double) noexcept'
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                           ~~~^~~~~~~
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
  892 |     abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
      |     ^~~
/usr/include/c++/14/complex:892:5: note:   template argument deduction/substitution failed:
a.cc:42:30: note:   mismatched types 'const std::complex<_Tp>' and 'double (*)(double) noexcept'
   42 |         Ans = (abs(x1-x2)+abs(y1-y2))*100;
      |                           ~~~^~~~~~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:137:18: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to '__float128'
  137 |   abs(__float128 __x)
      |       ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:19: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to 'long double'
   79 |   abs(long double __x)
      |       ~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:13: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to 'float'
   75 |   abs(float __x)
      |       ~~~~~~^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:14: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to 'double'
   71 |   abs(double __x)
      |       ~~~~~~~^~~
a.cc:47:63: error: no matching function for call to 'min(double (&)(double) noexcept, int&)'
   47 |                 if(x < min(x1,x2) || x > max(x1,x2) || y < min(y1,y2) || y > max(y1,y2))
      |                                                            ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:47:63: note:   deduced conflicting types for parameter 'const _Tp' ('double(double) noexcept' and 'int')
   47 |                 if(x < min(x1,x2) || x > max(x1,x2) || y < min(y1,y2) || y > max(y1,y2))
      |                                                            ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:47:63: note:   mismatched types 'std::initializer_list<_Tp>' and 'double (*)(double) noexcept'
   47 |                 if(x < min(x1,x2) || x > max(x1,x2) || y < min(y1,y2) || y > max(y1,y2))
      |                                                            ~~~^~~~~~~
a.cc:47:81: error: no matching function for call to 'max(double (&)(double) noexcept, int&)'
   47 |                 if(x < min(x1,x2) || x > max(x1,x2) || y < min(y1,y2) || y > max(y1,y2))
      |                                                                              ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:47:81: note:   deduced conflicting types for parameter 'const _Tp' ('double(double) noexcept' and 'int')
   47 |                 if(x < min(x1,x2) || x > max(x1,x2) || y < min(y1,y2) || y > max(y1,y2))
      |                                                                              ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, co