QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#631651#171. Longest Shortest Pathdongyc666AC ✓39ms6228kbC++141.9kb2024-10-12 09:26:552024-10-12 09:26:56

Judging History

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

  • [2024-10-12 09:26:56]
  • 评测
  • 测评结果:AC
  • 用时:39ms
  • 内存:6228kb
  • [2024-10-12 09:26:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
const int NR=5e3+10;
const int MR=1e5+10;
int n,m,s,t,P,ans1,ans2;
const int INF=1e18;

struct edge{
	int to,next,flow,cost;
}g[MR];
int tot=1,fte[NR];
void add(int x,int y,int z,int v){
	g[++tot]=(edge){y,fte[x],z,v};fte[x]=tot;
	g[++tot]=(edge){x,fte[y],0,-v};fte[y]=tot;
}

int h[NR],dis[NR],vis[NR],st[NR*NR],L,R;
bool SPFA(){
	memset(h,999999,sizeof(h));
	h[s]=0;st[L=R=1]=s;
	while(L<=R){
		int x=st[L];L++;vis[x]=0;
		for(int i=fte[x];i;i=g[i].next)
			if(g[i].flow&&h[g[i].to]>h[x]+g[i].cost){
				h[g[i].to]=h[x]+g[i].cost;
				if(!vis[g[i].to])st[++R]=g[i].to,vis[g[i].to]=1;
			}
	}
	return h[t]<INF;
}
struct point{
	int dis,id;
	bool operator <(const point &T)const{
		return dis>T.dis;
	}
};
priority_queue<point>q;
int nxt[NR],idx[NR];
bool dijkstra(){
	memset(dis,999999,sizeof(dis));
	memset(vis,0,sizeof(vis));
	dis[s]=0;q.push(point{0,s});
	while(!q.empty()){
		int x=q.top().id;q.pop();
		if(vis[x])continue;
		vis[x]=1;
		for(int i=fte[x];i;i=g[i].next)
			if(g[i].flow){
				int tmp=g[i].cost+h[x]-h[g[i].to];
				if(dis[g[i].to]>dis[x]+tmp){
					dis[g[i].to]=dis[x]+tmp;
					q.push(point{dis[g[i].to],g[i].to});
					idx[g[i].to]=i;nxt[g[i].to]=x;
				}
			}
	}
	return dis[t]<INF;
}
#define db double
db ans=1e18;
void Dinic(){
	SPFA();
	while(dijkstra()){
//	for(int i=1;i<=n;i++)printf("%lld ",nxt[i]);puts("");
		int minf=1e18;
		for(int i=t;i!=s;i=nxt[i])minf=min(minf,g[idx[i]].flow);
		ans1+=minf;ans2+=minf*(dis[t]+h[t]);
		ans=min(ans,1.0*(P+ans2)/ans1);
		for(int i=t;i!=s;i=nxt[i]){
			g[idx[i]].flow-=minf;
			g[idx[i]^1].flow+=minf;
		}
		for(int i=1;i<=n;i++)h[i]+=dis[i];
	}
}

signed main(){
	cin>>n>>m>>P>>s>>t;
	for(int i=1,x,y,z,w;i<=m;i++)
		scanf("%lld%lld%lld%lld",&x,&y,&z,&w),add(x,y,w,z);
	Dinic();
	printf("%.10lf\n",ans);
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 4036kb

input:

3 2 3 1 3
1 2 2 1
2 3 1 2

output:

6.0000000000

result:

ok found '6.0000000', expected '6.0000000', error '0.0000000'

Test #2:

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

input:

3 3 2 1 3
1 2 1 1
2 3 1 1
1 3 1 1

output:

2.5000000000

result:

ok found '2.5000000', expected '2.5000000', error '0.0000000'

Test #3:

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

input:

3 4 5 1 3
1 2 1 2
2 3 1 1
1 3 3 2
1 3 4 1

output:

4.2500000000

result:

ok found '4.2500000', expected '4.2500000', error '0.0000000'

Test #4:

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

input:

4 5 1 1 4
1 2 2 2
1 3 4 4
2 3 1 1
2 4 4 4
3 4 2 2

output:

6.0000000000

result:

ok found '6.0000000', expected '6.0000000', error '0.0000000'

Test #5:

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

input:

4 5 2 1 4
1 2 2 2
1 3 4 4
2 3 1 1
2 4 4 4
3 4 2 2

output:

6.3333333333

result:

ok found '6.3333333', expected '6.3333333', error '0.0000000'

Test #6:

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

input:

4 5 5 1 4
1 2 2 2
1 3 4 4
2 3 1 1
2 4 4 4
3 4 2 2

output:

7.2500000000

result:

ok found '7.2500000', expected '7.2500000', error '0.0000000'

Test #7:

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

input:

2 10 453 1 2
1 2 4 7
1 2 9 8
1 2 6 4
1 2 1 4
1 2 4 5
1 2 9 2
1 2 10 4
1 2 5 6
1 2 5 1
1 2 8 3

output:

16.3181818182

result:

ok found '16.3181818', expected '16.3181818', error '0.0000000'

Test #8:

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

input:

2 10 140 2 1
2 1 4 10
2 1 7 3
2 1 1 3
2 1 5 1
2 1 1 7
2 1 1 1
2 1 5 8
2 1 5 7
2 1 10 4
2 1 9 4

output:

7.3000000000

result:

ok found '7.3000000', expected '7.3000000', error '0.0000000'

Test #9:

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

input:

2 10 221 1 2
1 2 10 2
1 2 10 4
1 2 6 3
1 2 8 5
1 2 1 1
1 2 9 3
1 2 5 4
1 2 4 7
1 2 3 4
1 2 2 5

output:

11.5000000000

result:

ok found '11.5000000', expected '11.5000000', error '0.0000000'

Test #10:

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

input:

2 10 68 2 1
2 1 10 4
2 1 1 2
2 1 4 7
2 1 2 3
2 1 3 2
2 1 5 8
2 1 7 4
2 1 7 8
2 1 9 8
2 1 8 5

output:

6.8181818182

result:

ok found '6.8181818', expected '6.8181818', error '0.0000000'

Test #11:

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

input:

2 10 356 1 2
1 2 4 10
1 2 6 8
1 2 8 5
1 2 6 6
1 2 1 8
1 2 9 1
1 2 2 10
1 2 5 7
1 2 5 8
1 2 9 6

output:

9.9420289855

result:

ok found '9.9420290', expected '9.9420290', error '0.0000000'

Test #12:

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

input:

10 90 3561 2 1
2 1 10 2
2 1 2 7
2 1 6 4
2 1 8 3
2 1 3 9
2 4 6 3
4 1 4 6
2 4 5 4
4 1 3 9
2 4 10 7
4 1 1 7
2 4 7 1
4 1 8 3
2 4 7 5
4 1 7 9
2 3 9 8
3 1 2 1
2 3 2 3
3 1 10 8
2 3 8 7
3 1 8 7
2 3 3 5
3 1 9 5
2 3 7 5
3 1 3 7
2 10 5 6
10 1 10 4
2 10 8 3
10 1 5 2
2 10 6 1
10 1 3 2
2 10 3 8
10 1 10 7
2 10 6 9...

output:

23.9678714859

result:

ok found '23.9678715', expected '23.9678715', error '0.0000000'

Test #13:

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

input:

10 90 973 4 6
4 6 10 9
4 6 6 2
4 6 3 1
4 6 10 9
4 6 9 10
4 2 7 6
2 6 5 1
4 2 7 8
2 6 4 9
4 2 9 3
2 6 3 6
4 2 7 6
2 6 8 8
4 2 6 9
2 6 10 3
4 5 10 6
5 6 5 10
4 5 6 9
5 6 4 10
4 5 6 10
5 6 10 4
4 5 9 3
5 6 7 6
4 5 3 7
5 6 3 10
4 7 8 9
7 6 2 7
4 7 4 5
7 6 4 3
4 7 8 10
7 6 3 3
4 7 6 7
7 6 6 4
4 7 1 1
7 6...

output:

12.8041237113

result:

ok found '12.8041237', expected '12.8041237', error '0.0000000'

Test #14:

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

input:

10 90 3646 1 5
1 5 1 2
1 5 8 2
1 5 4 2
1 5 3 7
1 5 9 2
1 3 9 8
3 5 3 10
1 3 5 6
3 5 10 3
1 3 8 5
3 5 5 4
1 3 10 6
3 5 7 6
1 3 1 4
3 5 5 6
1 7 8 2
7 5 2 2
1 7 5 1
7 5 2 5
1 7 3 8
7 5 3 1
1 7 3 3
7 5 3 4
1 7 4 10
7 5 9 9
1 6 1 5
6 5 5 10
1 6 3 3
6 5 9 5
1 6 8 10
6 5 1 7
1 6 5 5
6 5 1 5
1 6 9 6
6 5 2 6...

output:

24.8333333333

result:

ok found '24.8333333', expected '24.8333333', error '0.0000000'

Test #15:

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

input:

10 90 620 5 6
5 6 4 7
5 6 3 5
5 6 10 5
5 6 1 8
5 6 6 9
5 8 1 3
8 6 5 5
5 8 7 8
8 6 2 9
5 8 1 5
8 6 7 2
5 8 5 1
8 6 1 3
5 8 1 7
8 6 4 7
5 1 7 4
1 6 10 3
5 1 8 3
1 6 4 7
5 1 2 3
1 6 10 9
5 1 3 6
1 6 1 10
5 1 2 9
1 6 3 7
5 4 3 6
4 6 4 9
5 4 3 5
4 6 6 1
5 4 8 10
4 6 1 1
5 4 10 6
4 6 3 8
5 4 8 5
4 6 1 1
...

output:

8.7238805970

result:

ok found '8.7238806', expected '8.7238806', error '0.0000000'

Test #16:

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

input:

10 90 35 4 10
4 10 7 2
4 10 4 10
4 10 9 4
4 10 7 7
4 10 1 4
4 9 3 10
9 10 2 10
4 9 4 5
9 10 9 3
4 9 8 3
9 10 10 4
4 9 4 9
9 10 3 9
4 9 3 3
9 10 1 5
4 3 6 2
3 10 7 3
4 3 7 7
3 10 1 5
4 3 2 1
3 10 1 7
4 3 8 8
3 10 8 1
4 3 3 7
3 10 9 4
4 8 5 7
8 10 9 9
4 8 5 3
8 10 1 4
4 8 2 7
8 10 5 3
4 8 10 6
8 10 8 ...

output:

3.2758620690

result:

ok found '3.2758621', expected '3.2758621', error '0.0000000'

Test #17:

score: 0
Accepted
time: 13ms
memory: 4232kb

input:

199 1980 60477 15 119
15 131 5 5
15 131 5 8
15 147 7 5
15 23 3 8
15 115 4 3
15 118 2 8
118 10 8 10
15 118 9 4
118 75 10 4
15 118 2 1
118 7 7 4
15 118 1 8
118 10 9 8
15 118 8 9
118 131 2 4
15 133 10 3
133 131 6 6
15 133 5 4
133 131 5 10
15 133 9 5
133 147 9 9
15 133 10 7
133 49 5 2
15 133 10 4
133 18...

output:

217.7746478873

result:

ok found '217.7746479', expected '217.7746479', error '0.0000000'

Test #18:

score: 0
Accepted
time: 17ms
memory: 4184kb

input:

199 1980 16622 179 78
179 44 5 3
179 105 4 4
179 132 1 4
179 99 3 10
179 187 4 1
179 123 7 5
123 99 5 4
179 123 3 7
123 35 6 3
179 123 3 8
123 136 7 4
179 123 4 9
123 44 4 7
179 123 5 9
123 35 4 10
179 36 10 9
36 105 6 5
179 36 3 6
36 132 2 9
179 36 3 2
36 99 7 1
179 36 2 9
36 187 2 8
179 36 10 10
3...

output:

94.4759206799

result:

ok found '94.4759207', expected '94.4759207', error '0.0000000'

Test #19:

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

input:

199 1980 85940 177 59
177 136 10 7
177 79 9 10
177 159 7 8
177 79 2 10
177 163 10 1
177 83 7 3
83 1 7 4
177 83 9 1
83 138 4 5
177 83 4 1
83 185 5 10
177 83 4 10
83 1 10 7
177 83 8 10
83 164 4 3
177 156 10 2
156 111 4 5
177 156 10 5
156 185 9 1
177 156 8 5
156 111 7 6
177 156 2 1
156 95 8 3
177 156 7...

output:

314.0464396285

result:

ok found '314.0464396', expected '314.0464396', error '0.0000000'

Test #20:

score: 0
Accepted
time: 12ms
memory: 6164kb

input:

199 1980 60371 96 183
96 128 6 9
96 175 6 7
96 113 4 6
96 6 1 6
96 180 6 7
96 48 4 5
48 180 8 3
96 48 8 9
48 113 6 1
96 48 6 6
48 180 6 4
96 48 9 9
48 29 6 10
96 48 5 5
48 68 9 2
96 41 4 6
41 29 8 2
96 41 8 1
41 128 4 9
96 41 8 3
41 181 4 4
96 41 5 3
41 68 4 4
96 41 1 9
41 191 6 5
96 26 4 6
26 68 4 ...

output:

232.3169230769

result:

ok found '232.3169231', expected '232.3169231', error '0.0000000'

Test #21:

score: 0
Accepted
time: 16ms
memory: 4168kb

input:

199 1980 14534 84 135
84 121 1 9
84 183 7 2
84 121 3 5
84 87 2 9
84 43 9 7
84 75 10 9
75 100 6 1
84 75 8 4
75 123 7 1
84 75 4 7
75 122 8 2
84 75 1 8
75 122 2 2
84 75 6 2
75 100 9 2
84 27 9 2
27 43 3 8
84 27 2 6
27 197 10 5
84 27 4 3
27 158 1 7
84 27 8 4
27 158 6 7
84 27 8 7
27 58 6 2
84 63 6 1
63 12...

output:

88.1437125749

result:

ok found '88.1437126', expected '88.1437126', error '0.0000000'

Test #22:

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

input:

2 10 446 1 2
1 2 6 6
1 2 5 10
1 2 5 9
1 2 6 1
1 2 10 10
1 2 3 5
1 2 9 2
1 2 1 6
1 2 8 5
1 2 3 2

output:

13.7142857143

result:

ok found '13.7142857', expected '13.7142857', error '0.0000000'

Test #23:

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

input:

2 10 322 1 2
1 2 1 5
1 2 10 7
1 2 7 6
1 2 1 2
1 2 6 10
1 2 6 2
1 2 10 1
1 2 1 5
1 2 5 9
1 2 10 7

output:

11.9074074074

result:

ok found '11.9074074', expected '11.9074074', error '0.0000000'

Test #24:

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

input:

2 10 78 1 2
1 2 8 3
1 2 3 8
1 2 2 4
1 2 1 2
1 2 1 3
1 2 1 1
1 2 1 7
1 2 10 7
1 2 4 7
1 2 9 6

output:

4.7187500000

result:

ok found '4.7187500', expected '4.7187500', error '0.0000000'

Test #25:

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

input:

2 10 95 2 1
2 1 3 8
2 1 1 2
2 1 6 3
2 1 5 7
2 1 7 10
2 1 3 10
2 1 4 6
2 1 9 6
2 1 9 2
2 1 2 3

output:

6.0000000000

result:

ok found '6.0000000', expected '6.0000000', error '0.0000000'

Test #26:

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

input:

2 10 416 2 1
2 1 1 8
2 1 2 7
2 1 9 2
2 1 10 10
2 1 9 5
2 1 8 4
2 1 10 8
2 1 4 4
2 1 2 7
2 1 7 1

output:

13.3928571429

result:

ok found '13.3928571', expected '13.3928571', error '0.0000000'

Test #27:

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

input:

2 10 103 2 1
2 1 10 8
2 1 5 7
2 1 8 2
2 1 1 1
2 1 3 10
2 1 4 5
2 1 8 3
2 1 4 1
2 1 9 10
2 1 9 2

output:

8.0344827586

result:

ok found '8.0344828', expected '8.0344828', error '0.0000000'

Test #28:

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

input:

2 10 109 2 1
2 1 7 3
2 1 6 1
2 1 2 7
2 1 7 1
2 1 10 8
2 1 3 2
2 1 8 8
2 1 3 6
2 1 4 1
2 1 3 6

output:

7.5185185185

result:

ok found '7.5185185', expected '7.5185185', error '0.0000000'

Test #29:

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

input:

2 10 347 2 1
2 1 2 5
2 1 5 9
2 1 7 6
2 1 9 4
2 1 9 2
2 1 4 4
2 1 3 8
2 1 8 9
2 1 3 7
2 1 9 1

output:

11.6363636364

result:

ok found '11.6363636', expected '11.6363636', error '0.0000000'

Test #30:

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

input:

2 10 405 2 1
2 1 1 10
2 1 1 9
2 1 4 8
2 1 8 10
2 1 1 9
2 1 10 5
2 1 9 3
2 1 5 3
2 1 6 5
2 1 8 3

output:

10.6307692308

result:

ok found '10.6307692', expected '10.6307692', error '0.0000000'

Test #31:

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

input:

2 10 8 1 2
1 2 2 3
1 2 10 10
1 2 5 3
1 2 9 5
1 2 4 10
1 2 1 8
1 2 1 9
1 2 7 1
1 2 7 2
1 2 9 6

output:

1.4705882353

result:

ok found '1.4705882', expected '1.4705882', error '0.0000000'

Test #32:

score: 0
Accepted
time: 38ms
memory: 4228kb

input:

199 1980 53462 95 20
95 30 10 4
95 49 6 6
95 179 1 7
95 90 4 4
95 31 1 9
95 160 5 2
160 29 1 4
95 160 8 9
160 157 8 7
95 160 7 5
160 57 7 5
95 160 5 6
160 143 10 1
95 160 2 6
160 176 4 1
95 114 7 4
114 195 4 1
95 114 10 10
114 90 3 6
95 114 5 10
114 29 5 3
95 114 5 5
114 80 10 7
95 114 5 3
114 97 5 ...

output:

54.4554317549

result:

ok found '54.4554318', expected '54.4554318', error '0.0000000'

Test #33:

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

input:

199 1980 38765 115 117
115 76 2 2
115 180 2 4
115 74 4 3
115 181 10 10
115 30 7 4
115 101 5 2
101 42 8 7
115 101 6 10
101 75 4 5
115 101 2 9
101 74 3 6
115 101 9 4
101 144 3 3
115 101 6 1
101 118 3 10
115 4 7 1
4 46 10 5
115 4 10 9
4 34 6 10
115 4 6 9
4 168 1 5
115 4 2 10
4 143 10 8
115 4 3 3
4 163 ...

output:

43.9381017882

result:

ok found '43.9381018', expected '43.9381018', error '0.0000000'

Test #34:

score: 0
Accepted
time: 38ms
memory: 4228kb

input:

199 1980 42881 68 189
68 98 1 9
68 183 5 2
68 194 7 6
68 91 6 1
68 61 2 3
68 74 2 7
74 6 5 10
68 74 5 10
74 41 10 10
68 74 1 9
74 32 7 2
68 74 7 10
74 113 4 5
68 74 7 8
74 169 6 7
68 81 10 1
81 100 2 9
68 81 5 10
81 60 10 10
68 81 1 10
81 136 1 9
68 81 8 1
81 33 2 7
68 81 7 6
81 187 6 5
68 73 6 6
73...

output:

45.8508064516

result:

ok found '45.8508065', expected '45.8508065', error '0.0000000'

Test #35:

score: 0
Accepted
time: 37ms
memory: 4128kb

input:

199 1980 6865 15 92
15 33 8 6
15 130 7 10
15 21 3 4
15 62 2 2
15 168 4 3
15 104 4 4
104 123 5 3
15 104 10 1
104 53 10 5
15 104 2 5
104 96 9 2
15 104 7 10
104 11 9 6
15 104 4 10
104 135 1 5
15 177 1 8
177 181 8 5
15 177 6 6
177 118 1 4
15 177 6 9
177 16 10 2
15 177 9 10
177 16 9 5
15 177 4 5
177 30 1...

output:

20.0882352941

result:

ok found '20.0882353', expected '20.0882353', error '0.0000000'

Test #36:

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

input:

199 1980 96274 80 55
80 68 6 7
80 175 2 1
80 76 7 4
80 92 5 8
80 171 9 5
80 140 5 9
140 58 8 3
80 140 7 9
140 196 9 2
80 140 7 9
140 69 9 9
80 140 3 7
140 123 6 10
80 140 6 2
140 171 7 6
80 147 4 6
147 44 4 5
80 147 1 1
147 162 9 2
80 147 2 6
147 92 6 7
80 147 4 8
147 182 3 8
80 147 4 9
147 75 5 3
8...

output:

81.9926813041

result:

ok found '81.9926813', expected '81.9926813', error '0.0000000'

Test #37:

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

input:

199 1980 3945 106 46
106 11 8 4
106 78 5 5
106 78 2 4
106 81 8 1
106 13 7 3
106 71 4 3
71 47 5 1
106 71 8 4
71 47 9 2
106 71 10 2
71 187 5 1
106 71 5 5
71 146 10 4
106 71 9 5
71 45 5 2
106 31 4 1
31 62 1 3
106 31 4 4
31 81 5 4
106 31 5 3
31 141 9 5
106 31 6 5
31 11 3 3
106 31 8 1
31 45 5 5
106 34 10...

output:

64.8333333333

result:

ok found '64.8333333', expected '64.8333333', error '0.0000000'

Test #38:

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

input:

199 1980 7802 175 3
175 102 6 5
175 183 10 2
175 87 4 1
175 169 7 4
175 87 5 5
175 119 10 5
119 74 10 1
175 119 10 3
119 151 2 5
175 119 2 5
119 28 6 4
175 119 7 3
119 74 9 3
175 119 4 2
119 40 5 1
175 88 7 4
88 151 4 2
175 88 2 1
88 195 4 3
175 88 10 1
88 40 9 2
175 88 10 5
88 157 4 1
175 88 7 1
88...

output:

88.9948717949

result:

ok found '88.9948718', expected '88.9948718', error '0.0000000'

Test #39:

score: 0
Accepted
time: 6ms
memory: 4196kb

input:

199 1980 15828 112 38
112 56 6 2
112 19 4 5
112 26 2 1
112 165 10 2
112 191 5 5
112 143 4 2
143 158 4 4
112 143 5 5
143 180 1 2
112 143 1 1
143 104 2 5
112 143 4 3
143 104 4 5
112 143 4 3
143 191 6 4
112 33 1 4
33 159 4 1
112 33 10 2
33 133 10 2
112 33 10 2
33 158 9 5
112 33 10 5
33 165 9 5
112 33 7...

output:

131.5923913043

result:

ok found '131.5923913', expected '131.5923913', error '0.0000000'

Test #40:

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

input:

199 1980 16078 189 39
189 124 9 1
189 179 2 5
189 124 6 4
189 135 8 1
189 53 3 2
189 192 8 5
192 184 6 2
189 192 6 1
192 105 5 4
189 192 7 4
192 179 5 1
189 192 1 4
192 53 2 4
189 192 5 5
192 43 10 1
189 160 9 3
160 105 10 1
189 160 3 3
160 184 9 4
189 160 6 5
160 43 9 2
189 160 4 2
160 105 1 2
189 ...

output:

131.4387755102

result:

ok found '131.4387755', expected '131.4387755', error '0.0000000'

Test #41:

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

input:

199 1980 11693 37 58
37 177 8 3
37 27 9 5
37 115 10 1
37 20 8 3
37 20 7 1
37 100 3 4
100 119 2 4
37 100 10 1
100 27 7 1
37 100 9 2
100 103 10 1
37 100 10 4
100 27 1 3
37 100 10 1
100 126 10 3
37 114 10 1
114 103 1 4
37 114 1 1
114 119 8 1
37 114 1 4
114 53 4 1
37 114 8 5
114 119 4 4
37 114 5 5
114 1...

output:

110.3516483516

result:

ok found '110.3516484', expected '110.3516484', error '0.0000000'

Test #42:

score: 0
Accepted
time: 32ms
memory: 4180kb

input:

199 1980 43616 89 144
89 172 5 1
89 186 4 8
89 140 3 8
89 190 1 1
89 29 1 7
89 35 3 8
35 190 1 10
89 35 4 6
35 121 1 2
89 35 2 4
35 131 3 3
89 35 1 9
35 111 4 9
89 35 2 9
35 69 2 7
89 86 2 8
86 16 2 3
89 86 1 10
86 194 2 5
89 86 3 10
86 23 3 7
89 86 4 6
86 80 4 1
89 86 5 1
86 154 3 2
89 27 3 5
27 11...

output:

39.3032169747

result:

ok found '39.3032170', expected '39.3032170', error '0.0000000'

Test #43:

score: 0
Accepted
time: 32ms
memory: 4228kb

input:

199 1980 8520 88 105
88 20 4 8
88 71 1 7
88 20 2 4
88 108 1 5
88 34 2 8
88 124 1 3
124 19 4 6
88 124 5 10
124 34 3 10
88 124 2 9
124 112 1 5
88 124 3 7
124 34 4 6
88 124 1 2
124 59 4 5
88 143 2 7
143 37 5 3
88 143 5 7
143 25 5 1
88 143 1 2
143 144 5 6
88 143 4 5
143 147 2 9
88 143 2 9
143 45 1 3
88 ...

output:

15.6323867997

result:

ok found '15.6323868', expected '15.6323868', error '0.0000000'

Test #44:

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

input:

199 1980 24301 150 190
150 26 4 8
150 20 3 5
150 26 3 7
150 174 2 10
150 17 3 3
150 152 3 1
152 60 3 7
150 152 4 6
152 26 2 8
150 152 2 10
152 166 1 9
150 152 2 5
152 26 5 4
150 152 2 2
152 114 4 5
150 130 1 10
130 102 5 6
150 130 4 9
130 20 2 2
150 130 4 6
130 125 1 6
150 130 1 9
130 40 1 10
150 13...

output:

25.6457105435

result:

ok found '25.6457105', expected '25.6457105', error '0.0000000'

Test #45:

score: 0
Accepted
time: 30ms
memory: 4176kb

input:

199 1980 26615 180 134
180 81 1 6
180 22 5 1
180 58 1 2
180 169 5 2
180 81 2 2
180 190 5 2
190 151 3 3
180 190 3 2
190 21 3 3
180 190 4 8
190 184 4 8
180 190 1 2
190 109 2 5
180 190 5 3
190 81 3 3
180 101 1 10
101 127 5 4
180 101 5 4
101 11 4 7
180 101 1 2
101 53 5 1
180 101 3 5
101 11 1 6
180 101 2...

output:

27.8447802198

result:

ok found '27.8447802', expected '27.8447802', error '0.0000000'

Test #46:

score: 0
Accepted
time: 30ms
memory: 4164kb

input:

199 1980 45845 96 171
96 148 4 4
96 55 1 8
96 33 2 6
96 27 2 9
96 36 4 8
96 30 1 3
30 56 3 1
96 30 5 8
30 66 5 3
96 30 4 3
30 167 4 8
96 30 1 1
30 149 5 10
96 30 5 4
30 163 5 9
96 3 5 8
3 137 3 5
96 3 3 7
3 94 5 5
96 3 5 9
3 74 1 9
96 3 5 9
3 178 3 10
96 3 1 2
3 166 5 4
96 95 5 10
95 48 3 3
96 95 3 ...

output:

42.4159544160

result:

ok found '42.4159544', expected '42.4159544', error '0.0000000'

Test #47:

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

input:

15 30 365 1 14
1 14 4 1
1 14 5 10
1 14 8 3
1 14 4 5
1 14 1 8
1 14 4 6
1 14 4 9
1 14 3 6
1 14 1 2
1 14 7 10
8 4 3 5
5 2 2 2
4 3 9 7
8 12 8 10
12 2 10 8
5 6 7 10
2 15 10 4
10 12 9 2
13 6 3 5
9 13 1 9
3 5 2 1
11 6 9 3
9 4 4 3
5 9 2 1
15 3 4 5
9 13 2 4
10 9 6 2
2 7 5 10
2 12 4 7
5 11 1 8

output:

10.3500000000

result:

ok found '10.3500000', expected '10.3500000', error '0.0000000'

Test #48:

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

input:

15 30 417 7 11
7 11 8 9
7 11 2 8
7 11 9 7
7 11 8 8
7 11 8 7
7 11 3 7
7 11 7 5
7 11 5 3
7 11 7 9
7 11 8 1
2 1 4 4
2 4 9 5
13 1 8 9
6 9 6 9
10 15 9 4
8 14 6 2
4 5 6 2
4 9 3 4
9 15 9 6
12 6 4 7
5 14 5 1
3 1 4 1
14 9 9 1
5 10 9 6
13 8 1 6
5 3 2 8
5 13 3 8
1 15 8 6
5 2 1 9
10 2 5 2

output:

12.9687500000

result:

ok found '12.9687500', expected '12.9687500', error '0.0000000'

Test #49:

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

input:

15 30 297 12 6
12 6 4 10
12 6 5 9
12 6 2 2
12 6 3 3
12 6 5 10
12 6 3 2
12 6 9 10
12 6 9 1
12 6 9 10
12 6 4 6
11 3 4 2
1 3 1 4
13 11 9 6
13 2 10 4
4 13 6 2
8 7 1 2
11 10 3 4
13 5 2 9
7 10 5 10
2 15 9 7
13 10 8 8
1 7 8 6
9 14 8 3
5 1 2 6
9 14 7 10
4 13 7 7
3 15 5 5
15 13 5 1
4 13 5 7
7 15 1 10

output:

10.5396825397

result:

ok found '10.5396825', expected '10.5396825', error '0.0000000'

Test #50:

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

input:

15 30 353 8 2
8 2 1 7
8 2 1 10
8 2 5 9
8 2 3 8
8 2 10 5
8 2 2 6
8 2 1 7
8 2 8 7
8 2 3 9
8 2 1 10
12 3 7 9
3 4 8 9
7 11 10 4
6 5 4 6
10 7 2 4
4 10 9 9
14 13 5 8
3 9 7 4
15 9 2 3
4 3 4 9
12 13 1 4
6 13 8 9
13 5 4 4
5 15 6 7
4 3 2 6
12 5 9 5
6 3 3 6
7 1 7 7
11 15 3 1
5 3 7 10

output:

7.5000000000

result:

ok found '7.5000000', expected '7.5000000', error '0.0000000'

Test #51:

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

input:

15 30 472 9 11
9 11 2 7
9 11 10 2
9 11 7 2
9 11 8 5
9 11 8 3
9 11 1 3
9 11 2 7
9 11 6 3
9 11 8 10
9 11 4 6
4 13 4 4
12 6 1 2
2 10 10 1
14 4 4 8
2 6 5 9
3 15 4 6
1 3 10 10
8 13 7 3
12 2 6 7
4 6 1 2
7 5 9 4
5 14 3 2
13 8 1 9
1 7 1 4
4 15 8 9
4 8 7 4
5 12 5 2
3 1 2 1
13 7 9 5
13 10 4 1

output:

15.0625000000

result:

ok found '15.0625000', expected '15.0625000', error '0.0000000'

Test #52:

score: 0
Accepted
time: 16ms
memory: 4132kb

input:

200 2000 19681 116 43
116 29 5 2
116 101 8 8
116 29 8 2
116 195 7 3
116 92 1 4
116 131 10 7
131 90 1 10
116 131 2 3
131 186 1 7
116 131 10 8
131 101 1 1
116 131 6 1
131 102 6 7
116 131 4 3
131 93 2 7
116 149 6 2
149 92 3 2
116 149 4 6
149 92 5 5
116 149 3 4
149 102 1 4
116 149 1 1
149 184 2 5
116 14...

output:

97.3695014663

result:

ok found '97.3695015', expected '97.3695015', error '0.0000000'

Test #53:

score: 0
Accepted
time: 13ms
memory: 4188kb

input:

200 2000 1991 99 118
99 1 5 1
99 1 1 10
99 180 9 9
99 130 8 5
99 129 3 2
99 149 1 4
149 68 5 3
99 149 9 8
149 130 2 9
99 149 4 3
149 130 5 5
99 149 8 6
149 68 8 3
99 149 9 7
149 49 5 4
99 159 9 1
159 180 8 3
99 159 5 10
159 68 2 9
99 159 3 4
159 161 2 4
99 159 8 6
159 68 10 7
99 159 5 5
159 49 1 10
...

output:

38.4339622642

result:

ok found '38.4339623', expected '38.4339623', error '0.0000000'

Test #54:

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

input:

200 2000 70823 142 71
142 105 1 7
142 105 10 1
142 145 6 1
142 198 9 2
142 160 7 5
142 97 7 5
97 181 4 8
142 97 10 4
97 23 2 5
142 97 10 2
97 23 2 5
142 97 5 10
97 131 6 9
142 97 5 8
97 125 6 2
142 81 7 5
81 23 4 8
142 81 3 1
81 125 5 6
142 81 2 2
81 140 6 10
142 81 4 2
81 15 8 7
142 81 9 1
81 15 5 ...

output:

265.1655844156

result:

ok found '265.1655844', expected '265.1655844', error '0.0000000'

Test #55:

score: 0
Accepted
time: 12ms
memory: 6228kb

input:

200 2000 10402 174 181
174 126 1 6
174 5 8 9
174 82 3 8
174 94 10 2
174 50 8 7
174 183 2 6
183 199 10 7
174 183 1 3
183 134 9 2
174 183 6 1
183 50 8 5
174 183 7 6
183 50 3 1
174 183 10 1
183 5 2 2
174 64 5 3
64 78 4 6
174 64 2 9
64 94 8 3
174 64 5 10
64 80 8 3
174 64 7 9
64 200 4 2
174 64 10 8
64 80...

output:

69.6242424242

result:

ok found '69.6242424', expected '69.6242424', error '0.0000000'

Test #56:

score: 0
Accepted
time: 17ms
memory: 4196kb

input:

200 2000 11600 122 162
122 18 2 7
122 45 7 9
122 93 6 3
122 155 6 9
122 45 6 3
122 9 1 8
9 157 4 2
122 9 10 9
9 155 10 6
122 9 7 6
9 157 2 7
122 9 7 8
9 18 4 9
122 9 9 7
9 155 5 10
122 27 3 5
27 42 1 3
122 27 7 2
27 138 4 3
122 27 8 2
27 18 5 9
122 27 2 10
27 157 1 7
122 27 1 5
27 42 7 8
122 96 7 6
...

output:

71.1035422343

result:

ok found '71.1035422', expected '71.1035422', error '0.0000000'