QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#354263#2885. 非欧几何CrysflyAC ✓312ms4428kbC++176.9kb2024-03-15 01:53:142024-03-15 01:53:14

Judging History

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

  • [2024-03-15 01:53:14]
  • 评测
  • 测评结果:AC
  • 用时:312ms
  • 内存:4428kb
  • [2024-03-15 01:53:14]
  • 提交

answer

// what is matter? never mind. 
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx,avx,avx2") 
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define ll long long
//#define int long long
#define ull unsigned long long
#define double long double
#define SZ(x) ((int)((x).size()))
#define ALL(x) (x).begin(),(x).end()
using namespace std;
inline int read()
{
    char c=getchar();int x=0;bool f=0;
    for(;!isdigit(c);c=getchar())f^=!(c^45);
    for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
    if(f)x=-x;return x;
}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 400005
#define inf 0x3f3f3f3f

typedef double db;
const db eps=1e-10,pi=3.14159265358979323846;
int sgn(db x){return x<-eps?-1:x>eps;}
int cmp(db a,db b){return sgn(a-b);}

struct P{
	db x,y;
	P(db x=0,db y=0):x(x),y(y){}
	P&operator +=(P o){return x+=o.x,y+=o.y,*this;}
	P&operator -=(P o){return x-=o.x,y-=o.y,*this;}
	P&operator *=(db o){return x*=o,y*=o,*this;}
	P&operator /=(db o){return x/=o,y/=o,*this;}
	friend P operator +(P a,P b){return a+=b;}
	friend P operator -(P a,P b){return a-=b;}
	friend P operator *(P a,db b){return a*=b;}
	friend P operator /(P a,db b){return a/=b;}
	friend bool operator <(P a,P b){return fabs(a.x-b.x)<eps?a.y<b.y:a.x<b.x;}
	friend bool operator ==(P a,P b){return cmp(a.x,b.x)==0 && cmp(a.y,b.y)==0;}
	friend db operator %(P a,P b){return a.x*b.x+a.y*b.y;} // dot
	friend db operator *(P a,P b){return a.x*b.y-a.y*b.x;} // cross
	
	void rot(db o){
		db s=sin(o),c=cos(o),xx=x*c-y*s,yy=x*s+y*c;
		x=xx,y=yy;
	}
	void rot90(){swap(x,y),x=-x;}
	db ang(){return atan2(y,x);}
	db l(){return sqrt(x*x+y*y);}
	db l2(){return x*x+y*y;}
	
	int half(){return sgn(y)==1||(sgn(y)==0&&sgn(x)>=0);}
	P unit(){return ((*this))/l();}
	
	void read(){cin>>x>>y;}
	void out(){cout<<"("<<x<<","<<y<<")"<<endl;}
};
bool cmp_dir(P a,P b){
	if(a.half()!=b.half())return a.half()<b.half();
	return sgn(a*b)>0;
}

db dis(P a,P b){return (a-b).l();}
db cross(P a,P b,P c){
	// (a->b)*(a->c)
	return (b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x);
}
int cmp3(P a,P b,P c){
	return sgn(cross(a,b,c));
}

bool chkl(P p1,P p2,P q1,P q2){
	// is parallel
	return sgn((p2-p1)*(q2-q1))==0;
}
P interl(P p1,P p2,P q1,P q2){
	// intersect point
	db s1=cross(q1,q2,p1),s2=-cross(q1,q2,p2);
	return (p1*s2+p2*s1)/(s1+s2);
}

bool inter(db l1,db r1,db l2,db r2){
	if(l1>r1)swap(l1,r1); if(l2>r2)swap(l2,r2);
	return !(cmp(r1,l2)==-1||cmp(r2,l1)==-1);
}
bool ismid(db a,db m,db b){
	return sgn(a-m)==0||sgn(b-m)==0||((a<m)!=(b<m));
}
bool ismid(P a,P m,P b){
	return ismid(a.x,m.x,b.x)&&ismid(a.y,m.y,b.y);
}

