QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#402241#4370. Road Times321625AC ✓957ms2192kbC++143.2kb2024-04-30 09:46:382024-04-30 09:46:38

Judging History

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

  • [2024-04-30 09:46:38]
  • 评测
  • 测评结果:AC
  • 用时:957ms
  • 内存:2192kb
  • [2024-04-30 09:46:38]
  • 提交

answer

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
typedef double ld;
const ld eps=1e-5,Eps=1e-8;
namespace simplex
{
const int N=107,M=307;
inline int sgn(ld x){return (-eps<=x&&x<=eps)?0:(x>0?1:-1);}
int n,m;ld a[M][N],b[M][N];int id[N+M],pivcnt=0;
void pivot(int e,int l)
{
	++pivcnt;
//	printf(" pivot %d %d\n",e,l);
	std::swap(id[n+l],id[e]);
	ld kk=-a[l][e];a[l][e]=-1;
	for(int j=0;j<=n;++j)a[l][j]/=kk;
	for(int i=0;i<=m;++i)if(i!=l&&sgn(a[i][e]))
	{
		ld coef=a[i][e];a[i][e]=0;
		for(int k=0;k<=n;++k)a[i][k]+=coef*a[l][k];
	}
}
ld simplex(int _n,int _m)
{
//	puts("simplex");
	n=_n;m=_m;memcpy(a+1,b+1,m*sizeof*b);
	for(int i=1;i<=n+m;++i)id[i]=i;
	while(1)
	{
		int e=0,l=0;
		for(int i=1;i<=m;++i)if(sgn(a[i][0])<0&&(!l||a[i][0]<a[l][0]))l=i;
		if(!l)break;for(int i=1;i<=n;++i)if(sgn(a[l][i])>0&&id[i]>id[e])e=i;
//		if(!e)puts("invalid"),exit(0);
		pivot(e,l);
	}
//	puts("simplexa");
	while(1)
	{
		int e=0,l=0;
		for(int i=1;i<=n;++i)if(sgn(a[0][i])>0&&(!e||a[0][e]<a[0][i]))e=i;
		if(!e)return **a;
		for(int i=1;i<=m;++i)
			if(sgn(a[i][e])<0)
			{
				if(!l){l=i;continue;}
				ld crs=a[l][0]*a[i][e]-a[i][0]*a[l][e];
				if(sgn(crs)<0||(!sgn(crs)&&id[i]>id[l]))l=i;
			}
//		if(!l)puts("unbounded"),exit(0);
		pivot(e,l);
	}
	exit(0);
}
}
const int N=37,M=107;
struct pii{int v,w;};bool vis[N];int d[N][N];
bool operator<(pii x,pii y){return x.w>y.w;}
void dijkstra(int s,int n,int*dis,int*pre)
{
	memset(dis,0x3f,N<<2);memset(vis,0,N);
	dis[s]=pre[s]=0;//printf("s=%d\n",s);
	while(1)
	{
	    int p=0;for(int i=1;i<=n;++i)if(!vis[i]&&(!p||dis[i]<dis[p]))p=i;
	    if(!p)return;vis[p]=1;for(int j=1;j<=n;++j)if(dis[j]>dis[p]+d[p][j])dis[j]=dis[p]+d[p][j],pre[j]=p;//,printf("pr[%d]=%d\n",j,pre[j]);
	}
}
int id[N][N],pre[N][N],dis[N][N];
int ds[M];
int main()
{
//	freopen("39-random20.in","r",stdin);
//	freopen("38-random19.in","r",stdin);
	int n,m=0;scanf("%d",&n);
	for(int i=1;i<=n;++i)for(int j=1;j<=n;++j)
	{
		scanf("%d",d[i]+j);
		if(i!=j&&d[i][j]!=-1)ds[id[i][j]=++m]=d[i][j];
		else if(d[i][j]==-1)d[i][j]=0x3f3f3f3f;
	}
	for(int i=1;i<=n;++i)dijkstra(i,n,dis[i],pre[i]);
	for(int i=1;i<=m;++i)
	{
		simplex::b[i][0]=ds[i];
		simplex::b[i][i]=-1;
	}
	int ma,mb;scanf("%d",&ma);
	for(int i=1;i<=ma;++i)
	{
		int s,t,d;scanf("%d%d%d",&s,&t,&d);
		++s;++t;d-=dis[s][t];
		simplex::b[m+i+i-1][0]=d+Eps;
		simplex::b[m+i+i][0]=-d+Eps;
		for(int j=t;j!=s;j=pre[s][j])
		{
			int p=pre[s][j],ii=id[p][j];
//			printf("p=%d ii=%d\n",p,ii);
			simplex::b[m+i+i-1][ii]=-1;
			simplex::b[m+i+i][ii]=1;
		}
	}
	scanf("%d",&mb);
	for(int i=1;i<=mb;++i)
	{
		int s,t;scanf("%d%d",&s,&t);++s;++t;
		for(int j=0;j<=m;++j)simplex::a[0][j]=0;
		for(int j=t;j!=s;j=pre[s][j])
		{
			int p=pre[s][j],ii=id[p][j];
			simplex::a[0][ii]=-1;
		}
		ld mn=-simplex::simplex(m,m+ma*2)+dis[s][t];
		for(int j=0;j<=m;++j)simplex::a[0][j]=0;
		for(int j=t;j!=s;j=pre[s][j])
		{
			int p=pre[s][j],ii=id[p][j];
			simplex::a[0][ii]=1;
		}
		ld mx=simplex::simplex(m,m+ma*2)+dis[s][t];
		printf("%d %d %.8lf %.8lf\n",s-1,t-1,mn,mx);
	}
//	printf("pivcnt=%d mb=%d\n",simplex::pivcnt,mb*2);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
0 50 -1
55 0 40
-1 40 0
1
0 2 120
3
0 1
1 2
1 0

output:

0 1 50.00000000 80.00000001
1 2 40.00000000 70.00000001
1 0 55.00000000 110.00000000

result:

ok 12 numbers

Test #2:

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

input:

3
0 50 -1
55 0 40
-1 40 0
1
0 2 90
3
0 1
1 2
1 0

output:

0 1 50.00000000 50.00000001
1 2 40.00000000 40.00000001
1 0 55.00000000 110.00000000

result:

ok 12 numbers

Test #3:

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

input:

3
0 50 -1
55 0 40
-1 40 0
1
0 2 180
3
0 1
1 2
1 0

output:

0 1 99.99999999 100.00000000
1 2 79.99999999 80.00000000
1 0 55.00000000 110.00000000

result:

ok 12 numbers

Test #4:

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

input:

6
0 960 -1 -1 -1 -1
-1 0 -1 -1 1000 -1
-1 1000 0 -1 -1 -1
-1 -1 -1 0 -1 -1
-1 -1 -1 1000 0 970
-1 -1 -1 -1 -1 0
3
0 3 5900
2 3 5800
2 5 5700
6
0 1
2 1
1 4
4 3
4 5
0 5

output:

0 1 1899.99999999 1920.00000000
2 1 1799.99999999 1820.00000002
1 4 1979.99999999 2000.00000000
4 3 1979.99999999 2000.00000000
4 5 1879.99999997 1900.00000002
0 5 5799.99999997 5800.00000003

result:

ok 24 numbers

Test #5:

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

input:

6
0 960 -1 -1 -1 -1
-1 0 -1 -1 1000 -1
-1 1000 0 -1 -1 -1
-1 -1 -1 0 -1 -1
-1 -1 -1 1000 0 940
-1 -1 -1 -1 -1 0
3
0 3 5900
2 3 5800
2 5 5700
6
0 1
2 1
1 4
4 3
4 5
0 5

output:

0 1 1919.99999997 1920.00000000
2 1 1819.99999999 1820.00000002
1 4 1999.99999997 2000.00000000
4 3 1979.99999999 1980.00000002
4 5 1879.99999997 1880.00000000
0 5 5799.99999997 5800.00000000

result:

ok 24 numbers

Test #6:

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

input:

6
0 950 -1 -1 -1 -1
-1 0 -1 -1 1000 -1
-1 1000 0 -1 -1 -1
-1 -1 -1 0 -1 -1
-1 -1 -1 1000 0 970
-1 -1 -1 -1 -1 0
3
0 3 5900
2 3 5800
2 5 5700
6
0 1
2 1
1 4
4 3
4 5
0 5

output:

0 1 1899.99999999 1900.00000000
2 1 1799.99999999 1800.00000002
1 4 1999.99999999 2000.00000000
4 3 1999.99999999 2000.00000000
4 5 1899.99999997 1900.00000002
0 5 5799.99999997 5800.00000002

result:

ok 24 numbers

Test #7:

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

input:

10
0 123 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 234 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 345 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 456 -1 -1 -1 -1 -1
-1 -1 -1 -1 0 567 -1 -1 -1 -1
-1 -1 -1 -1 -1 0 678 -1 -1 -1
-1 -1 -1 -1 -1 -1 0 890 -1 -1
-1 -1 -1 -1 -1 -1 -1 0 901 -1
-1 -1 -1 -1 -1 -1 -1 -1 0 555
666 -1 -1 -1 -1 -1 -1 -1 -1...

output:

0 0 0.00000000 0.00000000
0 1 215.99999995 246.00000000
0 2 449.99999995 714.00000000
0 3 1083.99999997 1114.00000002
0 4 1539.99999997 1570.00000002
0 5 2673.99999997 2704.00000002
0 6 3407.99999996 3438.00000001
0 7 4297.99999996 4358.00000006
0 8 5198.99999996 5542.00000003
0 9 5753.99999996 6097...

result:

ok 400 numbers

Test #8:

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

input:

10
0 123 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 234 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 345 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 456 -1 -1 -1 -1 -1
-1 -1 -1 -1 0 567 -1 -1 -1 -1
-1 -1 -1 -1 -1 0 678 -1 -1 -1
-1 -1 -1 -1 -1 -1 0 890 -1 -1
-1 -1 -1 -1 -1 -1 -1 0 901 -1
-1 -1 -1 -1 -1 -1 -1 -1 0 555
666 -1 -1 -1 -1 -1 -1 -1 -1...

output:

0 0 0.00000000 0.00000000
0 1 215.99999995 246.00000000
0 2 579.99999995 640.00000007
0 3 1083.99999997 1114.00000002
0 4 1539.99999997 1570.00000002
0 5 2673.99999997 2704.00000002
0 6 3407.99999996 3438.00000001
0 7 4297.99999996 4358.00000006
0 8 5198.99999996 5542.00000003
0 9 5753.99999996 6097...

result:

ok 400 numbers

Test #9:

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

input:

10
0 123 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 234 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 345 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 456 -1 -1 -1 -1 -1
-1 -1 -1 -1 0 567 -1 -1 -1 -1
-1 -1 -1 -1 -1 0 678 -1 -1 -1
-1 -1 -1 -1 -1 -1 0 890 -1 -1
-1 -1 -1 -1 -1 -1 -1 0 901 -1
-1 -1 -1 -1 -1 -1 -1 -1 0 555
666 -1 -1 -1 -1 -1 -1 -1 -1...

output:

0 0 0.00000000 0.00000000
0 1 244.99999996 246.00000000
0 2 608.99999996 640.00000007
0 3 1083.99999997 1114.00000002
0 4 1568.99999998 1570.00000002
0 5 2702.99999998 2704.00000002
0 6 3436.99999997 3438.00000001
0 7 4326.99999997 4358.00000006
0 8 5227.99999997 5541.00000001
0 9 5782.99999997 6097...

result:

ok 400 numbers

Test #10:

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

input:

3
0 10 -1
-1 0 10
10 -1 0
3
0 2 21
1 0 21
2 1 21
3
0 1
1 2
2 0

output:

0 1 10.49999999 10.50000001
1 2 10.49999999 10.50000001
2 0 10.49999999 10.50000001

result:

ok 12 numbers

Test #11:

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

input:

8
0 10 -1 -1 -1 -1 -1 -1
-1 0 10 -1 -1 -1 -1 -1
-1 -1 0 10 -1 -1 -1 -1
-1 -1 -1 0 10 -1 -1 -1
-1 -1 -1 -1 0 10 -1 -1
-1 -1 -1 -1 -1 0 10 -1
-1 -1 -1 -1 -1 -1 0 10
10 -1 -1 -1 -1 -1 -1 0
8
0 7 71
1 0 71
2 1 71
3 2 71
4 3 71
5 4 71
6 5 71
7 6 71
8
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 0

output:

0 1 10.14285712 10.14285716
1 2 10.14285712 10.14285716
2 3 10.14285712 10.14285716
3 4 10.14285712 10.14285716
4 5 10.14285712 10.14285716
5 6 10.14285712 10.14285716
6 7 10.14285712 10.14285716
7 0 10.14285712 10.14285716

result:

ok 32 numbers

Test #12:

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

input:

7
0 10 -1 -1 -1 -1 -1
-1 0 10 -1 -1 -1 -1
-1 -1 0 10 -1 -1 -1
-1 -1 -1 0 10 -1 -1
-1 -1 -1 -1 0 10 -1
-1 -1 -1 -1 -1 0 10
10 -1 -1 -1 -1 -1 0
6
0 4 41
1 5 41
2 6 41
3 0 41
5 2 41
6 3 41
7
0 1
1 2
2 3
3 4
4 5
5 6
6 0

output:

0 1 10.00000000 11.00000005
1 2 9.99999996 10.33333336
2 3 9.99999998 10.33333336
3 4 9.99999996 10.33333336
4 5 10.00000000 11.00000005
5 6 10.00000000 10.33333336
6 0 10.00000000 10.33333336

result:

ok 28 numbers

Test #13:

score: 0
Accepted
time: 8ms
memory: 1812kb

input:

30
0 392 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 793 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 750 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
703 -1 -1 0 -1 -1 -1 -1 -1 ...

output:

1 10 793.17241377 793.17241381
10 16 726.17241377 726.17241381
16 29 367.17241377 367.17241381
29 15 812.17241377 812.17241381
15 24 959.17241377 959.17241381
24 2 826.17241377 826.17241381
2 7 750.17241377 750.17241381
7 18 865.17241377 865.17241381
18 13 492.17241377 492.17241381
13 12 865.1724137...

result:

ok 400 numbers

Test #14:

score: 0
Accepted
time: 7ms
memory: 1752kb

input:

30
0 392 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 793 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 750 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
703 -1 -1 0 -1 -1 -1 -1 -1 ...

output:

1 10 793.00000000 793.17857145
10 16 726.00000000 726.17857145
16 29 367.00000000 367.17857145
29 15 811.99999998 812.17857145
15 24 958.99999998 959.17857145
24 2 825.99999998 826.17857145
2 7 750.00000000 750.17857145
7 18 865.00000000 865.17857145
18 13 491.99999998 492.17857145
13 12 865.0000000...

result:

ok 400 numbers

Test #15:

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

input:

1
0
100
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 ...

output:

0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000 0.00000000
0 0 0.00000000...

result:

ok 400 numbers

Test #16:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -...

output:

0 0 0.00000000 0.00000000
1 1 0.00000000 0.00000000
2 2 0.00000000 0.00000000
3 3 0.00000000 0.00000000
4 4 0.00000000 0.00000000
5 5 0.00000000 0.00000000
6 6 0.00000000 0.00000000
7 7 0.00000000 0.00000000
8 8 0.00000000 0.00000000
9 9 0.00000000 0.00000000
10 10 0.00000000 0.00000000
11 11 0.0000...

result:

ok 400 numbers

Test #17:

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

input:

30
0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1000 0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 1000 0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 1000 0 1000 -1...

output:

0 29 57999.99999999 58000.00000000
6 11 9999.99999999 10000.00000000
7 16 17999.99999999 18000.00000000
26 6 20000.00000000 40000.00000000
3 12 17999.99999999 18000.00000000
6 25 37999.99999999 38000.00000000
17 0 17000.00000000 34000.00000000
25 27 3999.99999999 4000.00000000
22 2 20000.00000000 40...

result:

ok 400 numbers

Test #18:

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

input:

30
0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1000 0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 1000 0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 1000 0 1000 -1...

output:

0 29 29000.00000000 29000.00000001
6 11 5000.00000000 5000.00000001
7 16 9000.00000000 9000.00000001
26 6 20000.00000000 40000.00000000
3 12 9000.00000000 9000.00000001
6 25 19000.00000000 19000.00000001
17 0 17000.00000000 34000.00000000
25 27 2000.00000000 2000.00000001
22 2 20000.00000000 40000.0...

result:

ok 400 numbers

Test #19:

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

input:

30
0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
1000 0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 1000 0 1000 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 1000 0 1000 -1...

output:

0 29 29000.00000000 29000.00000001
6 11 5000.00000000 5000.00000001
7 16 9000.00000000 9000.00000001
26 6 39999.99999999 40000.00000000
3 12 9000.00000000 9000.00000001
6 25 19000.00000000 19000.00000001
17 0 33999.99999999 34000.00000000
25 27 2000.00000000 2000.00000001
22 2 39999.99999999 40000.0...

result:

ok 400 numbers

Test #20:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 298 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 342 -1 -1 -1 -1 -1 -1 -1 -1 533 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 236 -1 -1 -1 -1 -1 -1 477 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1...

output:

8 29 1291.99999998 1310.00000002
14 4 1362.99999998 2642.00000000
14 7 1015.99999998 1948.00000000
21 28 236.00000000 472.00000000
0 20 2017.99999999 3428.00000001
2 1 5564.99999998 5896.00000004
9 26 5768.99999998 6091.00000001
4 20 1551.00000000 3102.00000000
10 6 498.00000000 996.00000000
24 19 2...

result:

ok 400 numbers

Test #21:

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

input:

30
0 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1
-1 -1 0 -1 -1 -1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 2 -...

output:

13 10 5.00000000 5.00000003
13 26 7.00000000 8.00000002
7 8 10.99999999 16.00000004
26 4 8.99999998 12.00000004
8 27 7.99999999 10.00000001
25 11 3.00000000 5.00000001
5 17 5.00000000 5.00000002
27 1 6.00000000 7.00000004
3 5 6.00000000 6.00000002
6 16 8.99999998 9.00000002
7 9 10.99999999 13.000000...

result:

ok 400 numbers

Test #22:

score: 0
Accepted
time: 22ms
memory: 1884kb

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 1...

output:

7 29 27.99999985 31.00000010
0 16 55.99999998 57.00000007
21 8 16.49999991 19.00000001
5 11 30.99999994 33.00000008
17 1 57.99999996 59.00000013
19 16 54.99999998 55.00000008
8 28 45.99999999 46.00000001
10 14 7.99999992 14.00000000
16 24 66.99999999 67.00000001
29 14 10.99999992 18.00000014
24 0 41...

result:

ok 400 numbers

Test #23:

score: 0
Accepted
time: 24ms
memory: 1844kb

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 19 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 170 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 352 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 176 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -...

output:

3 14 490.99999987 491.00000013
15 10 935.99999989 1226.00000011
8 28 599.99999995 600.00000005
16 5 700.99999997 701.00000006
11 2 1582.99999987 1880.00000018
17 21 799.99999991 800.00000014
18 4 1420.99999991 1847.00000009
27 7 647.99999994 745.00000006
14 16 2941.99999999 2942.00000001
17 13 2254....

result:

ok 400 numbers

Test #24:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 884 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 15 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 171 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 861 -1 -...

output:

2 27 4032.99999995 4033.00000007
17 16 6951.99999994 7034.00000004
2 20 1800.99999996 1801.00000004
5 19 2701.99999990 2702.00000012
20 23 5325.99999995 5326.00000005
11 0 5381.99999994 5382.00000004
9 22 5816.99999993 5974.00000004
8 9 7183.99999991 7314.00000009
26 16 7846.99999995 8792.00000007
2...

result:

ok 400 numbers

Test #25:

score: 0
Accepted
time: 236ms
memory: 2048kb

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 10 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 1...

output:

24 3 50.99999990 51.00000042
10 4 54.99999999 55.00000001
24 3 50.99999990 51.00000042
19 21 68.99999958 69.00000010
6 27 10.99999999 11.00000031
6 22 44.99999997 45.00000029
7 4 67.99999999 68.00000001
1 4 49.99999959 50.00000012
20 15 48.99999950 49.00000030
22 9 60.99999992 61.00000035
7 8 75.999...

result:

ok 400 numbers

Test #26:

score: 0
Accepted
time: 264ms
memory: 2096kb

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 130 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 523 -1 -1 72 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 513 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 2...

output:

5 4 3295.99999997 3296.00000016
6 17 527.99999982 528.00000015
4 15 3950.99999986 3951.00000013
1 10 1499.99999983 1500.00000010
15 25 3212.99999979 3213.00000018
1 16 82.99999927 83.00000031
19 14 5246.99999993 5247.00000032
28 22 3126.99999985 3127.00000034
25 26 1463.99999980 1464.00000027
27 14 ...

result:

ok 400 numbers

Test #27:

score: 0
Accepted
time: 189ms
memory: 2120kb

input:

30
0 10 -1 -1 -1 -1 825 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
986 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 889 -1 -1 -1 -1 -1 -1 -1 721 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 ...

output:

13 20 6818.99999988 6819.00000019
6 5 7002.99999993 7003.00000041
27 0 5366.99999984 5367.00000003
2 16 1306.99999984 1307.00000022
3 28 1964.99999989 1965.00000032
17 10 1441.99999999 1442.00000005
7 28 4091.99999997 4092.00000020
20 12 3445.99999980 3446.00000009
20 11 2953.99999974 2954.00000019
...

result:

ok 400 numbers

Test #28:

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

input:

30
0 -1 -1 -1 -1 -1 -1 60 -1 -1 -1 -1 614 -1 31 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 146 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 778 -1 -1
118 96 0 -1 -1 232 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1...

output:

6 19 2253.00000000 4506.00000000
12 23 802.00000000 1091.00000001
17 28 2803.99999999 3609.00000001
22 7 595.00000000 1190.00000000
27 10 1225.00000000 1658.00000002
7 29 861.00000000 1722.00000000
5 0 875.00000000 1687.00000001
16 26 1676.00000000 3126.00000001
20 28 591.00000000 1182.00000000
0 21...

result:

ok 400 numbers

Test #29:

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

input:

30
0 -1 -1 -1 -1 -1 347 -1 -1 -1 -1 -1 864 -1 -1 357 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 201 -1 -1 -1 -1 -1 -1 469 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 260 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 219 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 180 -1 837 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 108 ...

output:

28 18 999.00000000 1974.00000001
21 29 932.99999999 1805.00000001
21 20 434.00000000 868.00000000
22 28 1914.99999998 3144.00000001
11 23 877.00000000 1754.00000000
25 13 1032.99999999 1110.00000001
11 8 405.00000000 810.00000000
23 19 968.00000000 1936.00000000
24 26 100.00000000 193.00000001
1 6 9...

result:

ok 400 numbers

Test #30:

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

input:

30
0 -1 -1 -1 -1 254 -1 -1 -1 -1 -1 -1 -1 -1 -1 185 -1 -1 -1 168 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 258 98 -1 -1 -1 -1 -1 -1 437 -1 -1 -1 166 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 347 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 221 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 43...

output:

22 22 0.00000000 0.00000000
9 16 25.00000000 47.00000001
25 5 526.00000000 1037.00000001
8 24 493.99999999 586.00000001
10 23 934.99999995 1405.00000003
13 20 410.99999999 411.00000001
7 11 792.00000000 1472.00000006
6 26 780.99999995 1233.00000003
29 7 355.99999999 672.00000000
28 12 353.00000000 7...

result:

ok 400 numbers

Test #31:

score: 0
Accepted
time: 10ms
memory: 1928kb

input:

30
0 -1 -1 -1 3 -1 2 -1 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 -1 5 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 10 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 5 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 8 -1 -1 -1
1 2 -1 0 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -...

output:

8 15 18.99999993 19.00000002
7 18 16.99999995 21.00000003
10 15 14.99999999 16.00000007
10 7 11.00000000 22.00000000
25 13 17.99999999 20.00000001
29 15 3.00000000 4.00000003
11 5 7.99999999 8.00000005
28 12 23.99999991 25.00000008
5 19 21.99999998 31.00000001
0 24 6.99999994 10.00000001
17 20 14.99...

result:

ok 400 numbers

Test #32:

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

input:

30
0 592 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 76 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 605
-1 0 -1 -1 -1 412 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 201 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 531 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
873 -1 -1 0 -1 -1 -1 -1 -...

output:

6 26 684.00000000 1368.00000000
12 25 2583.99999999 2584.00000001
17 23 1272.99999995 1307.00000005
13 2 912.99999998 947.00000002
8 16 499.99999996 572.00000004
25 19 2298.99999985 2299.00000015
14 4 1417.99999998 1418.00000002
23 17 3154.99999999 3155.00000001
4 9 737.99999997 738.00000003
29 25 2...

result:

ok 400 numbers

Test #33:

score: 0
Accepted
time: 279ms
memory: 2032kb

input:

30
0 -1 196 -1 -1 -1 229 -1 -1 -1 -1 -1 -1 -1 -1 457 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 499 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 -1 -1 534 -1 -1 808 -1 788 -1 324 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 475 -1 -1 -1 -1 -1 384 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 58 -1 0 -1 -1 -1 -...

output:

3 14 1087.99999996 1088.00000007
12 28 1071.99999978 1272.00000010
15 24 1975.99999999 1976.00000001
4 12 1024.99999986 1301.00000013
18 3 2081.99999997 2082.00000014
5 20 854.99999999 1236.00000000
2 6 993.99999979 1409.00000015
27 19 2923.99999994 2924.00000011
21 13 276.99999982 277.00000034
23 7...

result:

ok 400 numbers

Test #34:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 1 -1 -1 -1 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 1 1 -1 -1 1 -1 -1 -1 -1...

output:

15 4 4.00000000 7.00000003
18 19 2.99999997 3.00000002
26 26 0.00000000 0.00000000
18 17 4.99999997 5.00000006
2 19 5.99999997 6.00000003
10 2 3.99999998 4.00000001
16 21 2.99999998 3.00000007
23 28 1.00000000 2.00000000
24 14 4.00000000 4.00000001
4 25 4.99999999 5.00000001
20 29 2.00000000 4.00000...

result:

ok 400 numbers

Test #35:

score: 0
Accepted
time: 52ms
memory: 2140kb

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 1 2 -1 -1 2 1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 -1 2 -1 -1 -1 -1 -1 -1 1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...

output:

5 28 5.99999993 7.00000001
5 29 3.99999999 7.00000003
23 3 7.99999989 11.00000003
11 10 3.99999991 4.00000019
27 4 3.99999987 4.00000026
5 0 4.99999993 5.00000001
21 21 0.00000000 0.00000000
29 27 6.00000000 6.00000001
7 17 5.99999997 6.00000001
21 21 0.00000000 0.00000000
0 5 4.99999994 5.00000002
...

result:

ok 400 numbers

Test #36:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 3 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 1 3 -1 -1 -1 -1 -1 5 -1 -1 -1 3 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 5 -1 5 -1 -1 -1 -1...

output:

27 11 10.99999991 11.00000012
25 6 3.99999998 4.00000002
6 12 12.99999993 13.00000004
20 23 8.99999992 9.00000003
4 12 13.99999995 14.00000003
23 23 0.00000000 0.00000000
15 9 2.99999992 3.00000002
0 28 5.99999997 6.00000001
7 29 3.00000000 3.00000002
8 16 12.99999990 13.00000007
25 0 7.99999998 8.0...

result:

ok 400 numbers

Test #37:

score: 0
Accepted
time: 128ms
memory: 2192kb

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 7 -1 -1 3 -1 -1 -1 -1 -1 8
-1 0 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 8 -1 -1 -1 -1 -1 2 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 9 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 -1 4 -1 -1 -1 2 3 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -...

output:

19 24 12.99999993 15.00000013
22 2 7.99999999 8.00000016
20 4 11.99999996 12.00000028
9 27 3.99999995 4.00000003
21 6 9.99999999 11.00000003
13 17 6.99999995 7.00000016
28 9 2.99999998 3.00000006
16 13 15.99999993 16.00000010
9 4 7.99999999 8.00000001
4 24 9.99999989 12.00000013
5 28 10.99999994 11....

result:

ok 400 numbers

Test #38:

score: 0
Accepted
time: 281ms
memory: 2112kb

input:

30
0 -1 -1 -1 9 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 14 -1 7 9 -1 -1 -1 11 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 12 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 12 -1 -1 -1 -1 13 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 15 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 19 -1 5 3 -1 -1 -1 -1 -1 -1 -1
-1 12 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 ...

output:

10 17 17.99999992 18.00000032
3 4 49.99999999 50.00000001
28 8 39.99999999 47.00000026
20 23 34.99999993 50.00000019
0 9 27.00000000 47.00000013
10 20 46.99999999 74.00000001
26 3 8.99999991 9.00000013
21 2 28.99999984 29.00000006
1 18 36.99999989 37.00000002
15 26 48.99999990 49.00000006
21 27 35.9...

result:

ok 400 numbers

Test #39:

score: 0
Accepted
time: 855ms
memory: 2108kb

input:

30
0 -1 -1 -1 23 58 -1 17 -1 -1 51 -1 21 65 -1 -1 -1 28 -1 45 -1 -1 -1 -1 -1 18 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 35 -1 8 -1 -1 48 -1 -1 -1 -1 -1 -1 -1
15 33 0 8 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 35 46 -1 -1 -1 -1 9 -1 -1 -1 -1 14 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 59 67 -1 5...

output:

9 20 114.99999993 115.00000065
24 10 110.99999917 111.00000038
23 12 117.99999978 118.00000011
21 7 201.99999938 202.00000014
21 19 93.99999950 94.00000045
17 11 82.99999976 83.00000089
14 4 147.99999997 148.00000001
2 8 94.99999965 95.00000100
14 2 90.99999996 91.00000018
7 7 0.00000000 0.00000000
...

result:

ok 400 numbers

Test #40:

score: 0
Accepted
time: 642ms
memory: 2136kb

input:

30
0 -1 435 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 484 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 472
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 105 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 929 -1 -1 -1 -1 -1
673 377 0 -1 -1 -1 -1 -1 -1 -1 -1 66 -1 -1 -1 -1 -1 -1 327 -1 70 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1...

output:

1 25 1914.99999984 1915.00000727
21 18 945.99999510 1272.99999806
2 13 1924.99999034 1925.00000365
2 20 136.00000002 136.00000377
20 6 1900.00000020 1900.00000253
3 27 903.99999999 904.00000001
17 9 1269.00000004 1683.00000477
24 23 1152.99999756 1153.00000012
12 28 1434.99999743 1435.00000737
8 12 ...

result:

ok 400 numbers

Test #41:

score: 0
Accepted
time: 957ms
memory: 2116kb

input:

30
0 -1 -1 -1 755 -1 -1 -1 -1 -1 732 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 285 -1 -1 -1 -1 -1 767 -1
-1 0 -1 -1 -1 -1 -1 566 -1 -1 -1 103 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 552 -1 -1
-1 149 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 883
-1 -1 -1 0 -1 -1 -1 -...

output:

16 18 3730.00000020 3729.99999998
11 7 146.00000077 145.99999936
23 6 3924.99999987 3924.99999919
6 15 1842.99999839 1842.99999786
26 18 1712.00000054 1711.99999854
0 10 1206.00000441 1206.00000059
29 7 2563.00000367 2563.00000021
26 24 2103.99999989 2103.99999968
7 15 2268.00000487 2589.99999976
23...

result:

ok 400 numbers

Test #42:

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

input:

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

output:

14 8 56.99999995 57.00000001
9 17 7.99999995 9.00000010
24 3 24.99999996 26.00000007
15 25 18.99999999 19.00000001
11 29 23.99999981 26.00000012
10 2 20.99999999 22.00000018
17 9 2.99999997 4.00000000
3 26 8.99999996 10.00000009
10 13 35.99999992 37.00000009
25 4 21.99999995 22.00000003
22 28 2.9999...

result:

ok 400 numbers

Test #43:

score: 0
Accepted
time: 125ms
memory: 2040kb

input:

30
0 -1 -1 -1 3 -1 -1 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 1 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

9 1 6.49999976 7.50000007
12 0 24.49999996 25.50000016
6 28 25.49999996 31.00000002
29 3 9.49999990 10.00000001
5 28 48.99999992 54.50000006
19 2 21.99999984 23.00000021
16 25 22.49999995 22.50000005
9 12 15.49999992 16.00000003
22 4 7.99999987 9.00000002
19 20 35.99999998 36.50000005
3 7 46.9999999...

result:

ok 400 numbers

Test #44:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 7 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 7 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 3 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 8 -1 -...

output:

0 2 13.99999999 14.00000001
21 8 41.99999998 43.00000003
4 8 5.00000000 6.00000011
10 16 32.99999997 34.00000003
13 17 8.99999998 11.00000001
21 6 32.99999986 33.00000013
13 0 31.99999991 34.00000010
0 24 15.99999999 17.00000002
23 14 35.99999997 38.00000008
11 23 5.00000000 7.00000012
10 10 0.00000...

result:

ok 400 numbers

Test #45:

score: 0
Accepted
time: 95ms
memory: 2088kb

input:

30
0 9 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
2 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 -1 4 -1 -1 -1 -1 6
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1...

output:

17 13 41.49999992 44.33333343
5 3 18.99999999 20.00000003
9 13 21.99999999 24.33333339
15 18 22.33333328 22.50000005
0 5 33.33333324 35.50000008
9 26 23.33333322 23.50000010
6 29 38.99999990 40.66666673
4 8 20.49999993 20.66666674
5 16 33.99999995 35.00000003
19 1 22.99999997 23.66666678
5 12 39.999...

result:

ok 400 numbers

Test #46:

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

input:

30
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 6 -1 -1 -1 -1 -1 2 5 -1 -1 -1 4 -1 -1 -1 -1 -1 7 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 6 -1 -1 -1 -1 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 6 6 -1 -1 -1 4 -1 -...

output:

28 24 16.99999992 22.50000008
18 24 6.99999998 7.00000004
4 13 7.99999998 8.50000011
4 24 17.99999998 31.00000002
7 17 1.00000000 2.00000000
25 10 10.99999998 18.00000000
6 22 8.99999997 9.00000001
24 22 15.99999991 16.50000011
1 22 8.49999993 9.00000007
17 20 15.99999999 16.00000001
5 5 0.00000000 ...

result:

ok 400 numbers

Test #47:

score: 0
Accepted
time: 28ms
memory: 2100kb

input:

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

output:

2 6 4.00000000 8.00000000
10 19 8.99999999 9.00000002
4 15 17.99999998 20.00000003
24 2 8.00000000 15.00000002
7 20 13.99999999 15.00000003
2 19 6.99999999 7.00000001
9 10 11.99999994 18.50000004
25 27 11.99999999 12.00000001
20 6 14.99999995 20.00000001
25 28 14.99999997 16.00000001
22 14 18.999999...

result:

ok 400 numbers

Test #48:

score: 0
Accepted
time: 104ms
memory: 2112kb

input:

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

output:

14 8 1.99999993 3.00000001
29 14 6.99999999 10.00000001
11 27 11.99999999 12.00000001
0 24 13.99999999 18.00000001
12 28 1.00000000 2.00000000
28 25 9.99999988 11.00000006
3 29 11.99999990 13.00000018
9 18 5.00000000 7.00000005
16 9 6.99999999 7.00000001
10 7 12.99999994 17.00000008
17 8 17.99999999...

result:

ok 400 numbers

Test #49:

score: 0
Accepted
time: 42ms
memory: 2100kb

input:

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

output:

25 7 16.99999999 24.00000002
7 6 6.00000000 7.00000001
12 16 6.99999999 9.00000001
22 24 11.00000000 21.00000001
3 9 18.99999997 25.00000009
15 21 4.00000000 7.00000001
17 29 16.99999997 24.00000004
20 22 5.99999999 8.00000003
22 21 9.99999998 13.00000006
17 22 11.99999997 14.00000004
26 13 25.99999...

result:

ok 400 numbers

Test #50:

score: 0
Accepted
time: 25ms
memory: 2192kb

input:

30
0 -1 3 -1 -1 -1 -1 -1 5 -1 -1 -1 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 -1 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 1 -1 -1 -1 -1...

output:

5 4 10.00000000 14.66666677
12 26 17.99999997 26.00000001
7 17 14.99999999 15.00000001
27 19 8.99999999 12.66666674
4 29 5.99999993 10.00000009
28 28 0.00000000 0.00000000
18 8 7.99999999 8.66666673
21 19 9.99999998 15.00000003
5 2 10.99999999 17.00000003
13 17 15.99999999 16.00000001
6 25 12.999999...

result:

ok 400 numbers

Test #51:

score: 0
Accepted
time: 19ms
memory: 2104kb

input:

30
0 -1 -1 4 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 -1 -1 -1 -1
-1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 4 -1 6 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 9 -1 -1
-1 -1 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 3 3 -1 -1 -1 -1 5 -1 -1 -1 -1 8 -1 -1 -1
-1 -1 -1 0 -1 -1 -1 -1 3 -1 -1 -1 -1 -1 ...

output:

2 0 11.00000000 20.00000002
21 1 18.99999992 23.00000012
24 10 14.99999997 16.00000001
26 26 0.00000000 0.00000000
9 24 10.00000000 17.00000003
26 17 10.99999993 16.00000001
5 16 7.99999999 9.00000003
21 21 0.00000000 0.00000000
16 25 12.99999992 16.00000000
16 19 16.99999990 22.00000000
0 22 12.000...

result:

ok 400 numbers

Test #52:

score: 0
Accepted
time: 26ms
memory: 1928kb

input:

30
0 937 -1 -1 907 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 963 -1 -1 -1 -1 -1 -1
992 0 982 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 941 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 965 -1 -1 927 -1 -1 -1 -1 -1 -1 964 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 988 -1 -1 ...

output:

8 26 5146.99999995 6893.00000001
17 12 3140.99999993 5670.00000000
28 7 1941.00000000 3529.00000001
28 4 4528.99999996 4948.00000003
23 29 1860.00000000 3720.00000000
17 28 3298.99999998 5050.50000008
5 14 3415.99999998 5269.00000002
17 7 1877.00000000 3754.00000000
5 16 1930.00000000 3860.00000000
...

result:

ok 400 numbers

Test #53:

score: 0
Accepted
time: 18ms
memory: 1920kb

input:

30
0 482 -1 -1 -1 -1 -1 -1 -1 -1 -1 422 936 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 0 266 -1 -1 -1 533 -1 -1 -1 -1 -1 39 -1 -1 -1 -1 -1 -1 -1 -1 110 -1 -1 -1 -1 -1 -1 -1 -1
-1 284 0 672 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 183 -1 -1 -1
-1 -1 -1 0 593 -1 -1 ...

output:

29 6 780.99999998 1070.00000002
24 10 1404.99999997 1882.00000001
24 15 1467.00000000 2934.00000000
11 16 2462.99999997 2548.00000003
4 15 1506.99999994 1893.00000002
14 4 1061.99999998 1649.00000002
19 25 1236.99999998 1286.00000002
12 4 822.99999995 1387.00000004
0 27 1141.00000000 1844.00000003
2...

result:

ok 400 numbers

Test #54:

score: 0
Accepted
time: 10ms
memory: 1964kb

input:

30
0 811 -1 -1 -1 984 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 655 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
839 0 519 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 976 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 0 783 -1 -1 -1 -1 -1 612 -1 -1 -1 -1 -1 -1 -1 562 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 0 545 -1 -1 ...

output:

3 6 1570.00000000 3140.00000000
22 25 2444.00000000 4888.00000000
22 10 4023.99999998 7119.00000002
8 22 1567.00000000 3134.00000000
3 17 1904.00000000 3551.00000001
18 9 2453.00000000 4906.00000000
24 11 1804.00000000 3608.00000000
17 7 3051.99999999 3909.00000001
29 17 1236.00000000 2215.00000001
...

result:

ok 400 numbers