QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#795040#9808. Fragile Pinballucup-team087#AC ✓15ms4028kbC++2326.3kb2024-11-30 17:35:162024-11-30 17:35:16

Judging History

This is the latest submission verdict.

  • [2024-11-30 17:35:16]
  • Judged
  • Verdict: AC
  • Time: 15ms
  • Memory: 4028kb
  • [2024-11-30 17:35:16]
  • Submitted

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

bool dbg=false;

#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>;
using vvi=vc<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));
}

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);
}
string rand_string(int n,char lw,char up){
	string s(n,'?');
	rep(i,n)s[i]=rand_int(lw,up);
	return s;
}

int current_run_id,run_batch_size=1000;
int calc_random_limit(){
	return current_run_id/run_batch_size+1;
}
template<class t>
void generate_single(t&a){
	a=rand_int(1,calc_random_limit());
}
void generate_single(string&a){
	int n;generate_single(n);
	a=rand_string(n,'a','b');
}
template<class t,class u>
void generate_single(pair<t,u>&a){
	generate_single(a.a);
	generate_single(a.b);
}
//https://trap.jp/post/1224/
template<class... Args>
void input(Args&... a){
	if(dbg){
		(generate_single(a),...);
	}else{
		#ifdef USE_FAST_IO
		sc.read(a...);
		#else
		(cin >> ... >> a);
		#endif
	}
}
#define INT(...) int __VA_ARGS__;input(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;input(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__;input(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;input(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;input(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;input(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;input(__VA_ARGS__)
#define overload3(a,b,c,d,...) d
#define VI2(name,size) vi name(size);rep(i_##name,size)input(name[i_##name]);
#define VI3(name,size,offset) vi name(size);rep(i_##name,size)input(name[i_##name]),name[i_##name]+=offset;
#define VI(...) overload3(__VA_ARGS__,VI3,VI2)(__VA_ARGS__)
#define VPI(name,size) vc<pi> name(size);rep(i_##name,size)input(name[i_##name]);
#define VVI(name,sizeN,sizeM) vvi name(sizeN,vi(sizeM));\
rep(i_##name,sizeN)rep(j_##name,sizeM)input(name[i_##name][j_##name]);
#define VS(name,size) vc<string> name(size);rep(i_##name,size)input(name[i_##name]);
#define VMI(name,size) vc<mint> name(size);rep(i_##name,size){INT(tmp_##name);name[i_##name]=tmp_##name;};

#define overload5(a,b,c,d,e,f,...) f
#define VVC4(type,name,sizeN,sizeM) vvc<type> name(sizeN,vc<type>(sizeM));
#define VVC5(type,name,sizeN,sizeM,ini) vvc<type> name(sizeN,vc<type>(sizeM,ini));
#define VVC(...) overload5(__VA_ARGS__,VVC5,VVC4)(__VA_ARGS__)

template<class T>
T vvvc(T v){
	return v;
}

template<class T,class...Args>
auto vvvc(int n,T v,Args...args){
	return vector(n,vvvc(v,args...));
}

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<<"}";
}

void printsuc(int suc){
	#ifdef USE_FAST_IO
		if(suc==1)pr.write('\n');
		if(suc==2)pr.write(' ');
	#else
		if(suc==1){
			if(dbg)cout<<endl;
			else{
				#ifdef LOCAL
				cout<<endl;
				#else
				cout<<"\n";
				#endif
			}
		}
		if(suc==2)
			cout<<" ";
	#endif
}

template<class t>
void print_single(t x,int suc=1){
	#ifdef USE_FAST_IO
	pr.write(x);
	#else
	cout<<x;
	#endif
	printsuc(suc);
}

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?3:2);
	printsuc(suc);
}

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?3:2);
	printsuc(suc);
}

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...);
}

template<class T>
void printvv(const vvc<T>&vs){
	for(const auto&row:vs)print(row);
}

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 S> void mkuni(S&v){
	sort(all(v));
	v.erase(unique(all(v)),v.ed);
}

template<class t> bool isuni(vc<t> v){
	int s=si(v);
	mkuni(v);
	return si(v)==s;
}

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

template<class S,class u>
int lwb(const S&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);
}

