QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#281706#7783. Military Maneuverucup-team087#AC ✓2234ms4508kbC++2019.5kb2023-12-10 16:12:332023-12-10 16:12:33

Judging History

你现在查看的是最新测评结果

  • [2023-12-10 16:12:33]
  • 评测
  • 测评结果:AC
  • 用时:2234ms
  • 内存:4508kb
  • [2023-12-10 16:12:33]
  • 提交

answer

#ifndef LOCAL
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#endif

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

using ll=long long;
#define int ll

#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define pb push_back
#define eb emplace_back
#define a first
#define b second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
#ifdef LOCAL
#define dmp(x) cerr<<__LINE__<<" "<<#x<<" "<<x<<endl
#else
#define dmp(x) void(0)
#endif

template<class t,class u> bool chmax(t&a,u b){if(a<b){a=b;return true;}else return false;}
template<class t,class u> bool chmin(t&a,u b){if(b<a){a=b;return true;}else return false;}

template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;

using pi=pair<int,int>;
using vi=vc<int>;

template<class t,class u>
ostream& operator<<(ostream& os,const pair<t,u>& p){
	return os<<"{"<<p.a<<","<<p.b<<"}";
}

template<class t> ostream& operator<<(ostream& os,const vc<t>& v){
	os<<"{";
	for(auto e:v)os<<e<<",";
	return os<<"}";
}

#define mp make_pair
#define mt make_tuple
#define one(x) memset(x,-1,sizeof(x))
#define zero(x) memset(x,0,sizeof(x))
#ifdef LOCAL
void dmpr(ostream&os){os<<endl;}
template<class T,class... Args>
void dmpr(ostream&os,const T&t,const Args&... args){
	os<<t<<" ";
	dmpr(os,args...);
}
#define dmp2(...) dmpr(cerr,__LINE__,##__VA_ARGS__)
#else
#define dmp2(...) void(0)
#endif

using uint=unsigned;
using ull=unsigned long long;

template<class t,size_t n>
ostream& operator<<(ostream&os,const array<t,n>&a){
	return os<<vc<t>(all(a));
}

template<int i,class T>
void print_tuple(ostream&,const T&){
}

template<int i,class T,class H,class ...Args>
void print_tuple(ostream&os,const T&t){
	if(i)os<<",";
	os<<get<i>(t);
	print_tuple<i+1,T,Args...>(os,t);
}

template<class ...Args>
ostream& operator<<(ostream&os,const tuple<Args...>&t){
	os<<"{";
	print_tuple<0,tuple<Args...>,Args...>(os,t);
	return os<<"}";
}

ll read(){
	ll i;
	cin>>i;
	return i;
}

vi readvi(int n,int off=0){
	vi v(n);
	rep(i,n)v[i]=read()+off;
	return v;
}

pi readpi(int off=0){
	int a,b;cin>>a>>b;
	return pi(a+off,b+off);
}

template<class t>
void print_single(t x,int suc=1){
	cout<<x;
	if(suc==1)
		cout<<"\n";
	if(suc==2)
		cout<<" ";
}

template<class t,class u>
void print_single(const pair<t,u>&p,int suc=1){
	print_single(p.a,2);
	print_single(p.b,suc);
}

template<class T>
void print_single(const vector<T>&v,int suc=1){
	rep(i,v.size())
		print_single(v[i],i==int(v.size())-1?suc:2);
}

template<class T>
void print_offset(const vector<T>&v,ll off,int suc=1){
	rep(i,v.size())
		print_single(v[i]+off,i==int(v.size())-1?suc:2);
}

template<class T,size_t N>
void print_single(const array<T,N>&v,int suc=1){
	rep(i,N)
		print_single(v[i],i==int(N)-1?suc:2);
}

template<class T>
void print(const T&t){
	print_single(t);
}

template<class T,class ...Args>
void print(const T&t,const Args&...args){
	print_single(t,2);
	print(args...);
}

string readString(){
	string s;
	cin>>s;
	return s;
}

template<class T>
T sq(const T& t){
	return t*t;
}

void YES(bool ex=true){
	cout<<"YES\n";
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}
void NO(bool ex=true){
	cout<<"NO\n";
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}
void Yes(bool ex=true){
	cout<<"Yes\n";
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}
void No(bool ex=true){
	cout<<"No\n";
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}
//#define CAPITAL
/*
void yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<"\n";
	#else
	cout<<"Yes"<<"\n";
	#endif
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}
void no(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<"\n";
	#else
	cout<<"No"<<"\n";
	#endif
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}*/
void possible(bool ex=true){
	#ifdef CAPITAL
	cout<<"POSSIBLE"<<"\n";
	#else
	cout<<"Possible"<<"\n";
	#endif
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}
void impossible(bool ex=true){
	#ifdef CAPITAL
	cout<<"IMPOSSIBLE"<<"\n";
	#else
	cout<<"Impossible"<<"\n";
	#endif
	if(ex)exit(0);
	#ifdef LOCAL
	cout.flush();
	#endif
}