bool chkseg(P p1,P p2,P q1,P q2){
	return inter(p1.x,p2.x,q1.x,q2.x) && inter(p1.y,p2.y,q1.y,q2.y) &&
	cmp3(p1,p2,q1)*cmp3(p1,p2,q2)<=0 && cmp3(q1,q2,p1)*cmp3(q1,q2,p2)<=0;
}
bool chkseg_strict(P p1,P p2,P q1,P q2){
	return cmp3(p1,p2,q1)*cmp3(p1,p2,q2)<0 && cmp3(q1,q2,p1)*cmp3(q1,q2,p2)<0;
}

struct L{
	P a,b;
	L(P aa,P bb){a=aa,b=bb;}
	bool isin(P p){return sgn((b-a)*(p-a))>0;}
	P dir(){return b-a;}
	bool onl(P p){
		return cmp3(a,b,p)==0;
	}
	bool onseg(P p){
		return onl(p)&&ismid(a,p,b);
	}
	bool onseg_strict(P p){
		return onl(p)&&sgn((p-a)%(a-b))*sgn((p-b)%(a-b))<0;
	}
	void out(){cout<<"("<<a.x<<","<<a.y<<")---("<<b.x<<","<<b.y<<")\n";}
};

bool chkl(L a,L b){
	// is parallel
	return chkl(a.a,a.b,b.a,b.b);
}
P operator &(L a,L b){
	return interl(a.a,a.b,b.a,b.b);
}
bool samedir(L a,L b){
	return chkl(a,b) && sgn(a.dir()%b.dir())==1;
}
bool operator <(L a,L b){
	if(samedir(a,b)) return b.isin(a.a);
	return cmp_dir(a.dir(),b.dir());
}

P proj(L a,P b){
	P d=a.dir();
	return a.a+d*((d%(b-a.a))/d.l2());
}
P reflect(L a,P b){
	return proj(a,b)*2-b;
}

db rad(P a,P b){
	return atan2l(a*b,a%b);
}

// polygon
db area(vector<P>a){
	db res=0;
	For(i,0,(int)a.size()-1)res+=a[i]*a[(i+1)%a.size()];
	return res/2;
}
int contain(vector<P>a,P p){
	int n=a.size(),res=0;
	For(i,0,n-1){
		P u=a[i],v=a[(i+1)%n];
		if(L(u,v).onseg(p))return 1;
		if(cmp(u.y,v.y)<=0)swap(u,v);
		if(cmp(p.y,u.y)>0 && cmp(p.y,v.y)<=0)continue;
		res^=cmp3(p,u,v)>0;
	}
	return res*2;
}
vector<P>cut(vector<P>a,P q1,P q2){
	vector<P>b; int n=a.size();
	For(i,0,n-1){
		P p1=a[i],p2=a[(i+1)%n];
		int d1=cmp3(q1,q2,p1),d2=cmp3(q1,q2,p2);
		if(d1>=0)b.pb(p1);
		if(d1*d2<0)b.pb(interl(p1,p2,q1,q2));
	}
	return b;
}

vector<P>convex(vector<P>a){
	int n=a.size(),m=0; if(n<=1)return a;
	sort(a.begin(),a.end());
	vector<P>st(n*2); int tp=0;
	For(i,0,n-1){
		while(tp>1 && cmp3(st[tp-2],st[tp-1],a[i])<=0)--tp;
		st[tp++]=a[i];
	}
	int t=tp;
	Rep(i,n-2,0){
		while(tp>t && cmp3(st[tp-2],st[tp-1],a[i])<=0)--tp;
		st[tp++]=a[i];
	}
	st.resize(tp-1);
	return st;
}
db diam(vector<P>a){
	int n=a.size();
	if(n<=1)return 0;
	int ii=0,jj=0;
	For(k,1,n-1){
		if(a[k]<a[ii])ii=k;
		if(a[jj]<a[k])jj=k;
	}
	int i=ii,j=jj;
	db res=dis(a[i],a[j]);
	do{
		if((a[(i+1)%n]-a[i])*(a[(j+1)%n]-a[j])>=0) (++j)%=n;
		else (++i)%=n;
		res=max(res,dis(a[i],a[j]));
	}while(i!=ii||j!=jj);
	return res;
}

