QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#870638#8620. Jigsaw Puzzleucup-team087#AC ✓5ms4224kbC++2326.0kb2025-01-25 17:09:252025-01-25 17:09:26

Judging History

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

  • [2025-01-25 17:09:26]
  • 评测
  • 测评结果:AC
  • 用时:5ms
  • 内存:4224kb
  • [2025-01-25 17:09:25]
  • 提交

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].a,name[i_##name].b);
#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>
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>
array<t,n> operator+(array<t,n> a,const array<t,n>&b){return a+=b;}
template<class t,size_t n>
array<t,n> operator-(array<t,n> a,const array<t,n>&b){return a-=b;}
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>;

namespace std{
__float128 abs(__float128 x){
	return x<0?-x:x;
}
__float128 sin(__float128 x){
	return sinl(x);
}
__float128 cos(__float128 x){
	return cosl(x);
}
__float128 acos(__float128 x){
	return acosl(x);
}
__float128 atan2(__float128 y,__float128 x){
	return atan2l(y,x);
}
__float128 sqrt(__float128 x){
	return sqrtl(x);
}
__float128 fmod(__float128 x,__float128 y){
	return fmodl(x,y);
}
ostream&operator<<(ostream&os,__float128 v){
	return os<<(long double)v;
}
istream&operator>>(istream&is,__float128&v){
	long double z;
	is>>z;
	v=z;
	return is;
}
}

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

//USACO 2022 January ptlatinum C

#define GEOF

#ifdef GEOF
//using ld=long double;
using ld=__float128;
//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); }
	
	pt conj()const{ return pt(x,-y);}
    ld norm() const { return x * x + y * y; }
    ld rabs() const { return max(std::abs(x), std::abs(y)); }  // robust abs
    ld srabs() const{ return std::abs(x)>std::abs(y)?x:y; } // signed 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();
}
ld srabs(const pt&a){
	return a.srabs();
}
#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;
}

template<class... Args>void inputpt(Args&... a){(input(a.x,a.y),...);}
#define PT(...) ld __VA_ARGS__;inputpt(__VA_ARGS__)
#define VPT(name,size) vc<pt> name(size);rep(i_##name,size)inputpt(name[i_##name]);

using affine=pair<pt,pt>;
pt applied(const pt&v,const affine&a){
	return v*a.a+a.b;
}
void applya(pt&v,const affine&a){
	v=applied(v,a);
}
affine get_affine(pair<pt,pt> from,pair<pt,pt> to){
	pt a=from.b-from.a;
	pt b=to.b-to.a;
	pt r=b*a.conj()/a.norm();
	pt off=to.a-from.a*r;
	affine res(r,off);
	assert(applied(from.a,res)==to.a);
	assert(applied(from.b,res)==to.b);
	return res;
}
ld clamp(ld v){
	return max<ld>(0,min<ld>(v,1));
}

void slv(){
	INT(n);
	vvc<pt> ps(n);
	unionfind uf(n);
	vc<bool> corner(n);
	rep(i,n){
		INT(m);
		VPT(ls,m);
		ps[i]=ls;
	}
	/*{
		bool found=false;
		rep(i,n){
			rep(j,si(ps[i])){
				pt &a=ps[i][j],&b=ps[i][(j+1)%si(ps[i])],&c=ps[i][(j+2)%si(ps[i])];
				if(ccw(a,b,c)>0&&sgn(dot(b-a,c-b))==0){
					dmp2(a,b,c);
					ld d=abs(c-b);
					affine z=get_affine(mp(b,c),mp(pt(),pt(d,0)));
					for(auto&v:ps[i])
						applya(v,z);
					dmp2(a,b,c);
					found=true;
					corner[i]=true;
					goto done;
				}
			}
		}
		done:;
		assert(found);
	}
	dmp(ps);*/
	//map<ld,vc<pi>> qs;
	vc<tuple<ld,int,int>> qs;
	rep(i,n)rep(j,si(ps[i])){
		pt a=ps[i][j],b=ps[i][(j+1)%si(ps[i])];
		//qs[abs(b-a)].eb(i,j);
		qs.eb(abs(b-a),i,j);
	}
	soin(qs);
	//for(auto [key,val]:qs){
	//	assert(si(val)<=2);
	//	if(si(val)==2){
	rep(step,si(qs)-1){
		auto [d0,i,j]=qs[step];
		auto [d1,u,v]=qs[step+1];
		if(sgn(d0,1)!=0&&sgn(d0,d1)==0){
			if(!uf.same(i,u)){
				if(corner[uf.find(u)]){
					swap(i,u);
					swap(j,v);
				}
				{
					pt a=ps[i][j],b=ps[i][(j+1)%si(ps[i])];
					pt d=ps[u][v],c=ps[u][(v+1)%si(ps[u])];
					affine z=get_affine(mp(c,d),mp(a,b));
					rep(k,n)if(uf.same(k,u)){
						for(auto&p:ps[k])applya(p,z);
					}
				}
				uf.unite(i,u);
			}
		}
	}
	assert(uf.c==1);
	{
		pt X=pt::polar(1,rand_int(0,10000));
		pt Y=rot90(X);
		ld xval=-inf,yval=-inf;
		pt xbest,ybest;
		rep(i,n)for(auto v:ps[i]){
			if(chmax(xval,dot(X,v)))xbest=v;
			if(chmax(yval,dot(Y,v)))ybest=v;
		}
		affine z=get_affine(mp(xbest,ybest),mp(pt(),pt(1,0)));
		rep(i,n)for(auto&v:ps[i])applya(v,z);
	}
	rep(i,n){
		for(auto v:ps[i])print(clamp(v.x),clamp(v.y));
	}
}

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: 0ms
memory: 3840kb

input:

4
4
0.440405375916 0.778474079786
0.000000000000 0.090337001520
0.469097990019 0.000000000000
0.702887505082 0.689470121906
4
0.222810526978 0.000000000000
0.270828246634 0.522212063829
0.000000000000 0.547114887265
0.021480010612 0.069880870008
4
0.000000000000 0.312825941471
0.358219176380 0.00000...

output:

0.99999999999892015388 0.27716163632397083807
0.20688335548383064288 0.47326243135793782970
0.27197075171790789836 0.00000000000000000000
1.00000000000000000000 0.00000000000000000000
0.00000000000044521081 0.52441504651351835992
0.00000000000000000000 0.00000000000000000000
0.27197075171790789836 0...

result:

ok OK

Test #2:

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

input:

2
4
1.187724454426 0.260257896229
0.903481480651 1.219010174901
0.000000000000 0.951153431795
0.309873903757 0.000000000000
4
0.516015116935 0.888042716318
0.000000000000 0.031046166652
0.048574738349 0.000000000000
0.587115596943 0.842599396881

output:

0.00000000000000000000 0.00000000000000000000
1.00000000000000000000 0.00000000000000000000
1.00000000000000000000 0.94235132551898103813
0.00000000000024320983 0.91561769416065552114
0.00000000000024320983 0.91561769416065552114
1.00000000000000000000 0.94235132551898103813
1.00000000000000000000 1...

result:

ok OK

Test #3:

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

input:

2
4
0.010984487654 0.637154242202
0.000000000000 0.364429379044
0.986132728982 0.000000000000
1.010174362438 0.596910060881
4
1.051085498217 0.708750184397
0.000000000000 0.686709156365
0.238826458657 0.000000000000
1.183335588457 0.328485165151

output:

1.00000000000000000000 0.00000000000000000000
0.99999999999989118925 0.27294598358190124118
0.00000000000007935223 0.59739402484441738649
0.00000000000000000000 0.00000000000000000000
0.00000000000007935223 0.59739402484441738649
0.99999999999989118925 0.27294598358190124118
0.99999999999928266051 1...

result:

ok OK

Test #4:

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

input:

2
4
0.826904615568 0.393527743434
0.397181437913 1.296488423966
0.078224855062 1.144695506210
0.000000000000 0.000000000000
4
1.022875732881 0.126407334306
0.000000000000 0.646188215994
0.027327732878 0.000000000000
1.026434680216 0.042252902634

output:

0.00000000000000000000 0.00000000000000000000
1.00000000000000000000 0.00000000000000000000
0.99999999999981633306 0.35323418807467711427
0.00000000000008020811 0.91577034681153082790
0.00000000000008020811 0.91577034681153082790
0.99999999999981633306 0.35323418807467711427
1.00000000000000000000 0...

result:

ok OK

Test #5:

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

input:

2
4
0.341358383182 1.391325004482
0.000000000000 0.397880525310
0.531982366752 0.000000000000
1.130916074772 0.800798609763
4
1.051975365355 0.325235570274
0.003475133323 0.261167306728
0.000000000000 0.247567137365
0.968870740861 0.000000000000

output:

0.98596286502469695384 0.00000000000035708413
0.66431479808564949474 0.99999999999993104805
0.00000000000002170502 0.99999999999993467785
0.00000000000000000000 0.00000000000000000000
0.66431479808564949474 0.99999999999993104805
0.98596286502469695384 0.00000000000035708413
1.00000000000000000000 0...

result:

ok OK

Test #6:

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

input:

2
4
0.082220615826 0.000000000000
0.226158368535 0.989676141653
0.157074587283 1.000663841224
0.000000000000 0.013077098690
4
0.796463091415 0.000000000000
1.301438005407 0.863236513506
0.516366280506 1.336613199533
0.000000000000 0.480245367141

output:

0.00000000000029131335 0.91674592996831064969
1.00000000000000000000 0.93004788513671396286
0.99999999999972602536 1.00000000000000000000
0.00000000000032371433 1.00000000000000000000
1.00000000000000000000 0.93004788513671396286
0.00000000000029131335 0.91674592996831064969
0.00000000000000000000 0...

result:

ok OK

Test #7:

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

input:

2
4
0.919168715346 1.052156329422
0.000000000000 0.740689700679
0.930075742206 0.000000000000
1.240100800584 0.105054119170
4
1.147942957461 0.000000000000
1.169807209495 0.019794683310
0.498656378683 0.761115506098
0.000000000000 0.309659628218

output:

0.00000000000000000000 0.00000000000000000000
0.97050635654333464240 0.00000000000000000000
0.32734065555263249008 0.99999999999984434521
0.00000000000121828080 0.99999999999954335633
0.97050635654333464240 0.00000000000000000000
1.00000000000000000000 0.00000000000000000000
1.00000000000000000000 0...

result:

ok OK

Test #8:

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

input:

3
4
0.000000000000 0.136914050437
1.205473860654 0.000000000000
1.271801552152 0.076389603324
0.516716328492 0.732016253949
4
0.193356841190 1.008675084911
0.000000000000 0.998661755544
0.051717482677 0.000000000000
0.069051074671 0.000897651020
4
0.189612940043 1.009339071474
0.000000000000 0.01178...

output:

0.78812587621130477555 0.00000000000000000000
0.10116686293167246242 0.99999999999897047154
0.00000000000002235568 0.99999999999870505695
0.00000000000000000000 0.00000000000000000000
0.80638405334295401279 0.00000000000023888973
1.00000000000000000000 0.00000000000000000000
1.00000000000000000000 0...

result:

ok OK

Test #9:

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

input:

4
5
0.933026549197 0.034096050827
1.030580221284 0.341877704707
0.077317792660 0.644021283449
0.000000000000 0.400083791499
0.816713028753 0.000000000000
5
0.000000000000 0.567232254210
0.177744443744 0.000000000000
0.278219549927 0.015709015317
0.955605106642 0.861917658609
0.954247706440 0.8662495...

output:

0.32287190247090828866 0.99999999999991118823
0.00000000000346528358 1.00000000000000000000
0.00000000000000000000 0.00000000000000000000
0.25589752058350257751 0.00000000000000000000
0.39051777001144357657 0.89942459383723196906
1.00000000000000000000 0.99999999999778145396
0.40557126794392739930 0...

result:

ok OK

Test #10:

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

input:

4
4
0.578470606282 0.000000000000
1.060885700639 0.240610189702
0.817167310798 0.691089665380
0.000000000000 0.248985836080
4
0.000000000000 0.520597380570
0.022799149709 0.000000000000
0.882566155159 0.037652814638
0.461438543132 0.525442723877
4
0.057126159280 0.427841981239
0.000000000000 0.38584...

output:

0.50574809620449222850 0.53879133060612785890
0.48781798981826872205 0.00000000000000000000
1.00000000000000000000 0.00000000000000000000
0.99999999999925638454 0.92909537170222994380
0.52109637677042455934 0.99999999999952702011
0.00000000000000000000 0.99999999999905130667
0.00000000000000000000 0...

result:

ok OK

Test #11:

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

input:

3
3
0.823899373670 0.782629779690
0.288601744213 0.945945553033
0.000000000000 0.000000000000
5
0.919151534064 0.575061183684
0.169973459288 1.263242535288
0.000000000000 1.135836341471
0.145355826013 0.008808731413
0.151958544733 0.000000000000
4
1.000848179486 0.040130744019
0.991701546880 0.26786...

output:

0.00000000000000000000 0.55965667504731933844
0.00000000000000000000 0.00000000000000000000
0.98899138321122551462 0.00000000000063805132
1.00000000000000000000 0.95879113881010238408
0.00000000000000000000 0.77207916699524641827
0.00000000000000000000 0.55965667504731933844
0.98899138321122551462 0...

result:

ok OK

Test #12:

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

input:

3
4
0.784316497399 0.634251077946
0.006801703755 1.263115726074
0.000000000000 1.254706245103
0.271325510967 0.000000000000
4
0.176866080715 0.000000000000
1.325780121566 0.313426050448
1.266765536888 0.366283123599
0.000000000000 0.158412084360
4
0.637108390812 0.412967145896
0.087765752860 1.24856...

output:

1.00000000000000000000 0.00000000000000000000
1.00000000000000000000 1.00000000000000000000
0.98918415310208071447 0.99999999999991315080
0.18425850783715456598 0.00000000000159676718
0.75174784800368916039 1.00000000000000000000
0.10503356614068934067 0.00000000000086801841
0.18425850783715456598 0...

result:

ok OK

Test #13:

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

input:

6
4
0.921652078321 0.149600568920
0.078937119587 0.337059477836
0.000000000000 0.296726127108
0.743849912614 0.000000000000
4
1.023501554022 0.000000000000
0.951768850516 0.475614028074
0.000000000000 0.332067057777
0.284068099668 0.057351469275
4
0.049230909949 0.111307311191
0.213550746194 0.00000...

output:

0.00000000000279942183 0.19846996274190237309
0.68599219867212534314 0.72261121045904048109
0.70595071947802242809 0.80897963916276502655
0.00000000000397257192 0.43083592485854069123
0.51900698086877414185 0.00000000000015273138
1.00000000000000000000 0.00000000000000000000
0.99999999999934026070 0...

result:

ok OK

Test #14:

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

input:

5
4
0.000000000000 0.055459913902
0.998460914583 0.000000000000
1.018410323962 0.359155002823
0.013840567536 0.304635665324
4
0.500064513905 0.019086089913
0.674971706538 0.000000000000
0.813263023860 0.224894936058
0.000000000000 0.724982740923
4
0.731666528739 0.764701825648
0.735437510038 0.80982...

output:

0.99999999999855788762 0.99999999999728136414
0.00000000000145746437 0.99999999999768051810
0.00000000000140301413 0.64029137487643362776
0.99999999999844621008 0.75044015465737176900
0.15898980795296501144 0.33937122558706418196
0.00000000000059958747 0.26401178138692177818
0.00000000000000000000 0...

result:

ok OK

Test #15:

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

input:

5
3
0.000000000000 0.061747330599
0.247806449221 0.000000000000
0.229822253050 0.275345649819
5
0.538394745273 0.029328826979
0.968971368133 0.672420034382
0.916291764826 0.738725056183
0.000000000000 0.284470622299
0.226013039857 0.000000000000
4
0.014373491307 0.145007400418
1.026752147154 0.00000...

output:

1.00000000000000000000 0.57219607709359559004
1.00000000000000000000 0.82757964961068113704
0.73717200749504761202 0.74355522136714480579
0.73717200749504761202 0.74355522136714480579
0.00000000000007780151 0.50788604527872467323
0.00000000000043729075 0.42320135645830432510
0.99999999999980365185 0...

result:

ok OK

Test #16:

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

input:

7
5
0.810317691232 0.643017535788
0.309793761559 0.764262848182
0.000000000000 0.561376089933
0.651400345497 0.000000000000
0.931962307009 0.325553870105
4
0.171076044751 0.000000000000
0.265564197304 0.103411254234
0.071756689228 0.418964516278
0.000000000000 0.156314315443
4
0.386419063825 0.00000...

output:

0.70060550599941170421 0.59083771974031397065
0.24230142049085170327 0.35592923722283513179
0.14007818700698960474 0.00000000000060058596
1.00000000000000000000 0.00000000000000000000
1.00000000000000000000 0.42976777053146062905
0.00000000000000000000 0.00000000000000000000
0.14007818700698960474 0...

result:

ok OK

Test #17:

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

input:

7
4
0.000000000000 0.177488867232
0.176950314412 0.039266481958
0.556242974263 0.000000000000
0.075309305264 0.536013509980
4
0.203281319601 0.323314306022
0.000000000000 0.110510724304
0.349283252863 0.000000000000
0.408321765666 0.043218341300
5
0.860850463389 0.099669917919
0.433724726467 0.81261...

output:

0.28972790430798735651 0.70451282498744198117
0.51078144968204476699 0.74391043453664840103
0.79331093997458040039 0.99999999999218131805
0.07316673438056124468 0.99999999999628778679
0.00000000000490424237 0.65287562174919445870
0.28972790430798735651 0.70451282498744198117
0.07316673438104291300 0...

result:

ok OK

Test #18:

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

input:

6
4
0.880095449711 0.315891170135
0.784668799664 0.890843756640
0.000000000000 0.600905379684
0.728266831893 0.000000000000
4
0.083309474403 0.000000000000
0.291032832219 0.544543596864
0.066903447530 0.393219949838
0.000000000000 0.014725970157
4
0.007778511174 0.196667909856
0.000000000000 0.13427...

output:

0.42761207634876141287 0.19436792908937113549
0.99999999999787291324 0.08460096171294155897
0.99999999999509283678 0.92112315962204597349
0.18392577277198589886 0.44627296279510029486
0.99999999999999517649 0.08460096171082636674
0.42761207634876141287 0.19436792908937113549
0.61563849835508586966 0...

result:

ok OK

Test #19:

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

input:

9
4
0.062298941747 0.379982766518
0.000000000000 0.335827002916
0.238024873877 0.000000000000
0.368555159260 0.154177511533
4
0.271980593498 0.402027829795
0.000000000000 0.242759569523
0.006597351582 0.000000000000
0.412952594723 0.011043306806
4
0.713919783914 0.000000000000
0.775523766209 0.02973...

output:

0.00000000000030448568 0.07636026193034799169
0.00000000000000000000 0.00000000000000000000
0.41162557800954451719 0.00000000000000000000
0.36131889638942994047 0.19564789354546545464
0.60533007072544226348 0.27620696578086707674
0.75715080061307188407 0.00000000000000000000
1.00000000000000000000 0...

result:

ok OK

Test #20:

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

input:

12
4
0.011736358846 0.082356480218
0.408765987214 0.000000000000
0.506829492828 0.122146405389
0.000000000000 0.183574392246
3
0.518781549596 0.245694689851
0.000000000000 0.398529593227
0.074761480444 0.000000000000
4
0.075538054618 0.530132543078
0.000000000000 0.488866489116
0.155089097424 0.0109...

output:

0.63884202608553002653 0.65698148644887489287
0.99999999999445055487 0.84131822590750876301
0.99999999999404788593 0.99795856388661868195
0.56632343045355425611 0.72856263705154952569
0.99999999999311677798 0.30049218743974183543
0.99999999999445055487 0.84131822590750876301
0.63884202608553002653 0...

result:

ok OK

Test #21:

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

input:

14
4
0.238874723659 0.350932855333
0.056257209931 0.347991971885
0.000000000000 0.014112992049
0.083758710992 0.000000000000
3
0.000000000000 0.000000000000
0.074629721440 0.057264984008
0.050867075265 0.098486920063
5
0.000000000000 0.100859535910
0.152266736787 0.000000000000
0.585330206242 0.2675...

output:

0.17959046741309193484 0.37182794128898767741
0.00000000000000000000 0.33858536124232403445
0.00000000000000000000 0.00000000000000000000
0.08493937962891713748 0.00000000000191672791
0.49058872651733418136 0.90674452937305463027
0.47824810616669486917 1.00000000000000000000
0.43066752855951943621 1...

result:

ok OK

Test #22:

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

input:

25
4
0.000000000000 0.627504305794
0.147063422648 0.000000000000
0.282537740951 0.083274926848
0.087264778840 0.609639797093
3
0.040754587534 0.053855777929
0.019823186956 0.059913069526
0.000000000000 0.000000000000
4
0.000000000000 0.138379187270
0.054487787984 0.000000000000
0.282847594751 0.1139...

output:

0.62039659290968112912 0.00000000002527657587
0.35047097643406101489 0.58526016919669353984
0.23445056077887233517 0.47650692781502080285
0.53132200452057046978 0.00000000002365152753
0.13061739867292580771 0.64316903735766971949
0.14213980197301716681 0.62467448319103496232
0.19692636510059483171 0...

result:

ok OK

Test #23:

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

input:

31
4
0.335089288956 0.202130218860
0.111257412594 0.213056135994
0.000000000000 0.115005293141
0.101353839372 0.000000000000
5
0.368599476325 0.185829203903
0.028334455772 0.164205533565
0.000000000000 0.125424247883
0.009151606319 0.000000000000
0.420642774919 0.030024538656
4
0.014611117134 0.4683...

output:

0.69100081093510528436 0.15618926151171227905
0.85170239502523719890 0.00000000000000000000
1.00000000000000000000 0.00000000000000000000
0.99999999999957478605 0.15329324253157741510
0.37201795386580207691 0.15917884996742208398
0.03108151240789729625 0.16237419300185392643
0.00000000000104815675 0...

result:

ok OK

Test #24:

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

input:

38
6
0.055783185423 0.185264589599
0.000000000000 0.109085977012
0.008304609077 0.000000000000
0.192122870699 0.013993905045
0.330134360764 0.183894016971
0.331013036656 0.209310854427
6
0.313528615558 0.117272301270
0.460548489005 0.402591166057
0.450995573032 0.409647373622
0.000000000000 0.427107...

output:

0.18112598068294606825 0.93859509397568467259
0.10940163117799271467 0.99999999996418048376
0.00000000000000000000 0.99999999995846878224
0.00000000000000000000 0.81564983672778264425
0.15893353723721834796 0.66513953756460255344
0.18421034029683152979 0.66233402073964321363
0.70952101572350815661 0...

result:

ok OK

Test #25:

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

input:

42
3
0.023946458177 0.001644458456
0.052848741781 0.000000000000
0.000000000000 0.033937501244
4
0.000000000000 0.437888290711
0.220437603206 0.000000000000
0.252072649283 0.037291610744
0.214541156503 0.387891843578
5
0.056385180666 0.000000000000
0.307613101005 0.119085407065
0.324470389249 0.5126...

output:

0.04582414870014682531 0.32687873288258782617
0.07100159204111065458 0.34116658044266800817
0.00819454535119017290 0.34103099148078566265
0.32408969886104643657 0.00000000001444818927
0.81433340565637668930 0.00000000000923207889
0.79524900779009445042 0.04502472799609933070
0.46521501296121781766 0...

result:

ok OK

Test #26:

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

input:

47
4
0.000000000000 0.000000000000
0.240721682184 0.063972715782
0.212144051267 0.142587916515
0.194188982632 0.164356993645
3
0.000000000000 0.007329294278
0.004097455454 0.000000000000
0.012808348423 0.004742705864
4
0.000000000000 0.191434375054
0.194726601227 0.006150268983
0.209266332239 0.0000...

output:

0.00000000003700986768 0.99891787082401662485
0.00000000000747446213 0.74984070075834225410
0.08331784091644956042 0.75726822810612528201
0.10896821814147949309 0.76902983331631042508
0.83621478684231578013 0.99999999999765440477
0.82781790076467547254 0.99999999999875924874
0.82770692998860510880 0...

result:

ok OK

Test #27:

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

input:

66
5
0.000000000000 0.005053823688
0.010340563564 0.000000000000
0.068710101615 0.119429160119
0.065718142206 0.133817342462
0.045777209397 0.180721261022
5
0.319222361577 0.160705577488
0.145577264946 0.213639327175
0.045295283323 0.175775668292
0.000000000000 0.039061839645
0.232351393621 0.000000...

output:

0.00000000000049098074 0.01150949124414877085
0.00000000000000000000 0.00000000000000000000
0.13292978319461411039 0.00000000000000000000
0.14454290109281387537 0.00900594830550215573
0.17792708676815178490 0.04751717426027822540
0.00000000000219590806 0.01150949124798754325
0.17792708676815178490 0...

result:

ok OK

Test #28:

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

input:

65
3
0.000000000000 0.037227150695
0.041112144465 0.000000000000
0.053670737603 0.076203761999
4
0.225553825935 0.000000000000
0.223161633995 0.030611367046
0.001148070858 0.117279311869
0.000000000000 0.054401518608
3
0.131607859592 0.000000000000
0.015270081138 0.023579309412
0.000000000000 0.0133...

output:

0.82495260802378465642 0.99999999996688928970
0.76949028594782526878 0.99999999996393460221
0.81133019002022581216 0.93508348412200671814
0.91238352788523229562 0.31372309677426203471
0.91577250224335619361 0.34424019407236948362
0.71394297455921593745 0.47099269555219248410
0.70102747695143500741 0...

result:

ok OK

Test #29:

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

input:

87
3
0.000000000000 0.015182039322
0.008005468111 0.000000000000
0.008505409967 0.010237923361
3
0.006579715319 0.000000000000
0.016526460362 0.024920112337
0.000000000000 0.034862041390
4
0.000000000000 0.113613541825
0.016977010685 0.055116049444
0.095225367059 0.000000000000
0.088645927138 0.0572...

output:

0.57149388324230025705 0.57070854429313225791
0.55505007295122471859 0.56579092894140659849
0.56499793990448942896 0.56332010728049434318
0.59243961882171954796 0.48500193976656885881
0.57039381187307185161 0.50029677980040176808
0.55699079545196364957 0.48642865101084714543
0.43006216229957227801 0...

result:

ok OK

Test #30:

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

input:

81
3
0.000000000000 0.018267088323
0.021828432930 0.000000000000
0.065397626776 0.045720726608
6
0.015975080205 0.143941945631
0.000000000000 0.039492133537
0.018991882284 0.000000000000
0.265356466097 0.239413579318
0.222071970974 0.269301144149
0.186580330217 0.282053589632
6
0.013895601825 0.0000...

output:

0.11369231282255104055 0.00000000000898852279
0.14215574550510406228 0.00000000001115606631
0.14622632531571924078 0.06302451805313833885
0.50237879182387637782 0.75295901521036584601
0.55084717419672365839 0.84685141289624561196
0.54544942537770603615 0.89033916417762456243
0.23556997547280001896 0...

result:

ok OK

Test #31:

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

input:

95
5
0.047827693957 0.000000000000
0.098857399884 0.086786768459
0.102220020859 0.096330476080
0.001430528120 0.223787762853
0.000000000000 0.223443956666
3
0.041762757505 0.000000000000
0.019205931557 0.054198718204
0.000000000000 0.047533425298
4
0.013367507814 0.039249301738
0.185174533248 0.0000...

output:

0.40996549084078395052 0.22843395802564696568
0.34006820467820791956 0.15597470430595659250
0.33456849983882233838 0.14748101125667440173
0.40278311043307743114 0.00000000000000000000
0.40425437295059986285 0.00000000000000000000
0.79519356077573688074 0.74471693612309860648
0.77780179514953465432 0...

result:

ok OK

Test #32:

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

input:

116
5
0.021396819174 0.015342509410
0.001564438290 0.039397972939
0.000000000000 0.014915990992
0.013335003291 0.000226832016
0.023349444489 0.000000000000
4
0.012103646607 0.000000000000
0.016163789301 0.004840038879
0.003320086741 0.012493169256
0.000000000000 0.005575920918
4
0.000000000000 0.054...

output:

0.01529435860117988713 0.07053366356541144373
0.03889455573948977717 0.09090568733057855892
0.01438342534119218635 0.09191533771371055392
0.00000000000000000000 0.07825112246814009610
0.00000000000000000000 0.06823411267053266467
0.64019761633902857068 0.68643712774530449728
0.63720512878353407615 0...

result:

ok OK

Test #33:

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

input:

133
6
0.072574557839 0.312677865325
0.001137204536 0.330688379241
0.000000000000 0.013845009228
0.004399538886 0.000000000000
0.108499348680 0.123193399648
0.163704701535 0.244778990085
4
0.003230768068 0.050209672075
0.122105847351 0.000000000000
0.133421862210 0.070986500693
0.000000000000 0.06213...

output:

0.00000000009463887641 0.42588491331940424626
0.00000000007972726564 0.35221216355709613122
0.30750763993107537469 0.42856703092948549952
0.31985702097453397742 0.43621771787515676539
0.17495267683394363211 0.50704225571884555755
0.04356041055263873292 0.53084895948503525904
0.73078829387531079264 0...

result:

ok OK

Test #34:

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

input:

138
3
0.118685904723 0.066395606854
0.000000000000 0.031651747666
0.055681967637 0.000000000000
4
0.075000665916 0.000000000000
0.082124079088 0.034173858786
0.019340637052 0.077974103991
0.000000000000 0.064478480978
5
0.030628968215 0.043757686336
0.000000000000 0.024195722398
0.004477590785 0.000...

output:

0.03393863041808163118 0.79956425549034459049
0.12025451782184084931 0.71100327489555705332
0.12211867328900994993 0.77502545516817560587
0.47439311687124140405 0.73025956640716104245
0.45058022950837955961 0.75578488785179520008
0.37859261417408817256 0.72974635272147762193
0.37846643542955798361 0...

result:

ok OK

Test #35:

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

input:

148
3
0.026621319141 0.000000000000
0.007296844689 0.016827125239
0.000000000000 0.012235984397
5
0.021570834617 0.000000000000
0.154819739283 0.077564199064
0.050155665830 0.113755864820
0.000000000000 0.119522929551
0.001664388533 0.009536516799
3
0.005288235752 0.016716105247
0.000000000000 0.001...

output:

0.86486479809529587470 0.70230541847964741932
0.88856328143212952921 0.69256019686541923729
0.89400353338991551651 0.69924795996648969046
0.24721453438565082777 0.51717739452248376775
0.17759703935019610672 0.65474512313540612034
0.13533051174740239956 0.55238328656451532662
0.12663241796458771556 0...

result:

ok OK

Test #36:

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

input:

154
3
0.056906082314 0.036639142594
0.017316385181 0.066883717906
0.000000000000 0.000000000000
5
0.000062233246 0.085710539368
0.000000000000 0.085546504140
0.016747101114 0.000000000000
0.087129946292 0.060459853042
0.082449394349 0.077583985414
3
0.003341899019 0.029877838968
0.000000000000 0.007...

output:

0.40836755754791449578 0.44887213328376257662
0.45252453775176664931 0.42580181567408289747
0.45821275433567071580 0.49465624987859998260
0.13272582724739684746 0.50563687459537571943
0.13280370173717164787 0.50547966105658210487
0.20689223856505794218 0.45954973096484383918
0.21046957921635773443 0...

result:

ok OK

Test #37:

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

input:

157
3
0.022975295316 0.133753786252
0.000000000000 0.000000000000
0.078583822597 0.009635574028
3
0.037772151360 0.047904437968
0.000000000000 0.024531195919
0.050382878792 0.000000000000
3
0.000000000000 0.000000000000
0.020626099645 0.002132947552
0.005061027297 0.032396497109
3
0.011486204366 0.0...

output:

1.00000000000000000000 0.16231579012716779137
1.00000000000000000000 0.29802849993207664321
0.92418172466050887184 0.27522826970916053598
0.75951675215002082423 0.45309721019455069269
0.80391859117363697311 0.45433031873976295576
0.77267971642570931035 0.50085285906199695095
0.93976372634066038107 1...

result:

ok OK

Test #38:

score: 0
Accepted
time: 5ms
memory: 4224kb

input:

165
4
0.090134183082 0.025631923190
0.043091940369 0.042946264434
0.000000000000 0.000000000000
0.087801581797 0.022553046918
3
0.047090776615 0.014149434646
0.000000000000 0.013150413325
0.057969691667 0.000000000000
6
0.000000000000 0.198704670057
0.018044187015 0.071766500734
0.178666873308 0.000...

output:

0.16836651516574281528 0.19603720859335173306
0.21546430465073552540 0.21319987867917408172
0.22062749488418242952 0.27381867469189015353
0.16815893652581755795 0.19989433433681552170
0.63979693358726969144 0.16472438685532277769
0.61184877466263839504 0.20263796885546323109
0.63449998393957895727 0...

result:

ok OK

Test #39:

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

input:

141
4
0.070754311340 0.076269199248
0.062424474687 0.079390660730
0.000000000000 0.006608944100
0.027761363879 0.000000000000
3
0.032333140816 0.000000000000
0.018854367463 0.075770826201
0.000000000000 0.004917529209
4
0.043452229407 0.020635378104
0.071652138659 0.000000000000
0.010439540528 0.213...

output:

0.52088366186060084810 0.69343649619309541990
0.51822332435023412035 0.68494813328694873042
0.59431625134986063236 0.62660552637262288532
0.59939407920349007541 0.65468731996391533361
0.59239637571390371229 0.79869497645463293552
0.61197564074811731526 0.72426683786381418248
0.62502181803869926634 0...

result:

ok OK

Test #40:

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

input:

150
4
0.104430286936 0.036068594926
0.000000000000 0.072773969166
0.025770678197 0.013811311664
0.091197517141 0.000000000000
3
0.022670063559 0.000000000000
0.104750912415 0.033498179724
0.000000000000 0.018301996997
4
0.000000000000 0.033588192686
0.055509876760 0.000000000000
0.093612013862 0.164...

output:

0.79531020367629605585 1.00000000000000000000
0.79681961512693274321 0.88931716032623306031
0.84329829767403680774 0.93381946256186168097
0.83372959639396905762 1.00000000000000000000
0.93232970706460929978 0.31804660486575741116
0.84937625861071337351 0.34932150179574992987
0.93649894849714822792 0...

result:

ok OK

Test #41:

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

input:

151
4
0.082120886773 0.006976355697
0.071345566846 0.031392713209
0.000000000000 0.019517191355
0.053143917683 0.000000000000
3
0.000000000000 0.000000000000
0.091126171335 0.009853756763
0.057587797068 0.021670311143
3
0.007139134362 0.125189875294
0.000000000000 0.053938889174
0.089421404760 0.000...

output:

0.00000000028600729620 0.60116449765256940957
0.00000000027303209137 0.57447618499302734223
0.07006667833916617080 0.55653521108402542234
0.02932686370429996827 0.59584760408914569949
0.84960262093630795386 0.92221174393631374905
0.92134808634309966005 0.97925263984398617606
0.88668721141452580683 0...

result:

ok OK

Test #42:

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

input:

160
4
0.040696066791 0.047219823786
0.009305331291 0.057176448200
0.000000000000 0.056984712422
0.032268750605 0.000000000000
4
0.000000000000 0.038789020633
0.016915008366 0.016976583470
0.032763462120 0.000000000000
0.051547223008 0.019191763974
4
0.000000000000 0.000000000000
0.130172492374 0.038...

output:

0.44341810807562287626 0.43197896941548992859
0.43925824022512101989 0.46464712125022336419
0.43517301741678090466 0.47300995017591203126
0.39702984959544816089 0.41977811324068511469
0.12019401435339297351 0.46650489645528612920
0.14726968249819492197 0.47187221588628731585
0.16954337126135112816 0...

result:

ok OK

Test #43:

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

input:

158
3
0.001915550667 0.000000000000
0.034028370155 0.018544352097
0.000000000000 0.005907043128
5
0.136245359655 0.128970898398
0.014463156719 0.152180580927
0.000000000000 0.017124902848
0.038946667270 0.000000000000
0.100028820871 0.046477522374
3
0.000000000000 0.000000000000
0.002176023513 0.001...

output:

0.42386854694660972521 0.73338268184210016751
0.45921099317072811943 0.74460933176382849589
0.42326426986039927176 0.73956308168130290655
0.15722565004156289298 0.51903730689172994096
0.12945365753014600137 0.63986077623034844449
0.00000000000000000000 0.59873937522478138274
0.00000000000000000000 0...

result:

ok OK

Test #44:

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

input:

136
3
0.000000000000 0.023909081840
0.004747357667 0.000000000000
0.037644065273 0.052155951394
3
0.019338142325 0.000000000000
0.003097556485 0.018698869165
0.000000000000 0.010189096166
3
0.089777029945 0.000000000000
0.129191001371 0.059173456144
0.000000000000 0.047646040548
3
0.003324443491 0.0...

output:

0.61088875735861354540 0.64501994612798987228
0.60758780559798177055 0.62086864558217411293
0.65568156989638623180 0.65946173409876420547
0.52568872975262502170 0.02165686340242533824
0.51367271508666761552 0.00000000008023528627
0.52272871270133854853 0.00000000007819860366
0.16900779337174600692 0...

result:

ok OK

Test #45:

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

input:

147
4
0.000000000000 0.004988602097
0.018122462737 0.000000000000
0.054083088523 0.101958262931
0.041936821245 0.106597694731
3
0.000000000000 0.061781491377
0.042986062660 0.000000000000
0.045863729411 0.002715666325
5
0.039071319391 0.085484407189
0.000000000000 0.067403622352
0.001901523050 0.008...

output:

0.98125010072481548936 0.28765545636399867210
0.99999999991165854871 0.28897874283305249253
0.99999999987204182014 0.39709282142047077108
0.98700216275229128460 0.39742803247714964516
0.99999999978620383997 0.64547926134575430053
0.99606155438304616655 0.57031781571613302591
0.99999999980976072265 0...

result:

ok OK

Test #46:

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

input:

152
3
0.000000000000 0.000000000000
0.010639615111 0.022310601976
0.005074044661 0.020707084072
4
0.067107543470 0.119800061582
0.012479352939 0.177432457247
0.000000000000 0.166544695638
0.050115844889 0.000000000000
4
0.000000000000 0.062067256374
0.234459572373 0.000000000000
0.207296942934 0.082...

output:

0.15866514959670102982 0.01849293726246718328
0.14226467127914561128 0.00000000136111950608
0.14805663501699965232 0.00000000141638108636
0.85924108709897496018 0.00000000000000000000
0.93864972828751277100 0.00000000000000000000
0.93933273555790814427 0.01654723833571942522
0.78398304451496959627 0...

result:

ok OK

Test #47:

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

input:

141
6
0.328655198005 0.062850413203
0.046943207866 0.145096334586
0.000000000000 0.115104420358
0.129362518690 0.000000000000
0.235511611236 0.013330329888
0.333701001790 0.049138167929
3
0.026067824377 0.000000000000
0.059607653338 0.042772395466
0.000000000000 0.029248826459
3
0.000000000000 0.018...

output:

0.77901972759449710388 0.54108446164263200974
1.00000000000000000000 0.73420037500813734065
1.00000000000000000000 0.78990656576263384005
0.83335424403118001882 0.74286530031713496108
0.78743751554495586417 0.64623724225310409837
0.76474788303033848242 0.54421499823268878261
0.23413518037938588407 0...

result:

ok OK

Test #48:

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