//VERIFY: yosupo
//KUPC2017J
//AOJDSL1A
//without rank
struct unionfind{
	vi p,s;
	int c;
	unionfind(int n):p(n,-1),s(n,1),c(n){}
	void clear(){
		fill(all(p),-1);
		fill(all(s),1);
		c=si(p);
	}
	int find(int a){
		return p[a]==-1?a:(p[a]=find(p[a]));
	}
	//set b to a child of a
	bool unite(int a,int b){
		a=find(a);
		b=find(b);
		if(a==b)return false;
		p[b]=a;
		s[a]+=s[b];
		c--;
		return true;
	}
	bool same(int a,int b){
		return find(a)==find(b);
	}
	int sz(int a){
		return s[find(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> rand_tree(int n){
	vvc<int> t(n);
	unionfind uf(n);
	while(uf.c>1){
		int a=rand_int(n);
		int b=rand_int(n);
		if(uf.unite(a,b)){
			t[a].pb(b);
			t[b].pb(a);
		}
	}
	return t;
}

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

vi readRooted(int n){
	assert(!dbg);
	vi par(n,-1);
	rng(i,1,n){
		input(par[i]);
		par[i]--;
		assert(inc(0,par[i],i-1));
	}
	return par;
}

void printTree(const vvc<int> t){
	int n=si(t);
	int degsum=0;
	rep(i,n)degsum+=si(t[i]);
	if(degsum==n-1){
		//directed
		rep(i,si(t))for(auto j:t[i]){
			print(i+1,j+1);
		}
	}else if(degsum==2*(n-1)){
		//undirected
		rep(i,si(t))for(auto j:t[i])if(i<j){
			print(i+1,j+1);
		}
	}else{
		assert(false);
	}
}

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,size_t K,class s=t>
s SUM(const array<t,K>&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 A>
auto MIN(const A&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,class u,class v>
pair<t,u>&operator*=(pair<t,u>&a,v b){
	a.a*=b;a.b*=b;return a;}
template<class t,class u,class v>
pair<t,u> operator*(pair<t,u> a,v b){return a*=b;}
template<class t,class u>
pair<t,u> operator-(pair<t,u> a){return mp(-a.a,-a.b);}
namespace std{
template<class t,class u>
istream&operator>>(istream&is,pair<t,u>&a){
	return is>>a.a>>a.b;
}
}

template<class t,size_t n>
array<t,n>&operator+=(array<t,n>&a,const array<t,n>&b){
	rep(i,n)a[i]+=b[i];
	return a;
}
template<class t,size_t n,class v>
array<t,n>&operator*=(array<t,n>&a,v b){
	rep(i,n)a[i]*=b;
	return a;
}
template<class t,size_t n,class v>
array<t,n> operator*(array<t,n> a,v b){return a*=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>
vc<t>& operator+=(vc<t>&a,const vc<t>&b){
	a.resize(max(si(a),si(b)));
	rep(i,si(b))a[i]+=b[i];
	return a;
}

template<class t>
vc<t> operator+(const vc<t>&a,const vc<t>&b){
	vc<t> c(max(si(a),si(b)));
	rep(i,si(a))c[i]+=a[i];
	rep(i,si(b))c[i]+=b[i];
	return c;
}

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>
vc<t>& operator-=(vc<t>&a,const vc<t>&b){
	a.resize(max(si(a),si(b)));
	rep(i,si(b))a[i]-=b[i];
	return a;
}
/*
template<class t>
vc<t> operator-(const vc<t>&a,const vc<t>&b){
	vc<t> c(max(si(a),si(b)));
	rep(i,si(a))c[i]+=a[i];
	rep(i,si(b))c[i]-=b[i];
	return c;
}
*/
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>
vc<t>& operator<<=(vc<t>&a,int k){
	assert(k>=0);
	a.insert(a.bg,k,t(0));
	return a;
}
template<class t>
vc<t> operator<<(vc<t> a,int k){
	return a<<=k;
}

template<class t>
vc<t>& operator>>=(vc<t>&a,int k){
	if(si(a)<=k)a.clear();
	else a.erase(a.bg,a.bg+k);
	return a;
}
template<class t>
vc<t> operator>>(vc<t> a,int k){
	return a>>=k;
}

template<class t,class u>
void remval(vc<t>&a,const u&v){
	a.erase(remove(all(a),v),a.ed);
}
//消した要素の個数を返してくれる
//UCUP 2-8-F
template<class t,class F>
int remif(vc<t>&a,F f){
	auto itr=remove_if(all(a),f);
	int res=a.ed-itr;
	a.erase(itr,a.ed);
	return res;
}
template<class t>
void rempos(vc<t>&a,int i){
	assert(inc(0,i,si(a)-1));
	a.erase(a.bg+i);
}

template<class VS,class u>
void fila(VS&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);
}

//Multiuni2023-8 C
//f(lw)=false,...,f(n-1)=false,f(n)=true,...,f(up)=true,
//のときに n を返す
template<class F>
int find_min_true(int lw,int up,F f){
	while(up-lw>1){
		const int mid=(lw+up)/2;
		if(f(mid))up=mid;
		else lw=mid;
	}
	return up;
}
//f(lw)=true,f(up)=false
template<class F>
int find_max_true(int lw,int up,F f){
	while(up-lw>1){
		const int mid=(lw+up)/2;
		if(f(mid))lw=mid;
		else up=mid;
	}
	return lw;
}

template<class t> using pqmin=priority_queue<t,vc<t>,greater<t>>;
template<class t> using pqmax=priority_queue<t>;
using T=tuple<int,int,int>;

//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-9;
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();
}
ld rabs(const pt&a){
	return a.rabs();
}
#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)));
}
//UCUP 2-20-D
ld heron(ld a,ld b,ld c){
	ld s=(a+b+c)/2;
	return sqrt(s*(s-a)*(s-b)*(s-c));
}
#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;}
//c の位置を聞く関数です,b じゃないです
//(-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
//Multiuni 2024-6-C
pt rot(pt a,ld b){
	ld c=cos(b),s=sin(b);
	return pt(a.x*c-a.y*s,a.x*s+a.y*c);
}
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)));
}
//UCUP3-4-H
bool isp(ln a,pt b){
	return ccw(a,b)==0&&inc(-1,bet(a.a,a.b,b),1);
}
#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);
}*/