bool check(L a,L b,L c){
	return c.isin(a&b);
}
vector<P>hpis(vector<L>&l){
	sort(l.begin(),l.end());
	deque<L>q;
	For(i,0,(int)l.size()-1){
		if(i&&samedir(l[i],l[i-1]))continue;
		while(q.size()>1 && !check(q[q.size()-2],q[q.size()-1],l[i]))q.pop_back();
		while(q.size()>1 && !check(q[1],q[0],l[i]))q.pop_front();
		q.pb(l[i]);
	}
	while(q.size()>2 && !check(q[q.size()-2],q[q.size()-1],q[0]))q.pop_back();
	while(q.size()>2 && !check(q[1],q[0],q[q.size()-1]))q.pop_front();
	vector<P>res;
	For(i,0,(int)q.size()-1) res.pb(q[i]&q[(i+1)%q.size()]);
	return res;
}

struct hull{
	vector<L>l3;
	vector<P>p3;
	void ins(L l){
		l3.pb(l);
	}
	void build(){
		db U=-1e9;
	l3.pb(L(P(-U,-U),P(U,-U)));
	l3.pb(L(P(U,-U),P(U,U)));
	l3.pb(L(P(U,U),P(-U,U)));
	l3.pb(L(P(-U,U),P(-U,-U)));
		p3=hpis(l3);
		p3=convex(p3);
	}
	bool in(P x){
		For(i,0,SZ(p3)-1){
			P p=p3[i],q=p3[(i+1)%p3.size()];
			if(!L(p,q).isin(x))return 0;
		}
		return 1;
	}
}t1,t2;

int n,m,T;
db R;

P getp(){
	db x,y; cin>>x>>y;
	db z=sqrtl(R*R-x*x-y*y);
	char ch; cin>>ch;
	z=R*2/(R+(ch=='-'?z:-z));
	return P(x*z,y*z);
}
L getline(){
	P p1=getp(),p2=getp();
//	cout<<"p1: ";p1.out();
//	cout<<"p2: ";p2.out();
	L l=L(p1,p2);
	if(!l.isin(P(0,0))) l=L(p2,p1);
	assert(l.isin(P(0,0)));
	return l;
}