constexpr ll ten(int n){
	return n==0?1:ten(n-1)*10;
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

int topbit(signed t){
	return t==0?-1:31-__builtin_clz(t);
}
int topbit(ll t){
	return t==0?-1:63-__builtin_clzll(t);
}
int topbit(ull t){
	return t==0?-1:63-__builtin_clzll(t);
}
int botbit(signed a){
	return a==0?32:__builtin_ctz(a);
}
int botbit(ll a){
	return a==0?64:__builtin_ctzll(a);
}
int botbit(ull a){
	return a==0?64:__builtin_ctzll(a);
}
int popcount(signed t){
	return __builtin_popcount(t);
}
int popcount(ll t){
	return __builtin_popcountll(t);
}
int popcount(ull t){
	return __builtin_popcountll(t);
}
int bitparity(ll t){
	return __builtin_parityll(t);
}
bool ispow2(int i){
	return i&&(i&-i)==i;
}
ll mask(int i){
	return (ll(1)<<i)-1;
}
ull umask(int i){
	return (ull(1)<<i)-1;
}
ll minp2(ll n){
	if(n<=1)return 1;
	else return ll(1)<<(topbit(n-1)+1);
}

bool inc(int a,int b,int c){
	return a<=b&&b<=c;
}

template<class t> void mkuni(vc<t>&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}

ll rand_int(ll l, ll r) { //[l, r]
	//#ifdef LOCAL
	static mt19937_64 gen;
	/*#else
	static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
	#endif*/
	return uniform_int_distribution<ll>(l, r)(gen);
}

ll rand_int(ll k){ //[0,k)
	return rand_int(0,k-1);
}

template<class t>
void myshuffle(vc<t>&a){
	rep(i,si(a))swap(a[i],a[rand_int(0,i)]);
}

template<class t,class u>
int lwb(const vc<t>&v,const u&a){
	return lower_bound(all(v),a)-v.bg;
}
template<class t,class u>
bool bis(const vc<t>&v,const u&a){
	return binary_search(all(v),a);
}

vvc<int> readGraph(int n,int m){
	vvc<int> g(n);
	rep(i,m){
		int a,b;
		cin>>a>>b;
		//sc.read(a,b);
		a--;b--;
		g[a].pb(b);
		g[b].pb(a);
	}
	return g;
}

vvc<int> readTree(int n){
	return readGraph(n,n-1);
}

template<class t>
vc<t> presum(const vc<t>&a){
	vc<t> s(si(a)+1);
	rep(i,si(a))s[i+1]=s[i]+a[i];
	return s;
}
vc<ll> presum(const vi&a){
	vc<ll> s(si(a)+1);
	rep(i,si(a))s[i+1]=s[i]+a[i];
	return s;
}
//BIT で数列を管理するときに使う (CF850C)
template<class t>
vc<t> predif(vc<t> a){
	gnr(i,1,si(a))a[i]-=a[i-1];
	return a;
}
template<class t>
vvc<ll> imos(const vvc<t>&a){
	int n=si(a),m=si(a[0]);
	vvc<ll> b(n+1,vc<ll>(m+1));
	rep(i,n)rep(j,m)
		b[i+1][j+1]=b[i+1][j]+b[i][j+1]-b[i][j]+a[i][j];
	return b;
}

//verify してないや
void transvvc(int&n,int&m){
	swap(n,m);
}
template<class t,class... Args>
void transvvc(int&n,int&m,vvc<t>&a,Args&...args){
	assert(si(a)==n);
	vvc<t> b(m,vi(n));
	rep(i,n){
		assert(si(a[i])==m);
		rep(j,m)b[j][i]=a[i][j];
	}
	a.swap(b);
	transvvc(n,m,args...);
}
//CF854E
void rotvvc(int&n,int&m){
	swap(n,m);
}
template<class t,class... Args>
void rotvvc(int&n,int&m,vvc<t>&a,Args&...args){
	assert(si(a)==n);
	vvc<t> b(m,vi(n));
	rep(i,n){
		assert(si(a[i])==m);
		rep(j,m)b[m-1-j][i]=a[i][j];
	}
	a.swap(b);
	rotvvc(n,m,args...);
}

//ソートして i 番目が idx[i]
//CF850C
template<class t>
vi sortidx(const vc<t>&a){
	int n=si(a);
	vi idx(n);iota(all(idx),0);
	sort(all(idx),[&](int i,int j){return a[i]<a[j];});
	return idx;
}
//vs[i]=a[idx[i]]
//例えば sortidx で得た idx を使えば単にソート列になって返ってくる
//CF850C
template<class t>
vc<t> a_idx(const vc<t>&a,const vi&idx){
	int n=si(a);
	assert(si(idx)==n);
	vc<t> vs(n);
	rep(i,n)vs[i]=a[idx[i]];
	return vs;
}
//CF850C
vi invperm(const vi&p){
	int n=si(p);
	vi q(n);
	rep(i,n)q[p[i]]=i;
	return q;
}

template<class t,class s=t>
s SUM(const vc<t>&a){
	return accumulate(all(a),s(0));
}

template<class t>
t MAX(const vc<t>&a){
	return *max_element(all(a));
}

template<class t>
pair<t,int> MAXi(const vc<t>&a){
	auto itr=max_element(all(a));
	return mp(*itr,itr-a.bg);
}

template<class t>
t MIN(const vc<t>&a){
	return *min_element(all(a));
}

template<class t>
pair<t,int> MINi(const vc<t>&a){
	auto itr=min_element(all(a));
	return mp(*itr,itr-a.bg);
}

vi vid(int n){
	vi res(n);iota(all(res),0);
	return res;
}

template<class S>
void soin(S&s){
	sort(all(s));
}

template<class S,class F>
void soin(S&s,F&&f){
	sort(all(s),forward<F>(f));
}

template<class S>
S soout(S s){
	soin(s);
	return s;
}

template<class S>
void rein(S&s){
	reverse(all(s));
}

template<class S>
S reout(S s){
	rein(s);
	return s;
}

template<class t,class u>
pair<t,u>&operator+=(pair<t,u>&a,pair<t,u> b){
	a.a+=b.a;a.b+=b.b;return a;}
template<class t,class u>
pair<t,u>&operator-=(pair<t,u>&a,pair<t,u> b){
	a.a-=b.a;a.b-=b.b;return a;}
template<class t,class u>
pair<t,u> operator+(pair<t,u> a,pair<t,u> b){return mp(a.a+b.a,a.b+b.b);}
template<class t,class u>
pair<t,u> operator-(pair<t,u> a,pair<t,u> b){return mp(a.a-b.a,a.b-b.b);}

template<class t>
t gpp(vc<t>&vs){
	assert(si(vs));
	t res=move(vs.back());
	vs.pop_back();
	return res;
}

template<class t,class u>
void pb(vc<t>&a,const vc<u>&b){
	a.insert(a.ed,all(b));
}

template<class t,class...Args>
vc<t> cat(vc<t> a,Args&&...b){
	(pb(a,forward<Args>(b)),...);
	return a;
}

template<class t,class u>
vc<t>& operator+=(vc<t>&a,u x){
	for(auto&v:a)v+=x;
	return a;
}

template<class t,class u>
vc<t> operator+(vc<t> a,u x){
	return a+=x;
}

template<class t,class u>
vc<t>& operator-=(vc<t>&a,u x){
	for(auto&v:a)v-=x;
	return a;
}

template<class t,class u>
vc<t>& operator-(vc<t> a,u x){
	return a-=x;
}

template<class t,class u>
void remval(vc<t>&a,const u&v){
	a.erase(remove(all(a),v),a.ed);
}

template<class t,class u>
void fila(vc<t>&vs,const u&a){
	fill(all(vs),a);
}

template<class t,class u>
int findid(const vc<t>&vs,const u&a){
	auto itr=find(all(vs),a);
	if(itr==vs.ed)return -1;
	else return itr-vs.bg;
}

template<class t>
void rtt(vc<t>&vs,int i){
	rotate(vs.bg,vs.bg+i,vs.ed);
}

//copied from yosupo's library
//PARTLY VERIFIED

//USACO 2022 January ptlatinum C

#define GEOF

#ifdef GEOF
using ld=long double;
//using ld=double;
const ld PI=acos(ld(-1));
#else
using ld=ll;
#endif
const ld eps=1e-12;
int sgn(ld a){return a<-eps?-1:(a>eps?1:0);}
int sgn(ld a,ld b){return sgn(a-b);}
/*
using pt=complex<ld>;
#define x real()
#define y imag()
*/
struct pt {
    ld x,y;
    //pt(ld _x = ld(0), ld _y = ld(0)) : x(_x), y(_y) {}
    pt():x(0),y(0){}
    pt(ld xx,ld yy):x(xx),y(yy){}
    pt operator+(const pt& r) const { return {x + r.x, y + r.y}; }
    pt operator-(const pt& r) const { return {x - r.x, y - r.y}; }
    pt operator*(const pt& r) const {
        return {x * r.x - y * r.y, x * r.y + y * r.x};
    }
    pt inv()const{
		ld d=norm();
		return {x/d,-y/d};
	}
    pt operator/(const pt&r)const{
		return operator*(r.inv());
	}

    pt operator*(const ld& r) const { return {x * r, y * r}; }
    pt operator/(const ld& r) const { return {x / r, y / r}; }

    pt& operator+=(const pt& r) { return *this = *this + r; }
    pt& operator-=(const pt& r) { return *this = *this - r; }
    pt& operator*=(const pt& r) { return *this = *this * r; }
    pt& operator/=(const pt& r) { return *this = *this / r; }
    pt& operator*=(const ld& r) { return *this = *this * r; }
    pt& operator/=(const ld& r) { return *this = *this / r; }

    pt operator-() const { return {-x, -y}; }

	static int cmp(const pt&a,const pt&b){
		int v=sgn(a.x,b.x);
		return v?v:sgn(a.y,b.y);
	}
    bool operator<(const pt& r) const {
        return cmp(*this,r)<0;
    }
    bool operator<=(const pt& r) const {
        return cmp(*this,r)<=0;
    }
    bool operator>(const pt& r) const {
        return cmp(*this,r)>0;
    }
    bool operator==(const pt& r) const { return sgn((*this - r).rabs()) == 0; }
    bool operator!=(const pt& r) const { return !(*this == r); }

    ld norm() const { return x * x + y * y; }
    ld rabs() const { return max(std::abs(x), std::abs(y)); }  // robust abs
    pair<ld, ld> to_pair() const { return {x, y}; }
    #ifdef GEOF
    ld abs() const { return sqrt(norm()); }
    ld arg() const { return atan2(y, x); }
    static pt polar(ld le, ld th) { return {le * cos(th), le * sin(th)}; }
	#endif
};
istream& operator>>(istream& is, pt& p){
	return is>>p.x>>p.y;
}
ostream& operator<<(ostream& os, const pt& p) {
    return os << "pt(" << p.x << ", " << p.y << ")";
}
ld norm(const pt&a){
	return a.norm();
}
#ifdef GEOF
ld abs(const pt&a){
	return sqrt(norm(a));
}
//XXII Opencup Gpt of Ural K
pt normalized(const pt&a){
	return a/abs(a);
}
ld arg(const pt&a){return a.arg();}
//normalize to [-PI,PI)
//Contest 2: ptKU Contest 1, ptTZ Summer 2022 Day 4
ld normarg(ld a){
	ld res=fmod(a+PI,2*PI);
	if(res<0)res+=PI;
	else res-=PI;
	return res;
}
//normalize to [0,2*PI)
//Multiuni2023-10-E
ld normarg_nonnegative(ld a){
	ld res=fmod(a,2*PI);
	if(res<0)res+=2*PI;
	return res;
}
//AOJ1183
//arg between ab
//assume given lengths are valid
ld arg(ld a,ld b,ld c){
	return acos(min(max((a*a+b*b-c*c)/(2*a*b),ld(-1)),ld(1)));
}
#endif
ld norm(const pt&a,const pt&b){
	return (a-b).norm();
}
ld dot(const pt&a,const pt&b){return a.x*b.x+a.y*b.y;}
ld crs(const pt& a,const pt& b){return a.x*b.y-a.y*b.x;}
ld crs(const pt& a,const pt& b,const pt& c){return crs(b-a,c-a);}
int ccw(const pt& a,const pt& b){return sgn(crs(a,b));}
int ccw(const pt& a,const pt& b,const pt& c){return ccw(b-a,c-a);}
//(-pi,0](0,pi]
int argtype(const pt&a){
	if(sgn(a.y)==0)return a.x<0?1:0;
	return a.y<0?0:1;
}
int argcmp(const pt&a,const pt&b){
	int at=argtype(a),bt=argtype(b);
	if(at!=bt)return at<bt?-1:1;
	return -ccw(a,b);
};
bool argless(const pt&a,const pt&b){return argcmp(a,b)<0;}
//(-2)[a,-1](0)[b,1](2)
int bet(pt a,pt b,pt c){
	pt d=b-a;
	ld e=dot(d,c-a);
	if(sgn(e)<=0)return sgn(e)-1;
	return sgn(e-norm(d))+1;
}
//AOJ0153
//三角形 abc に d が含まれるか?0-no,1-edge,2-in
int cont(pt a,pt b,pt c,pt d){
	if(ccw(a,b,c)==-1) swap(b,c);
	return min({ccw(a,b,d),ccw(b,c,d),ccw(c,a,d)})+1;
}
//(a,b) を結ぶ直線を考え,x 座標との交点の y 座標を求める
//(分子,分母)を返す
pair<ld,ld> xcut(const pt&a,const pt&b,ld x){
	return mp(a.y*(b.x-x)-b.y*(a.x-x),b.x-a.x);
}
//XXII Opencup Gpt of Ural K
pt rot90(pt a){
	return pt(-a.y,a.x);
}
#ifdef GEOF
ld xcutval(const pt&a,const pt&b,ld x){
	auto [p,q]=xcut(a,b,x);
	return p/q;
}
//AOJ1183
//Xmas2010 E
//-+ の 順で返す
//a の符号により,small/large が決まる
int qeq(ld a,ld b,ld c,ld&d,ld&e){
	if(sgn(a)==0){
		if(sgn(b)==0)return 0;
		d=-c/b;
		return 1;
	}
	ld f=b*b-4*a*c;
	if(sgn(f)<0)return 0;
	ld g=sqrt(max(f,ld(0)));
	d=(-b-g)/(2*a);
	e=(-b+g)/(2*a);
	return sgn(f)+1;
}
#else
pt normdir(pt a){
	if(a==pt(0,0))return a;
	int g=gcd(a.x,a.y);
	return pt(a.x/g,a.y/g);
}
#endif

ld area2(const vc<pt>&ps){
	ld res=0;
	rep(i,si(ps))res+=crs(ps[i],ps[(i+1)%si(ps)]);
	return res;
}


using ln=pair<pt,pt>;
pt dir(ln a){return a.b-a.a;}
pt eval(ln a,ld b){return a.a+dir(a)*b;}
ld crs(ln a,pt b){return crs(a.a,a.b,b);}
int ccw(ln a,pt b){return ccw(a.a,a.b,b);}
int bet(ln a,pt b){return bet(a.a,a.b,b);}
ld projt(ln a,pt b){
	pt c=dir(a);
	return dot(c,b-a.a)/norm(c);
}
pt proj(ln a,pt b){
	pt c=dir(a);
	return a.a+c*dot(c,b-a.a)/norm(c);
}
pt refl(ln a,pt b){
	return proj(a,b)*2-b;
}
//AOJ1157
//0-no,1-yes(endpoint),2-yes(innner),3-overelap
//if the two line touch like this
// x----x----x
//it returns 1
int iss(ln a,ln b){
	int c1=ccw(a.a,a.b,b.a),c2=ccw(a.a,a.b,b.b);
	int d1=ccw(b.a,b.b,a.a),d2=ccw(b.a,b.b,a.b);
	if(c1||c2||d1||d2)return 1-max(c1*c2,d1*d2);
	int f=bet(a.a,a.b,b.a),g=bet(a.a,a.b,b.b);
	if(max(f,g)==-2||min(f,g)==2)return 0;
	if(max(f,g)==-1||min(f,g)==1)return 1;
	return 3;
}
//segment a intersects line b?
//endpoints inclusive
bool isl(ln a,ln b){
	int d1=ccw(b.a,b.b,a.a),d2=ccw(b.a,b.b,a.b);
	return d1*d2<=0;
}
//並行でない->true, というだけ
//直線が一致とかは考えてないことに注意
bool ill(ln a,ln b){
	return ccw(dir(a),dir(b));
}
ld cllt(ln a,ln b){
	return crs(b.a,b.b,a.a)/crs(dir(a),dir(b));
}
//ICPC Yokohama 2022 J
pair<ld,ld> clltf(ln a,ln b){
	return mp(crs(b.a,b.b,a.a),crs(dir(a),dir(b)));
}
//AOJ1033
pt cll(ln a,ln b){
	return eval(a,crs(b.a,b.b,a.a)/crs(dir(a),dir(b)));
}
#ifdef GEOF
//AOJ2201
ld dlp(ln a,pt b){
	return abs(crs(a,b)/abs(dir(a)));
}
//AOJ0153
ld dsp(ln a,pt b){
	pt c=proj(a,b);
	if(abs(bet(a.a,a.b,c))<=1)return abs(b-c);
	return min(abs(b-a.a),abs(b-a.b));
}
//ABC314H
//b から最も近い a 上の点を返す
pt dsp_tar(ln a,pt b){
	pt c=proj(a,b);
	if(abs(bet(a.a,a.b,c))<=1)return c;
	return abs(b-a.a)<abs(b-a.b)?a.a:a.b;
}
//AOJ1157
ld dss(ln a,ln b){
	if(iss(a,b))return 0;
	return min({dsp(a,b.a),dsp(a,b.b),dsp(b,a.a),dsp(b,a.b)});
}
//AOJ2160
//反時計回り方向に伸びる垂直二等分線
ln vbis(pt a,pt b){
	pt c=(a+b)*ld(0.5),d=b-a;
	return ln(c,pt(c.x-d.y,c.y+d.x));
}
ld cutareat(ln z,ld l,ld r){
	pt a=eval(z,l);
	pt b=eval(z,r);
	return -(b.x-a.x)*(a.y+b.y)/2;
}
#endif
//ABC286H
//simple polygon と線分が交わるか
//接している場合も true
/*bool icl(const vc<pt>&ps,ln z){
	int n=si(ps);
	rep(i,n){
		pt p=ps[i],q=ps[(i+1)%n];
		if(iss(z,ln(p,q)))return true;
	}
	return cont(ps,z.a);
}*/

vc<pt> halfpint(vc<ln> s){
	sort(all(s),[&](ln a,ln b){
		int c=argcmp(dir(a),dir(b));
		if(c)return c<0;
		return ccw(b,a.a)>0;
	});
	s.erase(unique(all(s),[&](ln a,ln b){
		return argcmp(dir(a),dir(b))==0;
	}),s.ed);
	int n=si(s);
	vi cur;
	rep(ii,n*2){
		int i=ii%n,m;
		while((m=si(cur))>=2){
			if(ccw(s[i],cll(s[cur[m-2]],s[cur[m-1]]))>0)break;
			cur.pop_back();
		}
		cur.pb(i);
	}
	vi cnt(n);
	for(auto i:cur)cnt[i]++;
	vc<ln> t;
	rep(i,n)if(cnt[i]==2)t.pb(s[i]);
	int m=si(t);
	vc<pt> res(m);
	rep(i,m)res[i]=cll(t[i],t[(i+1)%m]);
	return res;
}

bool dbg=false;

ld subsub(pt a,pt b){
	if(sgn(a.x,b.x)==0)return 0;
	
	ld p=(b.y-a.y)/(b.x-a.x);
	ld q=a.y-a.x*p;
	
	auto eval=[&](ld x){
		return p/4*x*x*x*x+q/3*x*x*x;
	};
	
	return eval(b.x)-eval(a.x);
}

ld sub(pt a,pt b){
	ld res=subsub(a,b);
	res+=subsub(rot90(a),rot90(b));
	return res;
}

ld calc(const vc<pt>&ps,pt tar){
	ld ans=0;
	
	rep(i,si(ps)){
		ans+=sub(ps[i]-tar,ps[(i+1)%si(ps)]-tar);
	}
	
	return -ans;
}

void slv(){
	vc<ln> rect;
	ld A;
	{
		int xl,yl,xr,yr;
		cin>>xl>>yl>>xr>>yr;
		
		vc<pt> ps;
		ps.eb(xl,yl);
		ps.eb(xr,yl);
		ps.eb(xr,yr);
		ps.eb(xl,yr);
		rep(i,4)rect.eb(ps[i],ps[(i+1)%4]);
		
		A=(xr-xl)*(yr-yl);
	}
	
	int n;cin>>n;
	vc<pt> ps(n);
	rep(i,n)cin>>ps[i];
	
	ld ans=0;
	//min
	rep(i,n){
		vc<ln> cur=rect;
		rep(j,n)if(i!=j)cur.pb(vbis(ps[i],ps[j]));
		
		auto z=halfpint(cur);
		
		ans-=calc(z,ps[i]);
	}
	dmp(ans);
	
	//max
	rep(i,n){
		vc<ln> cur=rect;
		rep(j,n)if(i!=j)cur.pb(vbis(ps[j],ps[i]));
		
		auto z=halfpint(cur);
		
		ans+=calc(z,ps[i]);
	}
	
	dmp(ans);
	print(ans*PI/A);
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	
	if(dbg){
		while(1)slv();
	}else{
		//int t;cin>>t;rep(_,t)
		slv();
	}
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 4116kb

input:

0 0 2 2
2
3 1
1 3

output:

8.37758040957278196908

result:

ok found '8.3775804', expected '8.3775804', error '0.0000000'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3896kb

input:

0 0 2 2
2
5 1
1 3

output:

37.69911184307751886649

result:

ok found '37.6991118', expected '37.6991118', error '0.0000000'

Test #3:

score: 0
Accepted
time: 2169ms
memory: 4240kb

input:

-2911 2151 336 5941
2000
-83 79
-94 47
48 -29
-47 64
84 75
-44 -86
-58 -11
-31 58
20 53
80 -19
-82 74
-60 -26
8 -68
-42 -61
-14 12
-58 -18
92 10
35 -26
71 64
76 89
-80 6
70 4
-96 -99
95 -80
-3 -22
71 -89
-75 17
-35 -82
-59 95
60 48
-74 50
-82 90
-26 5
-75 -31
-45 85
85 14
-70 -57
59 46
55 13
-23 60
...

output:

6657168.14285338595982466359

result:

ok found '6657168.1428534', expected '6657168.1428534', error '0.0000000'

Test #4:

score: 0
Accepted
time: 2158ms
memory: 4408kb

input:

-3013 5287 7654 9132
2000
-19 49
-17 -35
64 68
48 -49
-72 -14
29 -93
-13 -8
-80 11
39 88
-31 82
68 -66
5 41
-74 -8
0 15
11 34
69 -12
15 -86
5 -78
-48 73
10 9
-2 8
81 52
41 -43
-45 -41
-23 60
-40 -45
-26 27
-32 73
8 -20
2 91
46 17
51 -66
-65 -32
37 -9
58 63
-14 -31
60 -56
-85 -22
9 -66
-7 -53
-21 40
...

output:

10130702.49401499020041228505

result:

ok found '10130702.4940150', expected '10130702.4940150', error '0.0000000'

Test #5:

score: 0
Accepted
time: 2185ms
memory: 4160kb

input:

-5561 9559 6905 9930
2000
79 338
2 214
325 -193
-390 -157
-517 943
-759 970
449 901
-369 636
-661 -211
847 -558
223 -564
185 822
-656 -854
-991 -617
-422 -169
-63 -799
327 -911
-960 945
-948 831
-494 93
266 -299
139 -535
796 707
75 -146
10 566
72 -713
-132 -341
348 924
-739 -838
982 995
-445 500
-71...

output:

158891446.62387780728749930859

result:

ok found '158891446.6238778', expected '158891446.6238778', error '0.0000000'

Test #6:

score: 0
Accepted
time: 2195ms
memory: 4168kb

input:

-5245 -7558 1275 934
2000
-40 125
79 -30
49 13
-127 153
-151 -28
-82 -140
147 131
123 -105
-84 71
-49 -146
-140 82
57 172
-140 -32
-173 24
-55 -101
44 142
-68 -114
122 69
-137 66
19 199
31 109
-161 -66
63 -101
65 -114
166 -66
83 -162
60 70
-19 -134
15 161
-130 22
-130 50
8 -121
150 89
132 44
-131 -3...

output:

11172638.26562360928437556140

result:

ok found '11172638.2656236', expected '11172638.2656236', error '0.0000000'

Test #7:

score: 0
Accepted
time: 2179ms
memory: 4220kb

input:

-7167 6117 -3297 6866
2000
-346 -144
-227 169
-168 -373
-63 -227
-24 405
-232 -163
295 22
222 351
293 41
-335 260
-43 -426
-205 193
163 -284
-406 284
-202 -114
-339 -86
-413 17
-237 -394
-333 -145
-104 416
-478 -53
451 102
85 58
-124 -472
424 -88
394 243
-459 45
12 -490
-9 465
-159 -202
315 -272
-24...

output:

52361392.51502746709957136773

result:

ok found '52361392.5150275', expected '52361392.5150275', error '0.0000000'

Test #8:

score: 0
Accepted
time: 2213ms
memory: 4468kb

input:

-6462 -5871 5937 5853
2000
386 236
-108 937
-722 354
-710 -475
462 613
-884 446
595 -675
168 394
-744 -551
761 -399
-688 258
-53 104
-614 -177
-273 -678
794 -15
224 -911
-146 -216
53 633
2 -664
202 -440
24 437
495 623
-297 682
-520 -48
598 720
-7 353
163 744
557 13
395 588
-157 -672
631 -705
-68 818...

output:

57605018.87011638417243375443

result:

ok found '57605018.8701164', expected '57605018.8701164', error '0.0000000'

Test #9:

score: 0
Accepted
time: 2211ms
memory: 4168kb

input:

792 4703 2923 5458
2000
7281 5289
-5154 2943
-8483 3113
9380 -576
-2191 -291
-8200 898
-192 4724
1161 441
34 3999
8544 3576
-5481 4273
-9792 9565
4854 1262
4254 -3376
-5778 9480
8631 -2225
7129 2187
5344 7740
2975 6174
-2919 -7172
7990 -5117
-6823 -7233
5020 5269
-9874 1051
8841 4586
-3612 -7483
644...

output:

1133083681.54547019314486533403

result:

ok found '1133083681.5454702', expected '1133083681.5454702', error '0.0000000'

Test #10:

score: 0
Accepted
time: 2204ms
memory: 4176kb

input:

-4075 7303 -1671 8073
2000
-10 305
-1105 -119
-238 205
-1206 -482
943 -89
-1578 223
-520 1158
21 1622
-621 -886
-163 -515
283 1802
36 -1410
213 -1921
-1539 -231
835 148
56 1448
-407 1653
1896 -533
1321 -437
530 172
132 18
1260 586
-363 -220
989 1353
281 -1907
-1116 -801
695 592
1221 -983
1731 -939
-...

output:

205950762.73416205152170732617

result:

ok found '205950762.7341621', expected '205950762.7341621', error '0.0000000'

Test #11:

score: 0
Accepted
time: 2234ms
memory: 4392kb

input:

2121 3865 3457 7582
2000
3902 -1511
-1817 504
-3515 3188
-4470 211
536 1795
2230 -1512
3979 297
2430 901
2368 2525
-2553 -252
476 2279
-3859 2565
-754 396
3358 2726
4787 -664
173 1056
-1154 -1556
-2442 -406
-1838 976
3785 1136
-131 -421
77 4058
3773 2965
1333 -622
4188 -2571
-624 -2051
-1965 4268
-1...

output:

399702074.05400645060581155121

result:

ok found '399702074.0540065', expected '399702074.0540065', error '0.0000000'

Test #12:

score: 0
Accepted
time: 2217ms
memory: 4284kb

input:

5377 -2525 9878 7241
2000
316 9854
1690 3184
-9795 -898
-7924 3181
-2410 1478
-3849 -8880
8447 -487
3826 -2478
1445 -2923
5459 677
8830 -3598
1045 -5139
7231 -6856
-4410 4982
-3180 -2528
-7891 -4137
6686 -3732
-6102 -1926
6562 5714
4562 -5710
223 -9921
2609 -3935
8187 55
-5017 -4465
-1387 -2695
6015...

output:

1061816977.66765950800618156791

result:

ok found '1061816977.6676595', expected '1061816977.6676595', error '0.0000000'

Test #13:

score: 0
Accepted
time: 2028ms
memory: 4420kb

input:

-3243 -8661 4122 -2937
2000
1 7637
0 1870
1 7982
-1 -391
0 -4347
-1 2035
0 -2623
0 6943
0 1511
0 -8789
-1 7213
1 -4998
1 -8958
1 -182
-1 -318
1 3712
0 -3215
1 -5210
1 6983
-1 -2567
1 -470
-1 7652
0 -2394
1 7196
1 280
1 5785
1 545
1 8779
1 1
1 -9675
1 5137
-1 -1160
1 -3955
0 3176
0 -6143
0 519
1 5678...

output:

791760973.95850041136145591736

result:

ok found '791760973.9585004', expected '791760973.9585004', error '0.0000000'

Test #14:

score: 0
Accepted
time: 2023ms
memory: 4308kb

input:

-4763 3483 5561 3747
2000
-3915 1
8391 -1
-4112 0
5453 -1
-8775 1
-2182 0
-3819 1
-2702 1
-7119 1
1279 0
7959 -1
-4345 0
-1024 1
-4853 -1
-2637 1
-2136 -1
-9603 -1
-5869 1
-1765 1
-3625 1
9255 0
4677 1
4660 -1
3250 1
-8156 -1
-2988 0
8492 1
-961 0
9331 -1
-1913 1
-3152 0
8877 -1
8390 0
3420 0
-7929 ...

output:

505360943.97037654637824743986

result:

ok found '505360943.9703766', expected '505360943.9703766', error '0.0000000'

Test #15:

score: 0
Accepted
time: 2162ms
memory: 4244kb

input:

-8627 -2766 -1956 4443
2000
-4 -9231
-6 -3132
4 176
1 8378
1 6264
-3 -9699
-10 -6369
-9 -4283
-7 7401
1 -1418
7 -5096
7 -7114
-4 -3937
2 5922
-1 6133
6 -8932
-6 3552
2 4767
9 7643
3 4129
4 2295
-5 8379
1 768
-10 -8915
5 4022
-6 -6665
4 4425
-3 6046
6 3827
-5 3831
-6 -6224
5 9807
9 11
5 4503
-6 -5911...

output:

448946370.79278803587658330798

result:

ok found '448946370.7927880', expected '448946370.7927880', error '0.0000000'

Test #16:

score: 0
Accepted
time: 2174ms
memory: 4228kb

input:

-4229 -9182 1776 -5186
2000
8444 3
3252 6
-7072 5
5793 -1
1339 2
-3500 6
-9676 -4
-1101 -8
-4997 7
462 -6
1476 7
-1331 9
561 -4
-951 -6
-466 -8
-8455 2
8033 -5
2982 9
-7803 6
8473 1
674 5
-7228 -1
-1891 -10
-3408 -7
-917 -8
9486 -5
355 9
1212 -4
3712 10
9106 1
9958 1
7446 -5
8816 -1
-1752 4
4285 0
-...

output:

438654068.21846055137575604022

result:

ok found '438654068.2184606', expected '438654068.2184606', error '0.0000000'

Test #17:

score: 0
Accepted
time: 2193ms
memory: 4380kb

input:

-6880 -3012 949 2588
2000
56 -2490
59 -8874
-90 7871
-48 9340
-29 -4546
72 1776
-22 -8437
-7 5228
6 -2206
89 -5714
71 -6149
44 8645
-17 -8800
19 -8446
-31 -1438
58 4422
-10 -6275
98 -7180
21 -3721
14 3061
-60 -2084
45 4628
-57 -7683
-19 -5389
97 4046
58 5141
-44 288
49 -3579
-39 -7224
94 5901
-68 -3...

output:

411858700.04329930656240321696

result:

ok found '411858700.0432993', expected '411858700.0432993', error '0.0000000'

Test #18:

score: 0
Accepted
time: 2182ms
memory: 4244kb

input:

2772 -6314 4903 4834
2000
-9330 45
1739 56
1062 -58
6549 -25
2178 88
-6106 -87
-6078 -75
-9429 58
2648 -27
-9516 52
9061 -9
-1775 -3
-6885 74
-4346 27
-1758 -95
-9196 87
-752 -98
1724 -24
825 8
-2431 18
-360 14
1472 52
8871 -71
7205 -39
-8033 -28
8724 8
-5197 -52
9320 -2
2849 -64
-968 -77
9867 100
3...

output:

605362233.75295626011211425066

result:

ok found '605362233.7529563', expected '605362233.7529563', error '0.0000000'

Test #19:

score: 0
Accepted
time: 2207ms
memory: 4324kb

input:

-10000 -10000 10000 10000
2000
8592 4096
9271 1216
8596 5077
9077 1756
9059 3053
8744 4685
8509 4543
7828 4581
8975 2478
9394 2850
9194 3045
9532 1437
9290 1261
8175 4923
8485 4507
8166 4987
8578 4973
9548 2129
9018 3543
8136 5431
8830 2783
9636 2605
8589 2865
9617 1981
9427 1091
7817 5017
9129 1790...

output:

238108908.61757981852861121297

result:

ok found '238108908.6175798', expected '238108908.6175798', error '0.0000000'

Test #20:

score: 0
Accepted
time: 2216ms
memory: 4232kb

input:

-10000 -10000 10000 10000
2000
6262 7501
9152 454
8076 5537
5939 7930
9638 2163
8615 4078
9554 1084
4352 8207
9578 1188
9456 406
8908 3352
5449 7414
8782 3668
8621 4472
9319 957
6598 6780
8818 2341
6747 7300
9941 555
7653 6219
9183 342
7768 5183
8604 4366
3084 8703
7005 6054
7108 6347
9604 498
9180 ...

output:

397620990.08414207777241244912

result:

ok found '397620990.0841421', expected '397620990.0841421', error '0.0000000'

Test #21:

score: 0
Accepted
time: 2207ms
memory: 4292kb

input:

-10000 -10000 10000 10000
2000
1066 9157
9386 1781
6605 7086
2309 8912
9690 2029
7780 6101
-590 9528
9389 1295
7597 5489
9036 4111
6848 6367
5728 7783
8672 4455
7349 5754
9546 1194
391 9337
7748 5828
4912 8500
3010 8983
9877 1235
6371 6950
8942 4055
2111 9469
703 9760
7671 5156
7290 5623
-135 9974
8...

output:

554491808.93941588490270078182

result:

ok found '554491808.9394159', expected '554491808.9394159', error '0.0000000'

Test #22:

score: 0
Accepted
time: 2230ms
memory: 4252kb

input:

-10000 -10000 10000 10000
2000
9179 3249
-7440 6141
1589 9872
-7325 6455
5681 8184
-5197 8181
-4609 8595
8619 4125
6442 6792
-3591 8889
9340 1215
4556 8497
8772 4168
-7033 6910
-6024 7886
9454 1423
2080 9352
799 9732
-1392 9561
-1456 9358
9027 2880
8692 3510
7747 6163
-4921 8380
9405 1846
9325 1029
...

output:

689400531.77838509774301201105

result:

ok found '689400531.7783850', expected '689400531.7783850', error '0.0000000'

Test #23:

score: 0
Accepted
time: 2194ms
memory: 4348kb

input:

-10000 -10000 10000 10000
2000
-413 9522
8730 4470
3507 9168
5383 8069
8670 4427
-9308 3173
7997 5312
4959 8042
9698 943
7838 5266
-1664 9690
-8665 4435
-7997 5929
-8004 5304
6458 7586
1075 9349
-9665 1477
-9045 3807
-2560 9625
-9175 3732
-2041 9416
4209 8993
-4289 8826
-9394 2481
9442 2659
9358 241...

output:

801988277.64484845584956929088

result:

ok found '801988277.6448485', expected '801988277.6448485', error '0.0000000'

Test #24:

score: 0
Accepted
time: 2180ms
memory: 4240kb

input:

-10000 -10000 10000 10000
2000
-8928 -3936
-6761 7287
-9682 -71
-8639 -3984
-9595 2735
293 9693
2163 9632
-8395 5266
69 9738
-7522 6527
-9270 -2254
1248 9688
-9575 -961
9627 1763
-9052 3587
-7114 6320
1541 9699
9483 1490
9715 929
9537 2145
9232 2774
-8662 4803
-2298 9383
-3408 8923
7113 6554
3071 91...

output:

876785969.03840662928996607661

result:

ok found '876785969.0384066', expected '876785969.0384066', error '0.0000000'

Test #25:

score: 0
Accepted
time: 2179ms
memory: 4244kb

input:

-10000 -10000 10000 10000
2000
-9635 -653
-8720 -4280
-5995 7913
-9350 -2497
-5442 8109
-8247 -5020
-9214 3473
-9607 719
-9089 -3142
-9469 -1962
-9849 -106
9096 3352
-4680 -8597
9250 3140
9456 1742
-3524 8952
6527 7385
-1748 9791
-7220 -6715
9498 2723
4248 8776
-2148 9563
-8946 3525
-8594 -4460
-310...

output:

917958796.41764164780033752322

result:

ok found '917958796.4176416', expected '917958796.4176416', error '0.0000000'

Test #26:

score: 0
Accepted
time: 2196ms
memory: 4236kb

input:

-10000 -10000 10000 10000
2000
-8424 4882
9874 1054
-7516 6283
5824 7919
-9492 2869
-8465 -5065
-7677 6023
9658 1194
-9032 -4038
-1597 9671
-6382 -7575
-7148 6793
-4487 8777
-4574 -8576
5921 7980
-7095 6804
9757 1960
-446 9756
9784 1908
2863 -9539
-860 9863
-9683 1374
-7696 6223
-8488 5254
-9338 262...

output:

949084958.81866037705913186073

result:

ok found '949084958.8186604', expected '949084958.8186604', error '0.0000000'

Test #27:

score: 0
Accepted
time: 2179ms
memory: 4288kb

input:

-10000 -10000 10000 10000
2000
4185 -8886
7933 -5859
-9624 1869
5116 8492
7405 6679
-5390 8255
3698 -9149
-3048 -9443
-4420 8767
4593 8716
-186 9893
-654 9837
6586 7495
4835 8649
-6838 7288
-9548 2300
9526 2926
2929 9402
3564 9256
5371 8359
-9883 306
-9009 -4168
-6262 -7699
-7990 -5794
8096 5562
391...

output:

962273357.46533463796367868781

result:

ok found '962273357.4653347', expected '962273357.4653347', error '0.0000000'

Test #28:

score: 0
Accepted
time: 2177ms
memory: 4484kb

input:

-10000 -10000 10000 10000
2000
-9661 -2487
-3295 -9339
6986 -7122
1152 9901
-7469 6523
-8947 4408
9954 641
-9417 -3097
-4042 9040
3350 9383
1721 -9757
5006 8565
-3414 9369
7563 6502
3795 -9153
7684 6358
2612 -9594
-2043 -9715
9761 -1880
-5955 -8019
-181 9958
8931 4398
-9859 -1329
-5689 8176
-7462 65...

output:

962638552.46351128321839496493

result:

ok found '962638552.4635112', expected '962638552.4635112', error '0.0000000'

Test #29:

score: 0
Accepted
time: 2168ms
memory: 4324kb

input:

-10000 -10000 10000 10000
2000
8501 5255
-8375 5447
-35 -9991
1854 9816
9333 3581
8958 -4423
-6372 -7702
-293 9993
-1478 -9890
-8828 4676
1480 9885
-9766 -2134
-8209 5701
-8515 5226
-9521 -3051
-9975 -587
-6593 7507
2775 9596
-6945 7186
-368 9993
-4697 -8821
-9977 633
-8 9993
-7503 -6601
7996 5999
-...

output:

961606219.67529082845430821180

result:

ok found '961606219.6752908', expected '961606219.6752908', error '0.0000000'

Test #30:

score: 0
Accepted
time: 2159ms
memory: 4200kb

input:

-10000 -10000 10000 10000
2000
-4177 9085
709 -9974
-9702 2419
-9989 -450
-670 -9977
-8072 5901
-7972 -6036
8638 -5038
-9624 -2714
-9108 4127
6539 -7565
5370 -8435
8466 -5320
-6576 -7533
9035 4285
-5956 -8032
9068 -4215
4025 -9154
5545 8321
7320 -6812
-2950 -9554
8695 4939
9065 4221
3229 9464
-9897 ...

output:

961547221.20827059220755472779

result:

ok found '961547221.2082705', expected '961547221.2082705', error '0.0000000'

Test #31:

score: 0
Accepted
time: 27ms
memory: 3844kb

input:

-10000 -10000 10000 10000
256
5008 -4851
-4668 -5179
-2736 6413
5139 -4712
-2803 6384
1723 6756
-1659 -6772
6259 3072
-5832 -3821
4028 -5691
-6651 -2092
-5179 -4668
6899 1008
-5691 4028
-2317 -6576
-5179 4668
6952 531
6948 581
6789 1588
5691 -4028
-1723 6756
-1659 6772
-2136 -6637
-6576 2317
4596 52...

output:

670393490.38195454294327646494

result:

ok found '670393490.3819546', expected '670393490.3819546', error '0.0000000'

Test #32:

score: 0
Accepted
time: 35ms
memory: 3980kb

input:

-10000 -10000 10000 10000
288
-456 -8767
6240 6175
-2600 -8385
-4796 -7353
-8740 825
-8511 -2152
575 8760
5716 -6663
-6625 -5760
-5148 -7111
-8200 3135
-6864 5473
8200 -3135
-3300 8135
8000 3615
5057 7176
-8697 1196
-4231 7692
3615 8000
-2951 -8268
2017 -8544
8200 3135
-6663 -5716
-6240 -6175
2241 8...

output:

844114805.06146870006341487169

result:

ok found '844114805.0614687', expected '844114805.0614687', error '0.0000000'

Test #33:

score: 0
Accepted
time: 27ms
memory: 4020kb

input:

-10000 -10000 10000 10000
256
-2750 9655
-6074 7993
6970 7225
6922 -7271
-9847 -1954
6358 -7769
8030 6025
-9970 1175
-8030 6025
9050 4345
2686 -9673
6439 -7702
-9095 4250
5591 8338
9970 1175
1175 9970
5783 -8206
2750 9655
-4726 -8857
9638 -2809
-7702 -6439
9977 1114
-5095 -8650
3863 -9266
5042 -8681...

output:

965086521.74051899736514315009

result:

ok found '965086521.7405190', expected '965086521.7405190', error '0.0000000'

Test #34:

score: 0
Accepted
time: 3ms
memory: 4068kb

input:

-10000 -10000 10000 10000
72
-9765 -7270
9547 7554
7270 -9765
-9083 -8106
9083 8106
9547 -7554
8070 -9115
-7050 9925
-8427 8786
7050 -9925
-7050 -9925
8427 -8786
-9030 8165
-8427 -8786
-9450 7675
8165 9030
9450 7675
-7554 9547
-9925 -7050
7675 9450
-7270 9765
-9115 -8070
9450 -7675
8485 -8730
9115 -...

output:

1128792509.41755821148399263620

result:

ok found '1128792509.4175582', expected '1128792509.4175582', error '0.0000000'

Test #35:

score: 0
Accepted
time: 1ms
memory: 3916kb

input:

-10000 -10000 10000 10000
32
-9272 9271
9272 9271
9272 -9271
9599 8932
-9712 8809
-8809 -9712
8932 -9599
-8932 9599
8809 9712
9271 9272
8831 -9692
-9692 -8831
8809 -9712
-9271 9272
-9271 -9272
9271 -9272
-9712 -8809
-8831 -9692
-9599 8932
8831 9692
-9599 -8932
-8932 -9599
-8831 9692
9692 -8831
-8809...

output:

1182673090.41968809138052165508

result:

ok found '1182673090.4196880', expected '1182673090.4196880', error '0.0000000'

Test #36:

score: 0
Accepted
time: 3ms
memory: 3988kb

input:

-10000 -10000 10000 10000
80
235 2730
-1221 5278
-1925 7550
-325 3550
8886 -2123
-1355 5610
-1595 6290
1894 917
-2170 9685
2446 453
-550 3925
-1158 5131
885 1930
-1829 7122
-2165 9530
2325 550
3925 -550
5610 -1355
8965 -2130
-1502 6011
3995 -590
-2026 8107
75 2950
-1190 5205
-1410 5755
917 1894
9530...

output:

657040895.88731246814131736755

result:

ok found '657040895.8873124', expected '657040895.8873124', error '0.0000000'

Test #37:

score: 0
Accepted
time: 4ms
memory: 4032kb

input:

-10000 -10000 10000 10000
96
-5571 9222
6051 -5082
-1885 -90
4835 -4710
1373 -2986
1802 -3261
5715 -4990
2157 -3474
554 -2403
1085 -2790
2765 -3810
-3474 2157
9222 -5571
3293 -4074
9885 -5590
-1789 -202
-4867 5306
-4515 4310
9059 -5562
-4710 4835
-90 -1885
-5166 6387
-5581 9458
7502 -5389
-835 -1210...

output:

836413049.37692471500486135483

result:

ok found '836413049.3769248', expected '836413049.3769248', error '0.0000000'

Test #38:

score: 0
Accepted
time: 4ms
memory: 3976kb

input:

-10000 -10000 10000 10000
96
6815 -9370
-9201 5918
705 -7290
-9502 7761
-9042 5231
321 -7078
-3265 -4470
-6154 -1153
-7078 321
2510 -8145
2390 -8095
-6879 -22
-4870 -2815
-8898 4689
-4735 -2970
-5665 -1830
-4170 -3585
4689 -8898
-177 -6786
-6081 -1258
-9294 6383
-2815 -4870
-3585 -4170
-6198 -1089
9...

output:

1059819845.87405379139818251133

result:

ok found '1059819845.8740538', expected '1059819845.8740538', error '0.0000000'

Test #39:

score: 0
Accepted
time: 1ms
memory: 3912kb

input:

-10000 -10000 10000 10000
38
-6467 -5256
-9635 -880
-3179 -8172
-2444 -8683
-6992 -4669
-5155 -6560
-1085 -9520
-1316 -9387
-8765 -2320
-9520 -1085
-4163 -7416
-5256 -6467
-3940 -7595
-1781 -9108
-6660 -5045
-7416 -4163
-880 -9635
-7740 -3755
-2988 -8309
-9387 -1316
-5740 -6005
-8309 -2988
-9108 -17...

output:

401223489.83345467832987196743

result:

ok found '401223489.8334547', expected '401223489.8334547', error '0.0000000'

Test #40:

score: 0
Accepted
time: 0ms
memory: 4028kb

input:

-10000 -10000 10000 10000
16
-8681 -6822
-6822 -8681
-6998 -8521
-7191 -8342
-9794 -5497
-8521 -6998
-5497 -9794
-7558 -7991
-9578 -5769
-9682 -5639
-8999 -6462
-6462 -8999
-8342 -7191
-5639 -9682
-5769 -9578
-7991 -7558

output:

181599089.45246999032679013908

result:

ok found '181599089.4524700', expected '181599089.4524700', error '0.0000000'

Test #41:

score: 0
Accepted
time: 0ms
memory: 4056kb

input:

-10000 -10000 10000 10000
10
-9880 -6785
-7472 -9279
-7079 -9628
-7225 -9500
-7775 -9000
-9500 -7225
-9628 -7079
-9279 -7472
-6785 -9880
-9000 -7775

output:

130181610.02564661891665309668

result:

ok found '130181610.0256466', expected '130181610.0256466', error '0.0000000'

Test #42:

score: 0
Accepted
time: 0ms
memory: 3892kb

input:

-10000 -10000 10000 10000
4
-9480 -9015
-9900 -8575
-8575 -9900
-9015 -9480

output:

55539550.12437228407361544669

result:

ok found '55539550.1243723', expected '55539550.1243723', error '0.0000000'

Test #43:

score: 0
Accepted
time: 0ms
memory: 3984kb

input:

-10000 -10000 10000 10000
4
-10000 -10000
10000 -10000
-10000 10000
10000 10000

output:

1256637061.43591729539912194014

result:

ok found '1256637061.4359174', expected '1256637061.4359174', error '0.0000000'

Test #44:

score: 0
Accepted
time: 1775ms
memory: 4288kb

input:

-10000 -10000 10000 10000
2000
2044 2044
-8714 -8714
-918 -918
2587 2587
-6059 -6059
5193 5193
-9894 -9894
-4609 -4609
55 55
2687 2687
3106 3106
8183 8183
2735 2735
-2950 -2950
579 579
-1338 -1338
-6756 -6756
42 42
-169 -169
9040 9040
-9228 -9228
-4915 -4915
-3211 -3211
7013 7013
4183 4183
5113 5113...

output:

1151330698.42148765199817717075

result:

ok found '1151330698.4214876', expected '1151330698.4214876', error '0.0000000'

Test #45:

score: 0
Accepted
time: 1770ms
memory: 4436kb

input:

-10000 -10000 10000 10000
2000
-6538 -6538
5148 5148
9850 9850
7282 7282
-2282 -2282
-5028 -5028
4922 4922
9956 9956
5469 5469
2292 2292
-6534 -6534
7401 7401
4104 4104
8427 8427
-6193 -6193
-9024 -9024
7928 7928
-2241 -2241
8125 8125
-4976 -4976
-3666 -3666
5405 5405
-5271 -5271
-9353 -9353
-8746 -...

output:

1148135739.93334833602420985699

result:

ok found '1148135739.9333484', expected '1148135739.9333484', error '0.0000000'

Test #46:

score: 0
Accepted
time: 1793ms
memory: 4404kb

input:

-10000 -10000 10000 10000
2000
9476 9476
-9869 -9869
8080 8080
8383 8383
9669 9669
-8486 -8486
8674 8674
-9236 -9236
8525 8525
9227 9227
-8259 -8259
-9401 -9401
-9303 -9303
8737 8737
-9672 -9672
-8361 -8361
-8521 -8521
-9700 -9700
-9360 -9360
-9854 -9854
-8582 -8582
-9997 -9997
8518 8518
-9861 -9861...

output:

980285475.08093044033739715815

result:

ok found '980285475.0809305', expected '980285475.0809305', error '0.0000000'

Test #47:

score: 0
Accepted
time: 1783ms
memory: 4508kb

input:

-10000 -10000 10000 10000
2000
-1646 -1646
742 742
1462 1462
657 657
-1336 -1336
622 622
-1498 -1498
-1007 -1007
1219 1219
260 260
1951 1951
-1476 -1476
713 713
878 878
403 403
1542 1542
1878 1878
-1959 -1959
244 244
384 384
-1830 -1830
-1536 -1536
1554 1554
1423 1423
-1744 -1744
-1731 -1731
1117 11...

output:

170735086.16425891486869659275

result:

ok found '170735086.1642589', expected '170735086.1642589', error '0.0000000'

Test #48:

score: 0
Accepted
time: 1786ms
memory: 4504kb

input:

-10000 -10000 10000 10000
2000
-4431 -4431
-790 -790
-7329 -7329
6810 6810
-489 -489
-6874 -6874
2089 2089
4399 4399
4905 4905
4808 4808
-4367 -4367
-675 -675
6348 6348
4880 4880
-4601 -4601
5023 5023
-4750 -4750
2922 2922
-3394 -3394
-4671 -4671
3330 3330
-6127 -6127
-6296 -6296
-6393 -6393
-5535 -...

output:

840638278.50862759986193850636

result:

ok found '840638278.5086277', expected '840638278.5086277', error '0.0000000'

Test #49:

score: 0
Accepted
time: 1784ms
memory: 4232kb

input:

-10000 -10000 10000 10000
2000
-10000 10000
10000 -10000
498 498
-644 -644
-1202 -1202
617 617
524 524
1312 1312
1070 1070
-816 -816
756 756
-1934 -1934
1228 1228
-1336 -1336
-1066 -1066
705 705
-1446 -1446
1113 1113
-1038 -1038
-638 -638
1730 1730
282 282
1876 1876
-1613 -1613
158 158
162 162
1195 ...

output:

1156500882.99146254092920571566

result:

ok found '1156500882.9914625', expected '1156500882.9914625', error '0.0000000'

Test #50:

score: 0
Accepted
time: 1809ms
memory: 4284kb

input:

-10000 -10000 10000 10000
2000
-10000 10000
10000 -10000
2590 2590
2306 2306
3693 3693
1106 1106
483 483
936 936
34 34
820 820
3274 3274
-2947 -2947
-2526 -2526
-2646 -2646
2223 2223
1411 1411
-2181 -2181
-1664 -1664
-1221 -1221
-2188 -2188
1581 1581
-3881 -3881
2733 2733
1613 1613
973 973
3437 3437...

output:

1185552635.41578829009085893631

result:

ok found '1185552635.4157882', expected '1185552635.4157882', error '0.0000000'

Test #51:

score: 0
Accepted
time: 2129ms
memory: 4292kb

input:

-10000 -10000 10000 10000
2000
0 0
-8050 -5931
-6443 7646
-4197 -9076
-6478 -7617
-4838 -8751
552 -9984
-7429 6693
-1481 9889
-5775 -8163
203 -9997
9728 2314
-2339 -9722
-9615 2745
3530 9355
9951 987
3465 -9380
3565 9342
2032 9791
4728 8811
3982 -9172
-9375 -3478
71 9999
-9420 -3354
9588 -2838
9458 ...

output:

982102595.49437079549534246325

result:

ok found '982102595.4943708', expected '982102595.4943708', error '0.0000000'

Test #52:

score: 0
Accepted
time: 0ms
memory: 4116kb

input:

9999 9999 10000 10000
2
-10000 10000
10000 -10000

output:

41887.88977551823358069782

result:

ok found '41887.8897755', expected '41887.9020479', error '0.0000003'

Extra Test:

score: 0
Extra Test Passed