void slv(){
	INT(n);
	vc<pt> ps(n);
	rep(i,n)cin>>ps[i];
	ps.pb(ps[0]);
	
	vc<ld> ans(n+1,0);
	rep(i,n)rep(j,n)chmax(ans[0],abs(ps[i]-ps[j]));
	
	vc<ln> ls;
	auto dfs=[&](auto self,vc<pt> cur,vi avail)->void{
		int k=si(ls);
		if(k>=1){
			auto tryline=[&](ln z){
				for(auto w:ls){
					if(!(ccw(dir(z),dir(w))>0&&isl(w,z))){
						return;
					}
				}
				ld start=-inf,goal=inf;
				rep(i,n){
					ln q(ps[i],ps[i+1]);
					if(ccw(dir(z),dir(q))<0){
						chmax(start,cllt(z,q));
					}
				}
				rep(i,n){
					ln q(cur[i],cur[i+1]);
					if(ccw(dir(z),dir(q))>0){
						chmin(goal,cllt(z,q));
					}
				}
				assert(-inf<start);
				assert(goal<inf);
				
				chmax(ans[k],(goal-start)*abs(dir(z)));
			};
			
			vc<pt> buf;
			rep(i,n)buf.pb(ps[i]);
			rep(i,n)buf.pb(cur[i]);
			for(auto [a,b]:ls){
				buf.pb(a);
				buf.pb(b);
			}
			mkuni(buf);
			rep(i,si(buf))rep(j,si(buf))if(i!=j)
				tryline(ln(buf[i],buf[j]));
		}
		if(k<n){
			rep(u,n)if(avail[u]){
				ls.eb(cur[u],cur[u+1]);
				
				vc<pt> nx(n+1);
				rep(i,n+1)nx[i]=refl(ln(cur[u],cur[u+1]),cur[i]);
				auto nxav=avail;
				nxav[u]=0;
				
				rein(nx);
				rein(nxav);
				
				self(self,nx,nxav);
				
				ls.pop_back();
			}
		}
	};
	
	dfs(dfs,ps,vi(n,1));
	
	rep(k,n)chmax(ans[k+1],ans[k]);
	
	rep(k,n+1)print(ans[k]);
}