signed main()
{
	cin>>n>>m>>T>>R;
	while(n--) t1.ins(getline());
	while(m--) t2.ins(getline());
	t1.build(),t2.build();
//	cout<<t1.in(P(0,0))<<" in1\n";
//	cout<<t2.in(P(0,0))<<" in2\n";
	while(T--) {
		P x=getp();
		if(!t1.in(x)) puts("Safe");
		else if(!t2.in(x)) puts("Goodbye");
		else puts("Passer");
	}
	return 0;
}
/*

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 43ms
memory: 3812kb

input:

1 1 50000
999
-804.012 474.581 - -894.464 -375.820 +
752.540 412.051 - 495.305 819.650 -
-864.250 416.299 +
-996.067 72.641 -
-512.349 39.102 -
994.573 24.725 -
489.232 -507.604 -
260.906 872.539 -
78.106 972.376 +
-335.957 940.631 +
-881.629 469.742 -
-285.093 147.253 -
-461.010 883.355 -
-154.842 ...

output:

Safe
Safe
Passer
Goodbye
Passer
Passer
Passer
Safe
Safe
Passer
Safe
Passer
Goodbye
Passer
Goodbye
Passer
Goodbye
Passer
Passer
Goodbye
Passer
Passer
Passer
Goodbye
Passer
Passer
Passer
Passer
Safe
Passer
Goodbye
Goodbye
Passer
Passer
Safe
Passer
Goodbye
Passer
Goodbye
Passer
Goodbye
Passer
Passer
Go...

result:

ok 50000 lines

Test #2:

score: 0
Accepted
time: 58ms
memory: 3772kb

input:

3 461 50000
974
784.457 476.700 + -960.282 70.145 +
-441.764 -849.753 - 619.289 642.106 +
-725.206 -535.036 + -945.974 -229.799 -
750.696 176.899 - -448.253 855.111 -
877.296 -422.525 + 973.309 -1.218 +
-319.904 914.620 + -944.529 -133.840 +
-591.199 747.520 + -390.694 -253.706 -
-604.604 693.495 + ...

output:

Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Goodbye
Passe...

result:

ok 50000 lines

Test #3:

score: 0
Accepted
time: 64ms
memory: 3824kb

input:

9 463 50000
973
597.967 -639.060 - 874.803 401.447 -
-934.763 -262.127 + -912.888 -296.158 -
142.010 292.850 - -311.595 -871.137 -
-912.339 -94.077 - -604.834 -672.595 -
-189.196 759.979 - -705.801 666.122 +
-381.831 -842.537 - 872.112 -351.678 +
-243.291 -645.668 - -511.155 -733.734 +
-712.134 646....

output:

Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Goodbye
Safe
Safe
...

result:

ok 50000 lines

Test #4:

score: 0
Accepted
time: 71ms
memory: 3856kb

input:

39 486 50000
956
-631.839 -689.747 - -600.713 -33.146 -
-952.704 6.635 - -194.908 -726.891 -
521.450 -557.051 - 592.847 650.787 +
-240.757 -380.448 - 526.354 -792.424 +
-806.020 -282.992 - 398.047 820.829 -
384.098 833.019 + 14.147 -709.910 -
-619.025 -567.568 - -954.972 -29.010 +
869.213 -359.593 +...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
...

result:

ok 50000 lines

Test #5:

score: 0
Accepted
time: 80ms
memory: 4084kb

input:

456 481 50000
990
805.321 206.787 - -19.086 868.502 -
594.224 -789.196 + -682.976 -705.637 -
957.919 217.646 + -372.489 859.053 -
-32.358 646.155 - -783.001 -506.924 +
-749.149 -620.973 + 910.744 380.617 -
-111.543 -810.268 - 316.279 -937.961 -
-356.665 -913.256 - 743.354 641.227 +
-325.560 -922.361...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Saf...

result:

ok 50000 lines

Test #6:

score: 0
Accepted
time: 60ms
memory: 3856kb

input:

471 486 50000
967
-219.415 -928.067 - -816.892 482.148 -
347.635 204.173 - 610.572 -611.533 +
863.572 399.514 - -36.683 -961.468 +
-603.797 -674.752 + 21.298 773.196 -
815.770 58.560 - 692.242 611.125 +
-570.167 -779.921 + 599.130 -512.308 -
341.883 -897.692 + 463.720 -822.205 -
965.987 -35.287 - -1...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
...

result:

ok 50000 lines

Test #7:

score: 0
Accepted
time: 172ms
memory: 4428kb

input:

5000 5000 131203
959
935.958 167.112 - 166.090 -280.895 -
912.979 292.183 - 470.358 -652.661 -
239.573 -908.710 + -192.308 -932.148 +
-893.651 -347.780 - -685.065 -648.438 +
116.122 907.590 - 728.164 444.732 -
-520.051 739.395 + -772.285 567.793 -
-836.485 466.444 - -706.621 628.223 -
886.392 364.29...

output:

Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer...

result:

ok 131203 lines

Test #8:

score: 0
Accepted
time: 312ms
memory: 4424kb

input:

5000 5000 277674
996
377.885 871.628 + 963.765 -242.814 +
817.472 559.505 + -608.873 -711.502 +
-713.725 -272.218 - -778.316 503.674 +
490.827 694.852 - -131.122 752.396 -
-105.202 787.688 - -812.011 176.049 -
-399.261 -719.621 - -758.648 597.161 +
-2.887 993.285 + 975.702 179.838 +
793.864 -503.428...

output:

Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer
Passer...

result:

ok 277674 lines

Test #9:

score: 0
Accepted
time: 36ms
memory: 3792kb

input:

3 3 50000
983
492.075 -599.764 - 370.286 -910.588 +
638.607 -651.449 + 502.750 -659.905 -
99.991 -971.880 + 951.066 194.373 +
-601.772 770.053 + 831.166 509.097 +
182.038 754.857 - 691.095 612.334 +
-942.113 -237.821 - 736.626 -530.424 +
681.381 38.695 -
597.870 -731.222 +
797.853 474.257 +
-881.646...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Goodbye
Safe
Safe
Goodbye
Safe
Goodbye
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Goodbye
Safe
Goodbye
Goodbye
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Saf...

result:

ok 50000 lines

Test #10:

score: 0
Accepted
time: 40ms
memory: 3820kb

input:

9 9 50000
981
-358.621 910.457 - 931.469 -117.834 -
44.040 978.865 + 888.647 404.470 +
-168.519 -966.241 - 473.918 -786.592 +
-589.449 620.819 + -715.123 -671.353 +
-463.633 -864.418 - -55.191 964.681 -
-828.519 -426.251 + -353.804 895.625 +
589.963 -342.891 - 644.833 -618.793 -
-979.775 -48.258 + 9...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Saf...

result:

ok 50000 lines

Test #11:

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

input:

39 39 50000
988
139.216 972.870 + -589.699 720.238 +
-632.270 -596.214 + -683.114 -643.547 +
127.770 -928.445 - -941.079 213.992 +
391.934 -883.515 + -43.412 965.862 +
-224.310 -958.961 - -979.578 -126.508 +
-423.739 -799.059 - -770.859 587.464 +
-179.727 959.721 + 303.713 922.418 +
927.386 -39.324 ...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Sa...

result:

ok 50000 lines

Test #12:

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

input:

479 1 50000
999
-878.042 311.024 - -889.710 -424.396 -
560.100 825.869 + -780.519 618.926 +
-627.847 678.989 + -418.578 -485.191 -
-603.631 780.018 + -644.645 -763.160 +
-869.393 -432.623 + 834.008 -530.226 +
980.507 -182.968 - -510.019 676.174 -
-610.696 659.123 + 193.238 917.410 -
-13.991 -995.474...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe...

result:

ok 50000 lines

Test #13:

score: 0
Accepted
time: 50ms
memory: 3812kb

input:

459 3 50000
995
-484.706 -822.383 + 466.722 -324.671 -
693.037 645.451 + 721.461 -681.342 -
81.827 978.148 - 471.469 240.087 -
-391.014 408.445 - 632.594 682.818 -
-979.806 134.616 - -558.451 -706.617 +
-562.902 746.487 + -973.500 119.277 -
128.935 983.596 - 667.732 -728.043 +
227.733 -482.519 - -69...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Passer
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
...

result:

ok 50000 lines

Test #14:

score: 0
Accepted
time: 39ms
memory: 3768kb

input:

496 9 50000
994
-974.975 -188.651 + -968.913 -59.211 -
-830.224 538.967 - -954.056 137.951 -
-783.800 583.774 + -651.126 592.725 +
-932.537 335.126 + 466.692 857.305 +
-932.027 339.569 - -706.194 -667.599 +
-928.570 334.789 + -885.174 449.650 -
-771.476 -619.972 - 616.784 -563.500 -
650.290 -613.345...

output:

Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Passer
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
...

result:

ok 50000 lines

Test #15:

score: 0
Accepted
time: 48ms
memory: 4048kb

input:

484 39 50000
959
-896.535 -296.476 + 402.823 823.806 +
-707.492 647.396 - -625.106 -456.506 -
162.512 944.121 + 864.144 363.224 +
-952.154 112.611 + 283.707 -847.636 -
413.516 -766.884 - 325.744 -898.794 -
-872.272 -398.517 - -904.982 -313.367 +
-172.333 -919.591 + -639.712 -643.868 +
37.394 781.327...

output:

Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Goodbye
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
Safe
S...

result:

ok 50000 lines

Test #16:

score: 0
Accepted
time: 55ms
memory: 3996kb

input:

1 454 50000
966
-885.798 -384.811 + -733.012 613.951 -
-963.072 68.655 - -691.680 667.520 +
677.258 -544.026 + 7.653 946.631 +
414.613 -872.287 + -950.409 -103.664 +
-614.543 -713.201 + -566.294 677.843 +
-829.530 -464.185 + 867.435 -382.425 -
-664.869 700.783 + 245.770 -909.791 +
870.137 406.486 - ...

output:

Goodbye
Safe
Safe
Goodbye
Safe
Goodbye
Safe
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Passer
Safe
Safe
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Safe
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Safe
Goodbye
Goodbye
Safe
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
Goodbye
...

result:

ok 50000 lines