QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#687073#6620. Linear Fractional TransformationY_J_YAC ✓273ms16440kbC++202.6kb2024-10-29 17:02:372024-10-29 17:02:37

Judging History

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

  • [2024-10-29 17:02:37]
  • 评测
  • 测评结果:AC
  • 用时:273ms
  • 内存:16440kb
  • [2024-10-29 17:02:37]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define root 1,n,1
#define ls (rt<<1)
#define rs (rt<<1|1)
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define pd __gnu_pbds
inline ll read() {
	ll x=0,w=1;char ch=getchar();
	for(;ch>'9'||ch<'0';ch=getchar()) if(ch=='-') w=-1;
	for(;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
	return x*w;
}
inline void print(__int128 x){
	if(x<0) {putchar('-');x=-x;}
	if(x>9) print(x/10);
	putchar(x%10+'0');
}
#define maxn 1000010
const double eps=1e-8;
#define	int_INF 0x3f3f3f3f
#define ll_INF 0x3f3f3f3f3f3f3f3f
complex<long double>a[200][200];
int n;
int gauss() {
	int c,r;
	for(c=0,r=0;c<n;c++) {
		int t=r;
		for(int i=r;i<n;i++) {
			if(abs(a[i][c])>abs(a[t][c])) {
				t=i;
			}
		}
		if(abs(a[t][c])<eps) continue;
		for(int i=c;i<=n;i++) swap(a[t][i],a[r][i]);
		for(int i=n;i>=c;i--) a[r][i]/=a[r][c];
		for(int i=r+1;i<n;i++) {
			if(abs(a[i][c])>eps) {
				for(int j=n;j>=c;j--) {
					a[i][j]-=a[r][j]*a[i][c];
				}
			}
		}
		r++;
	}
	if(r<n) {
		for(int i=r;i<n;i++) {
			if(abs(a[i][n])>eps) {
				return 2;//无解
			}
		}
		return 1;//有无穷多解
	}
	for(int i=n-1;i>=0;i--) {
		for(int j=i+1;j<n;j++) {
			a[i][n]-=a[i][j]*a[j][n];
		}
	}
	return 0;//有唯一解
}
complex<long double>z[maxn],w[maxn];
long double p[maxn],q[maxn],r[maxn],s[maxn];
int main() {
	int T=read();
	while(T--) {
		n=3;
		for(int i=1;i<=3;i++) {
			scanf("%Lf%Lf%Lf%Lf",&p[i],&q[i],&r[i],&s[i]);
			z[i].real(p[i]);z[i].imag(q[i]);
			w[i].real(r[i]);w[i].imag(s[i]);			
		}
		scanf("%Lf%Lf",&p[4],&q[4]);
		z[4].real(p[4]);z[4].imag(q[4]);
		complex<long double>A=(w[1]-w[2])/(z[1]-z[2]);
		complex<long double>B=w[1]-A*z[1];
//		cout<<(A*z[3]+B).real()<<" "<<(A*z[3]+B).imag()<<endl;
		if(abs(A*z[3]+B-w[3])<eps) {//意味着此时c=0
			complex<long double>ans=A*z[4]+B;
			printf("%.7Lf %.7Lf\n",ans.real(),ans.imag());
			continue;
		}
		for(int i=0;i<3;i++) {
			a[i][0]=z[i+1];a[i][1]={1,0};
			a[i][2]=-w[i+1];
			a[i][3]=w[i+1]*z[i+1];
		}		
		int state=gauss();
//		cout<<state<<endl;
		complex<long double>ans=(a[0][3]*z[4]+a[1][3])/(z[4]+a[2][3]);
		printf("%.7Lf %.7Lf\n",ans.real(),ans.imag());
//		cout<<a[2][3].real()<<" "<<a[2][3].imag()<<endl;
//		cout<<"check:"<<endl;
//		ans=(a[0][3]*z[1]+a[1][3])/(z[1]+a[2][3]);
//		printf("%.7Lf %.7Lf\n",ans.real(),ans.imag());
//		
//		ans=(a[0][3]*z[2]+a[1][3])/(z[2]+a[2][3]);
//		printf("%.7Lf %.7Lf\n",ans.real(),ans.imag());
//		
//		ans=(a[0][3]*z[3]+a[1][3])/(z[3]+a[2][3]);
//		printf("%.7Lf %.7Lf\n",ans.real(),ans.imag());
	}
	return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
-1 0 0 -1
0 1 -1 0
1 0 0 1
0 -1
-1 0 -1 0
0 1 0 -1
1 0 1 0
0 -1

output:

1.0000000 0.0000000
-0.0000000 1.0000000

result:

ok 4 numbers

Test #2:

score: 0
Accepted
time: 224ms
memory: 14192kb

input:

100000
0 0 -1 1
1 1 1 0
1 0 1 -1
-1 0
-1 -1 -1 1
1 -1 1 -1
-1 0 1 0
-1 -1
-1 -1 0 -1
-1 1 -1 -1
0 -1 0 0
1 1
1 0 0 -1
0 0 0 0
-1 -1 1 0
1 1
-1 -1 0 -1
0 1 1 -1
1 0 -1 -1
1 -1
0 1 1 -1
1 0 1 0
0 -1 0 1
-1 -1
1 1 -1 1
0 0 -1 -1
0 1 0 1
1 0
1 1 1 -1
0 1 -1 -1
1 0 -1 0
1 -1
1 0 -1 1
-1 -1 1 0
0 -1 0 1
0...

output:

1.0000000 1.6666667
-1.0000000 1.0000000
-1.5000000 -0.5000000
0.3333333 -0.6666667
-0.3846154 -0.9230769
-1.0000000 0.0000000
-1.5000000 0.5000000
-0.8536585 -0.3170732
-1.3333333 0.3333333
0.1724138 -0.0689655
-1.0000000 -1.0000000
-0.6666667 -1.3333333
1.0000000 0.0000000
0.0000000 2.0000000
1.50...

result:

ok 200000 numbers

Test #3:

score: 0
Accepted
time: 237ms
memory: 16224kb

input:

100000
2 -2 -1 -1
-1 2 2 -2
-1 -1 -2 2
2 0
-1 1 0 -2
2 -1 -2 1
2 -2 2 1
2 2
2 2 -2 -1
-2 1 2 1
1 1 -2 -2
1 -2
-2 -1 0 1
2 -1 1 1
1 0 -2 0
-1 0
1 2 -2 0
2 0 0 -1
-1 1 -2 -1
-1 2
1 0 0 -1
2 -1 -2 2
1 -2 -1 1
1 2
2 1 -2 -1
-2 2 0 -1
0 1 -1 1
1 -2
2 2 1 1
-1 1 2 2
-1 2 -1 -2
0 0
2 -1 -1 -2
1 -1 -2 1
0 1...

output:

-0.2687277 -0.9821641
-0.5573159 -2.6905871
-0.6035503 -1.2485207
-0.1621622 0.9729730
-2.2307692 -0.8461538
0.5294118 0.8823529
-2.0000000 -3.0000000
1.3123732 1.3367140
-2.0000000 1.0000000
-3.5000000 -7.5000000
0.9297297 0.9783784
-3.0000000 -1.0000000
-0.2941176 4.8235294
-1.9832129 1.1363954
-0...

result:

ok 200000 numbers

Test #4:

score: 0
Accepted
time: 235ms
memory: 14152kb

input:

100000
-2 -3 1 1
0 -3 3 3
-1 1 0 3
-1 -2
-3 1 -3 -1
0 -1 2 3
-2 0 -2 1
2 3
-2 1 3 -1
3 -1 3 -2
2 1 0 -3
-3 -1
-1 2 0 3
1 1 -3 -3
-1 -3 2 -3
2 1
0 -3 1 2
-3 -2 0 3
-2 2 2 -3
2 -3
-3 0 -3 2
0 0 -3 1
0 1 0 3
3 0
-3 -3 0 -3
1 1 3 -2
1 0 2 0
-1 1
-3 1 -3 2
-2 3 2 3
0 2 -2 -3
-1 -1
1 -2 1 1
1 1 -2 -3
-1 0...

output:

1.3135135 2.3189189
11.3333333 -22.3333333
3.0412607 -1.1885387
-1.4117647 -2.6470588
1.0315962 1.5752975
-3.6666667 2.0000000
1.3333333 -5.3333333
-4.3333333 0.0000000
5.0350195 -2.4396887
-7.0000000 -1.0000000
-3.5777778 0.7333333
5.5517241 4.3793103
1.0207636 -0.9698593
-1.1474011 -0.3948798
1.65...

result:

ok 200000 numbers

Test #5:

score: 0
Accepted
time: 237ms
memory: 6012kb

input:

100000
-4 -1 -3 1
-3 -4 -2 -2
-1 2 -4 -4
-1 2
1 0 1 4
-3 0 4 -4
-1 -2 -3 -1
3 4
-2 3 2 3
-3 2 4 0
2 -3 -2 0
1 -4
1 1 1 -3
3 1 -4 1
2 -3 -1 4
3 4
3 -2 3 1
4 -3 1 2
3 -1 -2 0
2 0
-2 -4 3 -2
2 1 3 1
-1 1 -1 -1
-4 -2
2 4 0 -2
-1 -2 -1 -4
0 -1 1 -3
1 3
-2 -2 -4 1
4 3 0 2
-2 -1 0 4
0 2
-3 0 -3 -1
-1 1 -4 ...

output:

-4.0000000 -4.0000000
2.4723998 1.4450901
-1.8509923 -0.2745906
-8.8082985 4.6330010
-1.1719745 2.8152866
2.7857143 -2.8571429
0.0524515 -2.0798176
0.0497979 2.2103476
-3.4613861 -0.1861386
1.2540239 4.0170809
-0.0000000 1.0000000
3.0591716 -3.1420118
1.7936687 0.4420577
-5.3486239 0.4954128
1.33697...

result:

ok 200000 numbers

Test #6:

score: 0
Accepted
time: 273ms
memory: 3900kb

input:

100000
2 -1 -3 4
3 5 1 -5
-1 -2 0 -4
5 1
-3 2 1 0
3 -3 2 -5
-4 -4 2 1
3 3
3 -3 2 -2
3 5 -2 5
2 -3 0 3
-2 -1
-4 2 1 1
-2 5 1 5
4 -3 2 5
-1 2
-4 4 -5 2
-3 -1 5 5
-5 3 4 -4
-1 0
5 -1 -1 -3
2 3 -3 -5
-4 -1 -5 2
5 2
-1 -4 -2 2
-5 5 -1 2
-3 4 -3 -1
-1 -1
1 -3 -1 -3
-5 -3 -4 0
-2 -1 -4 2
0 4
0 -4 -4 -2
-4 ...

output:

1.8163547 -4.9458294
0.9461271 -1.1164736
-1.5424937 4.4738294
1.5775401 4.4010695
4.0302850 5.6217340
-1.9257160 -3.6702405
-2.0893366 1.9394065
-6.3911672 -0.5930599
-4.0000000 -2.0000000
2.3333333 -3.3333333
2.8926127 -5.4734936
6.5405405 -0.2432432
4.0000000 -2.0000000
3.8340578 -1.9690203
-10.7...

result:

ok 200000 numbers

Test #7:

score: 0
Accepted
time: 231ms
memory: 16440kb

input:

100000
-6 6 -2 4
-5 5 3 -6
-1 4 -6 -4
1 5
-4 -3 -4 5
6 -3 1 4
-3 5 4 3
-1 5
5 -2 -5 2
-2 3 5 5
2 2 -3 0
2 4
-1 -6 2 1
-6 -5 4 -4
-5 -6 3 3
1 5
-3 5 1 1
5 5 -4 0
-1 4 6 -3
2 -5
3 1 -2 -4
4 3 3 -3
-5 -6 2 -2
2 0
4 -4 5 -4
6 3 0 1
3 4 -2 -1
6 -4
-5 6 -6 -3
-3 2 3 3
5 -3 -5 -6
2 -2
-3 5 3 -5
0 3 4 3
1 -...

output:

-6.3099069 -3.3073666
3.3657264 3.6426666
-3.7955730 -2.4874276
1.7508367 0.5444403
-2.1496108 -0.9076483
0.8726009 -1.8836331
6.0928635 -2.2293222
-4.6679963 -6.4819889
-3.1337440 -5.7857457
4.5670853 5.2485129
2.5681492 -4.7604017
-2.5333333 -8.7333333
-1.9553284 2.9156981
-2.8441116 -7.5847515
0....

result:

ok 200000 numbers

Test #8:

score: 0
Accepted
time: 239ms
memory: 14204kb

input:

100000
-2 -1 -3 0
4 -4 -2 6
2 -1 -7 0
0 -6
-1 0 1 -2
-2 -3 2 -5
3 -2 -1 5
6 -1
1 5 -6 7
-6 -3 -3 2
7 -2 -3 -3
-3 -4
1 7 -5 -2
-5 -4 -5 -4
2 0 1 6
7 4
1 -3 6 -7
-6 -6 1 -5
4 -2 1 1
-3 -3
-5 0 2 7
-2 2 -5 1
3 -4 -1 6
6 4
-7 4 3 -2
-5 4 7 -7
0 2 0 2
2 -3
-7 1 4 -6
0 5 2 -6
4 -2 4 -5
-2 3
1 -7 -1 -7
7 -...

output:

-2.1314226 2.0300594
-3.8938701 0.7511436
-2.3984705 1.6373643
-6.1395898 -1.6054692
1.8664047 -5.2121807
-1.8015501 6.4100881
0.5923650 0.9645879
3.2487805 -5.9609756
1.8906008 -0.3502223
3.4157396 -0.4183009
2.2687445 6.1972092
-3.2307692 18.8461538
1.2969795 -6.4064464
-2.5230503 3.7532062
-7.972...

result:

ok 200000 numbers

Test #9:

score: 0
Accepted
time: 240ms
memory: 16172kb

input:

100000
6 1 3 5
7 -1 2 0
-3 -6 0 3
-6 -8
4 8 -4 7
-2 -5 -2 7
-2 -8 -4 -5
-7 -8
4 -7 -1 -5
2 5 -7 0
-4 0 -7 -5
-7 1
8 2 2 0
1 6 -6 3
0 -7 5 0
2 -5
-7 6 8 5
-5 3 -8 8
-5 0 -1 -8
5 -4
-1 6 -5 8
6 -7 4 5
-4 3 -6 -6
3 2
5 -2 1 5
6 -6 -4 0
3 5 -6 3
-8 2
-4 3 2 -8
6 0 3 7
-4 -8 -4 2
-5 0
-7 3 -3 -3
1 -8 -6 ...

output:

-0.1205245 3.0345020
-4.0059077 5.5842099
-8.4299348 -5.9873392
4.6022926 -0.5428561
3.4647059 -2.0411765
0.6300729 5.1122229
-5.2690355 2.2335025
-4.7322063 -6.2427601
-2.7830236 -0.2134606
9.1611002 90.5088409
0.8865493 -8.0308368
9.6899742 6.9168363
0.0654463 6.3444335
0.5353245 -1.5841470
-11.13...

result:

ok 200000 numbers

Test #10:

score: 0
Accepted
time: 221ms
memory: 16368kb

input:

100000
9 -3 3 4
-4 -6 -1 6
5 5 1 9
-1 -9
2 -7 4 -9
-4 -7 -4 -5
3 3 1 -4
-8 3
-8 -6 -8 9
-9 -4 -1 8
6 7 7 -3
6 -8
7 1 6 -3
2 0 6 -2
5 2 -1 -5
5 -2
6 -5 -5 1
-4 -8 -1 9
7 -7 8 1
2 -8
2 9 -6 -1
6 3 -4 5
3 3 9 8
4 -9
-2 3 9 2
-7 -6 9 9
-7 9 1 3
-9 -4
3 -1 -6 -7
9 4 -7 2
4 0 -3 -5
-7 -8
8 -3 5 -9
-9 1 1 ...

output:

-0.9408057 5.3635300
-0.4270894 -3.3653106
6.2053176 -8.4636625
6.1588895 -2.3821618
-1.6295824 11.3719232
-9.7059015 3.3532945
9.2090754 10.5674799
-10.6878994 -2.0794649
1.8500646 -8.3639353
3.3192356 -4.3509091
-4.8357050 -8.0815006
-0.3837736 5.6902563
3.9490799 1.9275278
6.4503221 -11.4363504
-...

result:

ok 200000 numbers

Test #11:

score: 0
Accepted
time: 244ms
memory: 16224kb

input:

100000
1 -6 6 -6
7 6 3 4
9 -7 8 -9
6 -2
6 -9 -1 0
-6 -10 -5 -1
9 -10 -7 7
-2 -6
10 0 -1 -7
-5 -8 2 -1
6 6 1 -4
-7 6
-1 -2 -10 2
-5 7 -1 -10
-7 -5 6 -8
-6 -8
6 6 0 -5
-5 -1 -4 4
-10 -4 2 -6
-7 7
10 6 1 -10
-4 -4 -3 6
-1 -8 7 -1
10 -2
-1 -2 3 1
2 -9 -6 -1
7 -5 3 4
1 7
2 1 9 -5
7 -8 -4 -7
5 -6 6 7
-9 4...

output:

9.3979320 -4.7255858
-4.6109351 -0.7536182
1.8139717 -2.4735204
8.0322701 -10.8807052
0.6682259 -4.3969262
3.4267657 -9.9962915
2.3869554 1.9323089
9.1052601 -6.9921079
-4.9022561 5.5595225
-3.0207612 4.2110727
13.4086519 -1.7388417
7.0778520 -2.8358425
14.3915212 -12.1695761
-3.9741472 -2.2686913
-...

result:

ok 200000 numbers

Test #12:

score: 0
Accepted
time: 242ms
memory: 16388kb

input:

100000
6 -8 -8 -3
-7 4 -9 -9
10 -8 -11 2
0 1
-6 9 10 9
-4 1 5 -4
9 -7 -10 -8
-9 -4
8 8 7 -1
-10 -7 -11 -10
1 -3 -1 10
5 9
2 -8 9 8
-2 0 5 3
3 -9 -2 0
-2 -2
7 -6 5 4
-9 -7 -7 -2
9 11 7 -7
-7 -7
6 -7 -1 -10
-10 -9 3 -11
-4 -1 0 9
-11 5
-11 1 -11 9
-7 5 4 -6
-8 10 -11 2
3 2
-3 11 -6 0
0 11 0 11
5 4 -9 ...

output:

-9.6415630 -7.8393708
-0.6123034 -0.7438379
8.6117868 -1.4856454
5.1248894 3.0488862
-7.6825343 -0.4304146
2.6631730 -7.1168896
-8.1164465 5.0613647
-8.4757931 1.6513359
-7.8688200 -1.3968359
2.3382969 1.4720977
-7.0755377 -3.5470503
2.6370158 -0.2656891
8.3682387 7.1530880
2.2140575 -6.6485623
7.93...

result:

ok 200000 numbers

Test #13:

score: 0
Accepted
time: 248ms
memory: 16236kb

input:

100000
-6 -2 -12 -5
-6 5 9 -10
12 5 12 8
7 -2
1 0 8 0
-10 -10 9 3
-9 12 -3 6
-4 -9
-1 -3 -12 8
0 -8 11 -2
11 -2 -6 11
3 -8
0 -3 -3 11
10 1 -10 7
-8 -3 -1 1
-12 -2
-7 -1 -8 1
1 8 12 10
12 -2 2 -10
-7 4
-6 -12 -8 8
-10 3 -6 -1
-3 0 -2 12
6 10
11 -11 -10 9
9 -12 -4 -1
10 -6 -8 -7
5 1
-10 4 -10 4
-10 9 ...

output:

11.0138821 14.4851410
8.7673931 2.1034289
-1.1865622 7.6447136
-3.7692308 -0.1538462
-9.1659002 7.0934578
-4.5838974 6.6852802
-5.5610619 -7.1840708
2.5392203 -3.1163576
-4.8462265 -3.6120417
6.3555455 4.5625546
8.7120313 7.4691694
-4.3558340 5.6758561
-9.6050732 1.7185544
-3.4713382 -18.4337603
-7....

result:

ok 200000 numbers

Test #14:

score: 0
Accepted
time: 239ms
memory: 16236kb

input:

100000
12 -13 -8 -3
1 -5 8 -7
-3 2 -6 12
-13 8
2 11 -7 6
-13 -11 8 -13
-7 8 3 13
-5 1
-3 -11 -9 0
-4 11 6 9
6 9 -12 13
11 13
-2 -5 -3 -6
5 -11 -5 -3
-12 -13 -10 6
-3 3
4 -13 -3 0
13 -4 -12 13
-2 -2 4 -6
-3 12
11 -4 0 13
-1 2 3 8
-6 12 -8 -4
-13 -2
-12 -4 10 -2
-10 -13 3 13
-7 -10 -7 -4
-7 13
8 -12 7...

output:

-7.3353609 5.1107797
14.8068456 74.7866446
-8.9494236 9.2358648
-6.6920562 -6.8437093
9.6666748 1.0978740
12.9102654 15.6594317
16.6450821 -4.3134716
6.0340020 -7.8168282
-7.4490330 3.8943945
-11.0756616 7.0781451
13.1838885 -1.1642691
-10.9774080 15.5997241
7.4625455 3.8196364
8.0058303 8.2658343
7...

result:

ok 200000 numbers

Test #15:

score: 0
Accepted
time: 261ms
memory: 14252kb

input:

100000
-10 13 0 3
14 13 11 -3
7 4 -1 -8
-13 9
-7 1 -8 -8
-6 -12 -14 11
10 12 -13 -2
-8 14
7 6 6 -11
-12 -11 -9 4
-12 12 -12 1
10 -6
-14 4 -5 -14
14 -12 -3 11
2 11 -8 1
10 1
-4 -14 -4 -4
-6 -2 -4 14
0 -5 -6 -2
3 1
-4 12 -6 1
12 2 9 5
-13 -6 -14 4
-6 8
-2 2 -1 -10
14 -9 -5 0
4 -14 -3 -7
-8 -10
0 13 10...

output:

-1.1879201 3.4559804
-13.7593384 -4.6336361
-3.4601916 4.1802261
-4.7261092 5.7999717
-4.2721636 -0.9043838
-7.7295183 0.0120557
-1.5277358 -8.3034751
9.0169261 -7.5263321
-3.7441287 -8.7251397
-4.7714179 -0.2202367
-5.7494842 -11.9002113
1.4502372 -5.3572629
-8.6318939 -1.5704007
0.5274620 -5.51679...

result:

ok 200000 numbers

Test #16:

score: 0
Accepted
time: 253ms
memory: 14188kb

input:

100000
14 -14 -7 -15
-10 -2 -5 -5
-9 12 15 -12
-1 14
-8 -9 15 -9
-13 6 7 9
12 10 9 1
6 -11
-11 9 -6 2
-3 11 -8 3
10 -2 -8 -13
-11 -13
-9 -12 14 2
0 1 4 -3
5 10 14 3
5 7
11 -10 0 -11
6 4 11 -2
-1 -4 4 -12
6 -7
1 -3 -2 -7
12 -11 -6 8
15 -1 12 -1
-10 9
-10 -6 4 4
11 13 14 -11
-10 12 -10 11
-12 -7
14 6 ...

output:

4.4286580 -18.1269915
10.4196136 -2.0472254
-3.2637081 -0.6659638
13.8345577 3.1765047
0.8113017 -12.9620331
0.7172832 -3.8431118
3.4354806 3.5218760
-1.9419677 14.5766595
-14.9482809 10.9014010
-4.2443226 -3.0725242
-6.3623990 9.1186120
5.8018922 15.8124365
2.8857540 2.8186174
9.5865460 0.5106563
-...

result:

ok 200000 numbers

Test #17:

score: 0
Accepted
time: 250ms
memory: 14144kb

input:

100000
9 5 -15 2
-2 -11 5 6
-13 -10 15 -1
-9 6
16 -7 -12 -4
13 -9 -12 -10
-16 -10 -11 13
16 -14
-15 -11 -2 -1
-14 2 -1 -2
-15 5 -7 6
10 3
-12 -6 -14 3
-16 1 9 13
-7 -6 -8 -3
-16 3
5 8 9 6
-15 10 -4 -14
7 -13 -3 -9
-8 11
11 -5 -8 -3
-8 15 -3 14
3 -8 10 11
4 -9
-7 11 -14 11
16 -7 11 -15
12 14 14 -7
2 ...

output:

-0.9827294 -15.5018449
-3.6651982 -3.7802956
-2.3278657 -1.0479884
11.3026779 7.1549195
-4.9091484 -16.2735437
9.0089454 8.2587802
4.0698242 -13.3801257
4.9627573 -9.5100749
-2.9673144 -8.4075650
-7.5857048 -1.9559067
-4.2958399 -11.3389202
7.1914171 4.4385549
28.1031204 -18.4480386
-4.0256375 6.872...

result:

ok 200000 numbers

Test #18:

score: 0
Accepted
time: 256ms
memory: 16240kb

input:

100000
1 12 -13 4
6 -2 -14 -2
14 -2 2 -9
-9 4
14 -16 7 16
16 -4 11 5
13 -16 -2 -16
-10 -6
14 -15 -17 -15
-11 17 -9 3
-4 -13 -1 1
4 -14
9 -11 -16 8
-2 -11 -10 9
-9 -13 13 12
1 17
17 13 10 13
14 -13 6 4
3 15 14 12
10 -13
2 -8 -5 -14
-5 9 9 2
1 -10 -3 -11
-2 8
7 -8 -1 -15
15 5 10 4
-14 4 6 6
-2 3
1 -12...

output:

-15.1006277 3.5738688
10.4612746 4.5186550
8.4175687 -6.2705565
-17.9074378 3.2326537
7.0606990 2.1184129
10.4833408 4.0233085
5.8751376 4.1564600
11.9167475 10.8983117
-14.8224296 4.3018175
3.7885735 -5.4427000
6.6472855 5.1338705
1.2161857 13.2799247
42.8458550 -38.2431844
-7.1103608 6.2601040
10....

result:

ok 200000 numbers

Test #19:

score: 0
Accepted
time: 253ms
memory: 14204kb

input:

100000
15 6 5 12
-6 -6 -4 -12
-7 8 4 3
-11 -5
-1 10 -2 -2
3 -2 -4 14
-17 13 -12 -2
10 0
-6 -16 -13 -5
0 4 9 -13
11 16 -10 -8
-1 0
-9 13 -12 -4
12 -18 -7 8
-6 11 -8 -3
-16 0
11 5 15 10
14 -9 13 -18
-13 -14 5 -4
-15 13
8 -18 -17 16
-3 1 3 -11
11 17 14 15
0 11
15 -8 14 11
-8 12 -14 18
4 12 11 7
-16 3
-...

output:

-3.3062037 -2.9154176
-5.4102633 8.0903132
-13.0367305 6.6437188
0.9676842 29.4671563
4.3154805 0.2558764
14.4304471 2.6699293
16.5749483 18.6163255
-4.4343304 11.1478797
-1.5485290 10.4218898
0.7086918 -8.6717414
0.7730240 8.4028899
-18.9810816 8.1631130
-11.6155686 1.9799233
6.8642701 -7.5259715
1...

result:

ok 200000 numbers

Test #20:

score: 0
Accepted
time: 255ms
memory: 14208kb

input:

100000
-11 -2 12 -10
-7 -13 2 -5
-15 -6 -14 -16
12 -2
3 1 6 -16
-1 -5 -14 -18
0 3 -7 -14
-7 17
16 17 -10 13
-3 18 -18 5
-15 1 -16 12
19 0
-15 -18 13 -9
-5 3 -14 9
-6 9 10 15
-4 14
10 -19 -9 14
-13 6 -12 -15
10 2 -6 7
16 -1
14 12 -15 11
-2 -17 11 0
18 16 -17 -13
-6 4
-16 -18 3 -5
15 -10 -12 -1
-18 -1...

output:

3.6988733 -7.6935396
-12.2048481 -12.0987462
-12.9611170 13.9207041
11.8525024 7.5362807
-7.6968750 8.5091246
6.7980573 1.4326909
-11.9046248 -2.0377106
-28.2533143 -5.5334767
-8.1299819 14.7049661
-15.1662632 -8.0219166
-54.0203429 15.0455244
-10.8420896 -16.8986486
2.4329384 -15.6097206
25.7346168...

result:

ok 200000 numbers

Test #21:

score: 0
Accepted
time: 255ms
memory: 14132kb

input:

100000
9 -1 10 -3
-12 3 10 -10
-7 20 -5 -20
-5 -3
-12 8 7 0
-8 15 0 -4
-6 -3 -11 8
4 11
16 6 3 -12
20 -14 11 -5
-6 10 17 2
-4 -13
8 14 -14 -13
10 4 4 -9
4 -2 -6 -16
-11 1
1 -1 13 9
0 15 -6 3
16 -2 12 8
11 -14
1 -11 -4 16
-20 1 -12 10
16 -13 2 -18
-7 17
-18 3 -4 15
-17 8 4 -11
2 -16 -16 17
-18 10
12 ...

output:

10.2988255 -6.9529229
-5.1128470 -2.0828133
14.1856977 -3.2369030
-9.0688105 -16.0652329
11.9089257 8.5881490
-15.2195702 9.7605765
-40.2087951 -89.0965320
4.7263679 -18.5697078
-9.0985182 -4.3111484
7.6594499 1.9955509
-5.3312715 11.4619696
1.7344974 -3.2148883
-3.0417404 17.6215410
-14.0179257 -5....

result:

ok 200000 numbers

Test #22:

score: 0
Accepted
time: 259ms
memory: 16280kb

input:

100000
-13 -26 -29 14
28 -9 -14 3
-25 1 -19 30
2 14
-13 -6 5 5
-8 11 -29 28
22 -9 -7 16
-23 20
30 19 2 -10
-2 15 0 -9
1 4 -16 -4
10 1
-7 -27 -23 -6
-18 -9 -2 -24
-3 30 23 28
-7 -8
25 9 3 -22
-8 -26 0 14
-19 -23 29 6
12 29
-7 17 -4 -16
-4 14 24 -25
-13 -22 -24 -16
22 11
-4 -18 17 11
-3 -21 -16 -30
21...

output:

-6.8010534 15.4866789
-3.1229967 31.5103112
3.7008408 -12.2986573
-25.8479711 -48.9352008
6.9500777 -23.0667380
-25.6726840 -9.1977373
-28.2307499 -2.7584798
13.5954738 -5.6295044
27.7920834 18.7959608
44.0508944 -27.9031399
21.4624254 5.0726444
4.1242904 10.8055564
-23.7097526 25.9005311
-28.973724...

result:

ok 200000 numbers

Test #23:

score: 0
Accepted
time: 259ms
memory: 16368kb

input:

100000
37 12 -7 8
-26 -32 -10 10
37 -35 -33 30
-8 -4
-16 -19 -35 30
40 37 -3 -17
-12 -15 -4 14
26 4
19 13 -3 38
33 -2 0 -40
19 31 12 -20
10 -10
17 -7 -34 -3
-25 34 -15 10
15 37 -38 38
14 7
-29 -7 -24 11
-26 19 -20 38
-19 -34 -6 6
34 36
-29 31 17 -38
-6 -32 -24 34
-31 -14 21 -8
9 -23
10 3 -33 14
-23 ...

output:

-9.5456692 8.8398722
-3.6145529 -14.2896593
15.6940169 -44.2333001
-39.8053929 -11.4441562
2.9208650 26.5810865
-47.8843003 -14.7628374
17.8630907 19.0181541
-22.0554016 13.3422839
-2.8329510 -19.9087163
-17.4029269 -32.8755119
-42.4390842 159.9625510
38.0886265 -0.9539995
1.5462802 20.1242174
46.40...

result:

ok 200000 numbers

Test #24:

score: 0
Accepted
time: 251ms
memory: 16168kb

input:

100000
-32 -37 -23 -22
43 34 -4 41
-50 -18 30 41
43 47
-39 -20 49 -5
-20 -35 9 18
-16 1 48 -39
-41 -7
-31 -34 49 -34
-27 39 -46 17
-1 -34 -39 -47
-49 6
-45 -3 -47 -3
-23 -44 46 29
40 -21 19 33
-9 -2
39 43 -4 22
-45 29 -7 -14
-41 38 -1 -38
-49 -20
28 -30 8 -11
43 -30 -30 -6
-8 30 22 19
13 -4
37 -15 -...

output:

-3.2436565 40.8478115
55.3831263 -15.5380495
-31.1052360 40.3393368
12.0488149 16.9285629
-4.9557193 7.7092386
29.2632428 10.1494710
-55.5973517 20.6988058
103.5621925 30.6098638
-1.8826497 -17.4892827
14.2366297 38.3991045
23.0167097 -38.6292911
23.8346185 16.1125222
36.9958782 -39.8327611
79.43950...

result:

ok 200000 numbers

Test #25:

score: 0
Accepted
time: 260ms
memory: 16372kb

input:

100000
22 -47 -50 24
-39 -52 -47 -34
-30 -15 -22 -12
-46 26
-5 -60 -25 -32
-48 -29 -1 10
30 15 -12 -37
44 -19
-28 3 -17 42
-39 -21 -56 22
15 36 30 53
-49 40
-44 -43 13 18
-43 -48 49 -47
-14 -9 -59 -53
-10 24
-17 59 29 -50
-34 -27 9 -50
57 54 21 31
6 -37
-44 22 -37 -11
47 9 -44 -39
28 50 47 16
40 23
...

output:

-34.2132439 -5.7823189
-15.5863006 -36.7995557
-3.6438924 81.5467128
-52.4711157 -53.0589483
2.1449399 -50.4644189
-34.2439614 -50.8099036
-41.9991252 -47.0001783
-38.5963920 46.3920269
-16.1832286 0.9361771
20.1882456 30.1414274
24.0719629 0.8028260
8.3330806 19.2235212
-13.5703556 -34.7620161
6.73...

result:

ok 200000 numbers

Test #26:

score: 0
Accepted
time: 260ms
memory: 14340kb

input:

100000
43 -29 -20 -44
27 -41 -50 52
42 24 -22 12
60 -42
15 60 25 -40
7 -67 44 65
59 59 -37 10
-59 46
-60 -13 -63 -67
16 -20 -68 -28
-58 39 -21 19
-38 -42
20 -45 -33 17
60 -36 62 -67
-11 -63 -12 -17
-24 55
14 38 -5 -15
61 34 -45 36
5 -54 -66 50
1 7
59 15 42 -56
-47 4 13 56
54 -38 62 -41
-27 -3
15 -28...

output:

8.0324157 14.3686985
111.9630396 29.3910423
-65.7219930 -42.7512840
-11.2725220 -43.5692584
-78.2486740 88.7938790
65.6274230 144.6077608
13.6864286 -47.2868122
-95.7145446 -25.8238254
-85.1978592 -76.4080631
-24.2420765 40.3078990
-45.0156252 3.1984190
-111.5900382 -16.6231503
47.7150418 53.0875970...

result:

ok 200000 numbers

Test #27:

score: 0
Accepted
time: 260ms
memory: 16240kb

input:

100000
-62 -2 80 21
8 -52 -41 -9
-23 18 59 -36
80 64
45 65 -5 -60
-34 -15 -60 -22
9 -10 42 53
5 71
59 7 11 37
-58 12 35 -15
-45 -63 58 -80
62 -27
36 65 61 -38
73 -64 13 79
-9 -24 -71 -30
59 52
59 -16 -29 -75
-17 21 32 60
-51 36 22 -69
66 -63
56 -75 -75 70
-34 -13 -55 8
-11 -24 -70 5
-19 -73
22 -47 5...

output:

20.1424860 -154.5150754
-16.3678949 -67.4062102
-0.0395884 58.9641894
81.9590845 -24.7956541
-23.8172566 -80.2286431
-65.5531510 31.2150010
-35.0545911 -14.9018946
76.9426032 39.1894859
433.5283831 107.7863566
5.5456769 60.8640655
25.2441881 -60.5606584
61.0621945 -122.4434967
-12.1259311 4.6947948
...

result:

ok 200000 numbers

Test #28:

score: 0
Accepted
time: 261ms
memory: 16144kb

input:

100000
-88 -48 -22 59
-77 74 -11 44
-88 -47 -90 -14
81 -79
57 23 -90 -55
18 61 -34 54
76 68 -37 33
-82 11
-5 37 -27 -86
-71 -53 74 15
-21 47 74 -83
-46 12
-30 -58 6 2
-28 2 -33 7
-22 -80 -84 -61
6 24
-19 -69 -87 34
54 82 66 48
-39 -63 -41 -29
-25 -89
47 47 16 21
88 -39 41 -24
86 -31 -69 -15
-67 47
-...

output:

-10.9913036 44.1907824
-17.6718973 47.9601837
64.3045699 -11.2742341
-37.3204880 7.5076473
-32.9484783 34.3500739
18.3902859 20.1873851
13.4336403 -87.9002071
61.2977418 -58.1231337
-74.5295960 3.8709421
-53.0573955 54.1815408
-87.7648428 -16.7024860
-57.9317315 9.2618120
55.9057057 54.9553462
-16.2...

result:

ok 200000 numbers

Test #29:

score: 0
Accepted
time: 266ms
memory: 16420kb

input:

100000
53 7 91 -58
86 -8 -4 -97
4 45 -61 82
-84 57
87 -48 -23 92
98 27 19 18
-51 -65 -76 -61
-64 -43
-42 42 -29 -59
-82 29 94 68
90 -79 22 -82
-54 -8
69 -61 -7 -64
25 26 -17 -18
35 48 15 -36
41 91
-85 7 -29 27
95 6 32 -85
88 44 75 -83
67 55
81 27 5 -26
2 -9 67 71
-12 88 -47 35
45 -95
8 45 15 -20
57 ...

output:

-69.7497762 10.2951182
-59.2466139 -64.0947582
19.0464314 -138.3947304
17.1089082 -57.8832581
89.5603827 -52.9025632
23.0494974 22.1095874
23.2426667 -23.8759873
15.9345242 31.5133322
-73.6976892 -2.9864125
62.5243450 -24.1006486
-12.7502004 42.1979412
-94.1420683 177.1959773
137.2917584 -96.4374567...

result:

ok 200000 numbers