input:

158
4
0.024406826487 0.032172963861
0.015608274423 0.025319045425
0.000000000000 0.000000000000
0.050016028285 0.020714849837
4
0.140172916532 0.134925795210
0.025568500801 0.144618612986
0.000000000000 0.062404706178
0.168463466075 0.000000000000
4
0.046351016861 0.019411868345
0.026866241127 0.033...

output:

0.22042427502983471974 0.22466070893425209607
0.22886051488466702896 0.23195595214163894749
0.24315251336611738103 0.25804064249925671973
0.19426221244989964503 0.23479313585165288817
0.65717230558870579467 0.58412614987507016840
0.57026947836535742424 0.50878677477163961518
0.61132807470456290445 0...

result:

ok OK

Test #49:

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

input:

136
4
0.058333638597 0.055267647262
0.018532765770 0.061375091556
0.000000000000 0.000000000000
0.047535755657 0.026462387095
4
0.158436082817 0.000000000000
0.005640697347 0.049039899629
0.000000000000 0.042779928077
0.042276568079 0.026216620864
4
0.050874635669 0.000000000000
0.072532929267 0.025...

output:

0.96013281689955552712 0.52475702574297643645
1.00000000000000000000 0.53041547599295477909
1.00000000000000000000 0.59452760644189322424
0.96214304357185934514 0.55545387049981535864
0.48684888265742714677 0.85366114667916836946
0.42099843393529414742 0.99999999996607664667
0.41257200465611848305 0...

result:

ok OK

Test #50:

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

input:

150
4
0.050930453374 0.040675733274
0.000000000000 0.000000000000
0.090489613664 0.027030713833
0.090644214061 0.031734310584
3
0.000000000000 0.038180721417
0.102378163864 0.000000000000
0.075858452362 0.071485422261
4
0.147519116039 0.040480032340
0.000000000000 0.055626082924
0.007378810610 0.023...

output:

0.68793214447765344753 0.03998605846342013956
0.64560525880446584945 0.08955279221417228005
0.67559404008481269621 0.00000000000000000000
0.68030017688821141586 0.00000000000000000000
0.91558113525732232605 0.91729401940348371245
0.98698685514826540294 0.99999999904928643391
0.91074080158887156533 0...

result:

ok OK

Test #51:

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

input:

149
3
0.000000000000 0.009457169089
0.013227115495 0.000000000000
0.007993787855 0.013491863341
4
0.106274800461 0.000000000000
0.223840008192 0.168639770258
0.000000000000 0.284066455116
0.056537356181 0.066149676903
4
0.005819735526 0.000000000000
0.028771871972 0.025762444182
0.019086516540 0.033...

output:

0.64747279552515503681 0.56501473127163023006
0.66365498376432050545 0.56342368911643245748
0.65238495924867274245 0.57250138937028537649
0.45886763440023461947 0.79623269935943386417
0.48606758758276222295 0.99999999981754448310
0.23421908380295151220 1.00000000000000000000
0.38434399199374777285 0...

result:

ok OK

Test #52:

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

input:

173
5
0.162419071840 0.123170796359
0.108172711702 0.239725731867
0.046979840194 0.211245680539
0.000000000000 0.112041537218
0.034523915162 0.000000000000
4
0.043748171602 0.119042457148
0.000000000000 0.172557399870
0.031143373054 0.000000000000
0.037209742994 0.001341519136
5
0.014751437295 0.014...

output:

0.99999999969944098217 0.87143981735658582389
0.99999999966348751654 1.00000000000000000000
0.93250421573956896522 1.00000000000000000000
0.84805197167319727638 0.92988305552860198888
0.83207569639325480726 0.81373674517022046281
0.71180967164517357850 0.77241027275015688845
0.64644009997404940939 0...

result:

ok OK

Test #53:

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

input:

153
3
0.037995211990 0.073840717347
0.000000000000 0.031362395847
0.034114436013 0.000000000000
4
0.000000000000 0.008168093912
0.009033033279 0.000000000000
0.010332569236 0.000941880086
0.002932149345 0.009706794502
4
0.044746639703 0.000000000000
0.167078713538 0.004539375752
0.104202365982 0.087...

output:

0.92774973150148586055 0.50498986863756909090
0.96094338921135731319 0.45866249886081771937
0.99897703538765021724 0.48513581541389562423
0.54850802860493343122 0.76653757364362492394
0.54273806437897136463 0.77726235658122036119
0.54119788544288096910 0.77681093573417320686
0.54522963008438054069 0...

result:

ok OK

Test #54:

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

input:

151
3
0.000000000000 0.007505744932
0.005909417185 0.000000000000
0.021242430501 0.019227332910
5
0.003677449651 0.020790713761
0.031858768117 0.000000000000
0.031996593613 0.000431028732
0.010661229233 0.040388485236
0.000000000000 0.027804418085
4
0.000000000000 0.000092700685
0.000393953272 0.000...

output:

0.35286123401857459554 0.71350630809489360665
0.34473543647912657461 0.71852913921450550094
0.33692943699870831202 0.69520837597606752976
0.39983908614377844027 0.77863826622071391498
0.37194134428659918239 0.79980797301253082860
0.37179770569629271831 0.79937884646934612588
0.39259106557799093937 0...

result:

ok OK

Test #55:

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

input:

145
4
0.101131401683 0.004239534871
0.002126395285 0.110398984452
0.000000000000 0.093429526203
0.100428648617 0.000000000000
3
0.000000000000 0.089510657057
0.025031463510 0.000000000000
0.062445965055 0.062590645816
3
0.040123598749 0.062067037262
0.000000000000 0.071414645490
0.036307712564 0.000...

output:

0.07096311286204988612 0.18938256147561129696
0.14411060839027983940 0.31476702593144781004
0.12724775048807352876 0.31191604477288099458
0.06670081500079239396 0.18883453343105060951
0.54099633592374615429 0.00000000006153172206
0.63394111463852120190 0.00000000005976258124
0.58373936941033464497 0...

result:

ok OK

Test #56:

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

input:

148
3
0.022473707689 0.010628823145
0.000000000000 0.000000000000
0.017614905907 0.003846837707
4
0.000000000000 0.087683018843
0.103166140069 0.000000000000
0.112110946314 0.008167588666
0.040918392450 0.140222920679
6
0.001360882089 0.113699841394
0.000000000000 0.111893896240
0.000530315798 0.104...

output:

0.10954321048877213667 0.22911935178716600564
0.13239678363902377596 0.23890472930628783145
0.11465095836253125152 0.23571588064082964340
0.68400628856563033294 0.54139362557902558516
0.58741649096094780268 0.44651488587794864628
0.59474817135716853450 0.43687302267975981494
0.73266102251247665897 0...

result:

ok OK

Test #57:

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

input:

150
4
0.037812750287 0.118691582975
0.001602217304 0.100272318707
0.000000000000 0.092146832178
0.077894051429 0.000000000000
4
0.000000000000 0.166863616956
0.016468251275 0.000000000000
0.082759596790 0.041741422179
0.156888493136 0.122134882854
5
0.160621142263 0.000000000000
0.088097129596 0.111...

output:

0.04601411542648099849 0.18298217606274322555
0.00646920888340835547 0.19229197521301779078
0.00000000017242140906 0.18712090470305434140
0.00000000017885805337 0.06646220457582581916
0.36865710805489900753 0.99999999973515025251
0.20098281085478636095 0.99999999972875467725
0.23601156743987539932 0...

result:

ok OK

Test #58:

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

input:

156
5
0.000000000000 0.016621088768
0.056901538926 0.000000000000
0.074741463499 0.160031560021
0.055981532148 0.169355988143
0.029253608240 0.115581750078
3
0.000000000000 0.000000000000
0.034035228583 0.005898946498
0.016475149241 0.023913417617
4
0.029184342947 0.061591924268
0.000000000000 0.000...

output:

0.16168872971448966934 0.01785038110800644711
0.15124627447146576728 0.07620276624894135542
0.00000000000000000000 0.02094946261820057698
0.00000000000000000000 0.00000000000000000000
0.06005040045693958607 0.00000000001534224368
0.37222941621558315952 0.25237950755807425784
0.39433940923334521997 0...

result:

ok OK

Test #59:

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

input:

160
4
0.301116540960 0.000000000000
0.282162133515 0.024002994058
0.045466397780 0.130185785396
0.000000000000 0.112053345874
4
0.075018503604 0.082492555514
0.051596048309 0.096497968422
0.000000000000 0.022819865699
0.062013219697 0.000000000000
3
0.000000000000 0.005320856028
0.024433520492 0.000...

output:

0.97846658864929866802 0.98463463664211479655
0.95072809872752650734 0.97175094685484275441
0.79264118940792971190 0.76606140988863035204
0.79975711388538798570 0.71763267554838008834
0.10740972882267744907 0.30460407607487347196
0.09627375281390587421 0.27968916003716000928
0.17553865658894909485 0...

result:

ok OK

Test #60:

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

input:

151
5
0.000000000000 0.080017205009
0.038123286005 0.003287620398
0.053870922825 0.000000000000
0.030379830730 0.085418334516
0.020762689044 0.109049498312
4
0.032386625780 0.033994295628
0.005874752088 0.022289474166
0.000000000000 0.000000000000
0.032924358501 0.026248804149
6
0.263635510998 0.323...

output:

0.48598232051532226300 0.93268077360600932060
0.43298292558649986857 0.99999999990264244661
0.41689577191182899753 0.99999999989061851322
0.45734744285282283646 0.92118511805286956674
0.47159095389151831334 0.90001807503796840373
0.80734123165659969941 0.22526962548088137799
0.81357766462565795360 0...

result:

ok OK

Test #61:

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

input:

168
3
0.000000000000 0.001146888301
0.000291100186 0.000000000000
0.000500169700 0.000557039726
3
0.209796982239 0.000000000000
0.246804544500 0.173582948482
0.000000000000 0.093418372480
3
0.005153064521 0.077315638343
0.000000000000 0.000000000000
0.018439012022 0.074752853640
4
0.000000000000 0.0...

output:

0.20245596655796293789 0.29897064656279198928
0.20187811052663244238 0.29793808929959521593
0.20241309079994825459 0.29819847252785664125
0.47804026600019185777 1.00000000000000000000
0.30055618310235382928 1.00000000000000000000
0.43042043703588618096 0.77533554370358124511
0.47501618048360076771 0...

result:

ok OK

Test #62:

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

input:

162
4
0.000000000000 0.000000000000
0.250910891552 0.053737344615
0.265536347277 0.114938183410
0.034457838249 0.125482144000
5
0.020476398942 0.000000000000
0.040931873605 0.069430814812
0.021599535739 0.061698637553
0.008901949037 0.053065308412
0.000000000000 0.028630811545
4
0.000000000000 0.038...

output:

0.23154905715996655797 0.31168250817832302468
0.00000000000094373531 0.20109764555961594580
0.00000000000000000000 0.13817351167814957054
0.22720072455888713580 0.18162789240191563200
0.30796766102574730994 0.34817905416665510183
0.37328249985895122618 0.37937258424013749219
0.35460944382537499313 0...

result:

ok OK

Test #63:

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

input:

147
3
0.001083556391 0.000000000000
0.152321287992 0.109791901403
0.000000000000 0.017044690253
3
0.003386432280 0.000421260288
0.000000000000 0.002328169275
0.002829614976 0.000000000000
4
0.000000000000 0.000000000000
0.000770412465 0.000236023713
0.061801957545 0.036052266859
0.051636396354 0.050...

output:

0.74814704658249500950 0.67890949827377385030
0.85678570994704448703 0.83097771167994020078
0.74171672738773967878 0.69473183855707028745
0.43031295116004449850 0.71991539095195690586
0.42886090960756263280 0.71631042278931818229
0.43080280878802141952 0.71941785193642014391
0.58937744531936398542 0...

result:

ok OK

Test #64:

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

input:

158
4
0.008787147495 0.022483653147
0.057727560167 0.000000000000
0.069478843787 0.058464505159
0.000000000000 0.042953147789
3
0.053494024620 0.034724045645
0.000000000000 0.000000000000
0.084513534638 0.009737313038
4
0.039433456562 0.053136488521
0.000000000000 0.000000000000
0.148948017168 0.059...

output:

0.48685126308213269635 0.73984490711149561605
0.43567585814950339767 0.72305930069192307218
0.46680700341232702648 0.67219631978506868018
0.50721184627603552040 0.73080826922634941413
1.00000000000000000000 0.90815843095425552597
1.00000000000000000000 0.97193436698491549513
0.96215243719226307083 0...

result:

ok OK

Test #65:

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

input:

157
3
0.012527864086 0.070302721785
0.000000000000 0.000000000000
0.032659044428 0.018927675092
4
0.000000000000 0.000000000000
0.131851381518 0.148916617985
0.113565101275 0.160310174130
0.021268067916 0.059481444005
5
0.000000000000 0.098715729102
0.012723032513 0.050579865256
0.090130202082 0.000...

output:

0.95371508105079148555 0.53222166309715425718
0.89412361477813811941 0.57156981697729735981
0.89856811316435059305 0.53408493334806958426
0.54470330680742542443 0.34981301541478783737
0.58446400499556620345 0.54469768076526360384
0.56293096420728885274 0.54542522528946819671
0.53339159152803173545 0...

result:

ok OK

Extra Test:

score: 0
Extra Test Passed