signed main(signed argc,char*argv[]){
	if(argc>1&&strcmp(argv[1],"D")==0)dbg=true;
	
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout<<fixed<<setprecision(20);
	
	if(dbg){
		while(1){
			if(current_run_id%run_batch_size==0){
				cerr<<"Current Run "<<current_run_id<<endl;
			}
			slv();
			current_run_id++;
		}
	}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: 1ms
memory: 3952kb

input:

3
4 0
0 3
0 -1

output:

5.00000000000000000000
8.00000000000000000000
8.86818503879756340688
12.21002481088195582709

result:

ok 4 numbers

Test #2:

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

input:

3
4 0
0 3
0 2

output:

5.00000000000000000000
5.36656314599949527165
6.11191913849942517053
6.78220330441662831635

result:

ok 4 numbers

Test #3:

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

input:

3
4 0
0 3
0 1

output:

5.00000000000000000000
6.18465843842649082469
7.19522354274454488095
8.65343949929425340292

result:

ok 4 numbers

Test #4:

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

input:

3
62 -12
-48 100
-45 -96

output:

196.02295783912658835857
312.04173783276056028391
326.27847771877617755187
452.80712372911078525406

result:

ok 4 numbers

Test #5:

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

input:

3
90 99
-76 -57
99 84

output:

227.79815626997510885632
274.35230645776344959863
306.89177947709210381166
330.10518554643359478984

result:

ok 4 numbers

Test #6:

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

input:

3
-67 22
-86 12
-81 -12

output:

36.76955262170047127046
39.56397500565403616696
50.91685591710600820164
72.27758551745063939076

result:

ok 4 numbers

Test #7:

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

input:

3
71 -48
-81 2
-83 -44

output:

160.01249951175689324734
308.05679456756879494583
308.05679456756879494583
308.05679456756879497359

result:

ok 4 numbers

Test #8:

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

input:

3
44 -44
-31 -77
8 -98

output:

81.93900170248597799455
115.79266829979315255039
125.60604402992012824936
167.93649349697933648162

result:

ok 4 numbers

Test #9:

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

input:

3
40 91
-42 90
-5 -99

output:

195.25624189766635985244
378.87426679199884815841
378.87426679199884818616
378.87426679199884818616

result:

ok 4 numbers

Test #10:

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

input:

4
-10 -97
13 -98
90 50
42 97

output:

200.84820138602187641896
269.68734146533457934902
382.16606804049615703223
476.59926283039679295594
476.59926283039679295594

result:

ok 5 numbers

Test #11:

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

input:

4
39 89
-72 -94
87 -58
90 36

output:

214.03270778084362684079
413.74414660992380254889
413.74414660992380254889
502.96571824848038179123
595.01821265490545814769

result:

ok 5 numbers

Test #12:

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

input:

4
-6 -90
33 -75
4 97
-36 -69

output:

187.26718879718358179431
269.54944439736868391777
309.20805779551497019519
364.70165807157006573891
395.37828755440608752281

result:

ok 5 numbers

Test #13:

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

input:

4
44 81
27 81
60 -57
83 3

output:

141.89080308462560815752
187.12271495993614235653
251.47668954805475106939
274.12765684348474590215
286.31951740573043171945

result:

ok 5 numbers

Test #14:

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

input:

4
96 -13
99 1
-67 -36
67 -37

output:

170.07351351694948740634
183.08542624904550162601
223.21210351724533334228
277.37918419740198935908
306.15039727040056322105

result:

ok 5 numbers

Test #15:

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

input:

4
-18 -98
80 -59
73 68
-78 -62

output:

199.25109786397664915492
378.32587882437449522399
378.32587882437449525175
512.61754381185761964002
557.38745761591020361214

result:

ok 5 numbers

Test #16:

score: 0
Accepted
time: 2ms
memory: 3904kb

input:

5
-90 41
-93 27
94 79
83 91
-44 94

output:

194.09533739891847282932
206.35552445442488621319
256.73130200089089889004
337.34690346234038335616
377.92916040834781421509
396.66293866059842410099

result:

ok 6 numbers

Test #17:

score: 0
Accepted
time: 2ms
memory: 3884kb

input:

5
78 -95
96 29
-95 34
-76 -82
64 -95

output:

215.80083410404140512040
379.47435182666498088011
555.07478947948629094400
584.00752731615192042680
640.70943839428946253722
693.17249160291570059256

result:

ok 6 numbers

Test #18:

score: 0
Accepted
time: 2ms
memory: 3956kb

input:

5
45 -26
38 62
-31 57
-40 -43
-13 -91

output:

161.27616066858734593381
297.82777299176100588296
329.10353227991925442741
455.41981978587691620719
496.85877746031244675540
600.67211306306565543611

result:

ok 6 numbers

Test #19:

score: 0
Accepted
time: 2ms
memory: 3956kb

input:

5
-28 78
-63 63
-85 30
-7 -80
61 -77

output:

187.01871564097535530213
342.37197369557829720876
437.28308400341415088097
525.97827796878509770684
704.06445364155765137548
704.06445364155765137548

result:

ok 6 numbers

Test #20:

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

input:

5
-20 91
-21 90
4 -99
18 -92
41 57

output:

191.50979087242511006428
232.38552509711017322880
282.23607929919301484656
389.30670118925803085963
404.07519594642908808413
477.05123579751370058166

result:

ok 6 numbers

Test #21:

score: 0
Accepted
time: 2ms
memory: 3944kb

input:

5
40 -91
65 75
-50 -86
-48 -87
27 -96

output:

197.85348114198041574729
296.42293335198155734833
328.65368766710295059252
385.63003625652226644127
404.17601704445533511434
404.17601704445533511434

result:

ok 6 numbers

Test #22:

score: 0
Accepted
time: 15ms
memory: 3888kb

input:

6
86 57
51 69
2 -52
18 -100
89 -84
87 33

output:

172.19175357722564292939
341.13513513513513511488
400.66607474663487778455
501.26818807479661713189
565.60898515526201696391
622.69084436170576102310
665.70057157328478752989

result:

ok 7 numbers

Test #23:

score: 0
Accepted
time: 15ms
memory: 3936kb

input:

6
99 49
88 89
55 54
23 -38
18 -72
84 -63

output:

175.55910685578233483561
264.07902400267297912673
313.65623365289027912883
390.45459225869388830699
470.75201230253577489027
521.83092340092202288115
550.76882722073886455849

result:

ok 7 numbers

Test #24:

score: 0
Accepted
time: 15ms
memory: 3968kb

input:

6
53 36
-5 100
-56 98
-79 14
-84 -24
73 -27

output:

179.62739212046697194480
314.86278603176689608323
385.34365845359471533516
493.19363041475945041991
606.18147380927169765030
673.30881876648054878975
673.30881876648054878975

result:

ok 7 numbers

Test #25:

score: 0
Accepted
time: 11ms
memory: 3936kb

input:

6
76 84
32 100
77 -80
91 -17
95 37
86 79

output:

185.53975315279472474428
211.90732794510266048804
264.71675522700907071116
315.06240090096084577320
324.87460529965523897689
356.52632735188481655220
356.52632735188481677424

result:

ok 7 numbers

Test #26:

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

input:

6
-35 12
-31 -22
-6 -81
96 -21
69 64
-29 65

output:

163.24827717314507696811
291.51543586797808024769
399.01016364381378703774
496.20629102897916898329
585.32379073847125028340
681.21588357186748730054
681.21588357186748730054

result:

ok 7 numbers

Test #27:

score: 0
Accepted
time: 15ms
memory: 3908kb

input:

6
89 -75
97 1
8 95
-21 87
-23 -98
75 -87

output:

198.72594194015033024214
382.90272141851452342154
570.26730882234772113115
699.34414537321066152042
793.02704231952128949290
950.40118884633639062542
950.40118884633639062542

result:

ok 7 numbers

Test #28:

score: 0
Accepted
time: 15ms
memory: 3972kb

input:

6
-69 88
-100 50
-100 -50
28 -25
70 26
65 90

output:

216.39085008382401564830
349.42495719529176265161
517.36484553593514956749
604.95069939947188875085
740.92680576634774197720
867.57376153472937319044
994.17606371163678152802

result:

ok 7 numbers

Test #29:

score: 0
Accepted
time: 11ms
memory: 3932kb

input:

6
55 99
-32 6
-38 -60
89 -99
97 -98
81 73

output:

201.42740627829173336028
379.48141552389291877856
457.67257638981542264278
590.72607787010561003482
652.19152737941394570864
771.74089929046734198659
888.95129157258038044009

result:

ok 7 numbers

Test #30:

score: 0
Accepted
time: 15ms
memory: 3948kb

input:

6
-64 25
-59 -69
23 -94
73 -88
98 20
92 89

output:

218.55205329623421316165
371.49682436832620413547
490.99591610772436289789
639.68307289248663621839
746.65593329061471539188
869.84255490585634690293
875.95129628514010228235

result:

ok 7 numbers

Test #31:

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

input:

6
-62 -66
78 -48
99 89
73 94
-91 73
-89 -60

output:

239.88538930080756379770
382.62158474822524911740
560.83041053587744778630
628.05618030547877400638
749.57104961614808491532
842.64833099575541713877
933.08433376149133331445

result:

ok 7 numbers

Test #32:

score: 0
Accepted
time: 15ms
memory: 3936kb

input:

6
91 49
68 88
-51 98
-95 35
-21 -72
92 -31

output:

198.30532015051941112371
382.20291545976479524738
500.53906626041821892326
668.39033386651706886150
835.27797034126095637729
965.78701637594614792803
1130.00606032062831585172

result:

ok 7 numbers

Test #33:

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

input:

6
-49 -75
88 10
76 64
-97 46
-75 -62
-72 -67

output:

197.64867821465439792772
371.89821857390740003635
549.69170043994317964575
696.68296671766693872740
739.76424812933601982134
784.40304413306756053936
784.40304413306756053936

result:

ok 7 numbers

Test #34:

score: 0
Accepted
time: 15ms
memory: 3948kb

input:

6
-100 90
-25 -88
85 -85
97 31
83 99
22 100

output:

254.65663156493686725135
407.46069445304241118944
579.31464270957558027053
748.45097805845063804187
833.00017377352724262662
949.74707475619775715048
1042.02941698973380846294

result:

ok 7 numbers

Test #35:

score: 0
Accepted
time: 15ms
memory: 3868kb

input:

6
-61 98
-93 70
-98 34
-74 -94
94 -87
95 36

output:

244.16797496805349881877
482.58980548078541114587
586.62872003064944209649
765.08107055108893862494
925.80044816806836072143
1083.66306198939390736946
1146.06350647541256804196

result:

ok 7 numbers

Test #36:

score: 0
Accepted
time: 15ms
memory: 3944kb

input:

6
-86 -4
-39 -8
-6 -9
39 -6
25 8
-64 7

output:

125.01599897613105102923
127.42780799710371940348
142.20349267536698692482
158.03549038881807145551
158.03549038881807145551
158.17140160488180060383
168.58466237611873102253

result:

ok 7 numbers

Test #37:

score: 0
Accepted
time: 2ms
memory: 3972kb

input:

5
69 -12
69 13
-24 17
-93 -2
-55 -14

output:

162.69296235547498322149
324.00000000000000000000
324.00000000000000000000
329.03886565054470322855
329.03886565054470325631
331.99918919629000035876

result:

ok 6 numbers

Test #38:

score: 0
Accepted
time: 2ms
memory: 3960kb

input:

5
26 46
-20 38
-23 22
-16 -75
24 -30

output:

128.08200498118383219015
203.82145214711231559490
251.13381317712884054083
288.82308757647545924274
341.56319171089158151511
389.09067175248647285635

result:

ok 6 numbers

Test #39:

score: 0
Accepted
time: 15ms
memory: 3968kb

input:

6
-58 -21
-46 -25
7 -25
45 -21
47 25
-82 17

output:

132.56319247815360304332
257.06149326718445127793
282.81532916178454020728
340.92410871119825685471
415.73446708773371752188
415.73446708773371752188
415.73446708773371752188

result:

ok 7 numbers

Test #40:

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

input:

6
19 -61
36 -24
17 76
0 93
-31 52
-3 -93

output:

186.02419197512994439303
203.19556132648073230873
354.19590738062613177739
369.55548580691630886075
396.63530366684395989108
500.34913568233825251208
500.34913568233825251208

result:

ok 7 numbers

Test #41:

score: 0
Accepted
time: 15ms
memory: 4024kb

input:

6
33 -70
44 32
-31 68
-35 25
-31 -50
8 -63

output:

152.11837495845135408146
228.85497591269454414897
330.28234664101104961498
431.92559694799742392446
439.74171457787950048623
527.33313842353863803991
546.34142181922455244747

result:

ok 7 numbers

Test #42:

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

input:

6
10 94
-35 45
-23 -79
31 -51
37 -40
36 20

output:

176.11927776367923773049
244.08226416013451154363
326.06536313796014270316
427.77682537981099669677
478.04805553232048351275
550.23257721289616323235
559.58124772887054282355

result:

ok 7 numbers

Test #43:

score: 0
Accepted
time: 15ms
memory: 3940kb

input:

6
63 -31
42 46
-79 -26
-67 -31
-10 -52
8 -52

output:

142.08800090085017449326
271.36175117359483902058
284.29108617063411332260
342.05661844641372046349
427.94208821920564012053
428.73991826475462763035
428.73991826475462763035

result:

ok 7 numbers

Test #44:

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

input:

6
4 58
-5 -64
88 -16
93 1
67 41
16 59

output:

127.31457104353766780769
245.95406700626659270148
306.91543054279675509233
382.59505786438484228884
469.27864120836854847085
473.92699144409229991548
473.92699144409229991548

result:

ok 7 numbers

Test #45:

score: 0
Accepted
time: 15ms
memory: 3956kb

input:

6
-30 -90
7 -96
47 -35
56 -12
43 68
33 80

output:

181.29809706668186648770
355.78482841194040861565
357.57124139622770445102
373.86881575798423540946
502.97215076427592295172
502.97215076427592295172
502.97215076427592295172

result:

ok 7 numbers

Test #46:

score: 0
Accepted
time: 15ms
memory: 3908kb

input:

6
-34 72
-47 -49
-43 -51
23 -73
95 -13
44 69

output:

155.80115532305914194389
295.76519264498969916111
422.42505248040436047208
529.52901061902953622207
660.52823839441195652444
761.68657230010433806244
886.23223909367760459110

result:

ok 7 numbers

Test #47:

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

input:

6
87 16
60 72
-64 -64
-3 -99
30 -94
48 -82

output:

184.04347312523745132384
359.34578647590436373260
406.69751110683088482500
521.11556103351381374900
629.68361659832791349389
629.68361659832791349389
629.68361659832791349389

result:

ok 7 numbers

Test #48:

score: 0
Accepted
time: 15ms
memory: 3884kb

input:

6
82 10
30 91
-49 73
-41 -85
57 -77
80 -22

output:

189.78145325610719434950
339.86343119840920354302
507.00469772637349799571
598.80421911838102322356
691.79274825131546500234
736.13516251037650767186
745.79227361502668547377

result:

ok 7 numbers

Test #49:

score: 0
Accepted
time: 15ms
memory: 3944kb

input:

6
10 -88
92 -12
94 -3
70 69
-94 -20
-22 -87

output:

188.76705220985997057959
367.45666411156567837670
489.91182966693761113852
545.44721844766726387421
667.49058045939747230157
669.72452118728421804894
679.24267828931664897629

result:

ok 7 numbers

Test #50:

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

input:

6
-5 82
-9 14
3 -92
6 -73
9 5
-1 98

output:

190.04210059878837278668
190.62619134732301233448
191.09364376027895593424
191.09364376027895593424
191.09364376027895598975
191.09364376027895598975
191.09364376027895600363

result:

ok 7 numbers

Test #51:

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

input:

6
3 98
-19 16
-2 -99
7 -92
19 21
14 68

output:

197.06344156134084932841
200.89709278285654980856
214.55026035780283748255
235.20473301332320199830
235.20473301332320205381
251.75583236883966439801
251.75583236883966439801

result:

ok 7 numbers

Test #52:

score: 0
Accepted
time: 14ms
memory: 3888kb

input:

6
17 80
11 92
-22 66
-23 -63
-5 -98
27 41

output:

190.67249408344141130278
214.54331567578536464624
292.33394907432376047529
355.37846381360802436311
379.54951299739833164848
405.50143750194482003546
405.50143750194482003546

result:

ok 7 numbers

Test #53:

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

input:

6
28 25
-6 97
-29 14
-29 -14
3 -99
29 16

output:

196.20652384668558720904
206.10848434034240583834
215.86581128659219047661
264.43867193510954485824
318.85242869251398184494
379.04423576814652752098
420.57993506277793191450

result:

ok 7 numbers

Test #54:

score: 0
Accepted
time: 14ms
memory: 3952kb

input:

6
4 99
-26 75
-15 -92
31 -60
31 61
12 95

output:

191.94269978303420748356
241.17473569995248616760
385.76372041633576545627
417.32318729584754940509
481.02295118960910288997
551.68588091514537463667
551.68588091514537463667

result:

ok 7 numbers

Test #55:

score: 0
Accepted
time: 15ms
memory: 3956kb

input:

6
-11 -97
47 -28
39 60
-49 11
-49 -16
-19 -91

output:

164.76953601925326778344
223.81877597671902281606
314.97700818464149202791
425.35152516805554426260
459.18655066109713044908
555.28904441136877179197
555.28904441136877179197

result:

ok 7 numbers

Test #56:

score: 0
Accepted
time: 11ms
memory: 3952kb

input:

6
18 93
-6 99
-14 -95
-5 -99
33 -74
49 0

output:

198.00252523642217426791
285.15535079127669448873
416.66168330423005022878
490.47334737216109018521
615.65678987359126822509
653.34472469435245756131
653.34472469435245756131

result:

ok 7 numbers

Test #57:

score: 0
Accepted
time: 15ms
memory: 3884kb

input:

6
-24 58
-52 51
-79 -36
-53 -50
91 -24
96 -16

output:

176.13914953808537110225
322.41647928903488265484
409.00363213345412163879
517.48572154287438856768
626.30104075384648537606
651.42056975171131988356
697.64586546399571642674

result:

ok 7 numbers

Test #58:

score: 0
Accepted
time: 15ms
memory: 3968kb

input:

6
11 69
-25 67
-91 -28
-4 -69
99 6
59 56

output:

193.01813386311660225569
318.00720672525946711162
446.78721683064032255128
583.43702570086806385996
669.45035932844455750512
787.32121872036793258642
801.95509926526933192070

result:

ok 7 numbers

Test #59:

score: 0
Accepted
time: 11ms
memory: 3940kb

input:

6
-52 59
-62 54
-99 6
-91 -28
-18 -68
68 50

output:

177.10166571774529754857
335.05305383895870802169
390.14740306734924463195
483.12266494859421880892
629.10148159309582216459
651.34028775004968309092
651.34028775004968309092

result:

ok 7 numbers

Test #60:

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

input:

6
8 -79
72 -55
94 -27
-55 66
-77 -50
-44 -71

output:

175.64168070250295802803
349.23767362841600028767
388.54452217524461030140
504.04070443060848946693
661.86182303433724249953
661.86182303433724249953
661.86182303433724249953

result:

ok 7 numbers

Test #61:

score: 0
Accepted
time: 11ms
memory: 3932kb

input:

6
-14 98
-38 -90
-36 -91
-33 -92
89 -5
73 57

output:

190.94763680129691513221
371.88512081001491982324
546.27172673921839007871
726.77331089657084400857
726.77331089657084400857
810.81025677886703595387
821.83769631311270770224

result:

ok 7 numbers

Test #62:

score: 0
Accepted
time: 15ms
memory: 4016kb

input:

6
-85 32
-75 -54
22 -96
47 -85
87 -22
89 -5

output:

180.27756377319946465287
348.29808720509396458009
513.86635118034625530070
525.73465093794680674799
698.98165437548789941102
698.98165437548789941102
698.98165437548789941102

result:

ok 7 numbers

Test #63:

score: 0
Accepted
time: 15ms
memory: 3888kb

input:

6
94 -32
99 7
63 77
-94 33
-46 -88
68 -72

output:

198.91958174096385325580
388.11330316461616452006
531.42459893240259971581
694.41950471243587711401
777.10452936087323888570
902.64997506052067005600
953.13575935732203642248

result:

ok 7 numbers

Extra Test:

score: 0
Extra Test Passed