QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#666758#4077. 뚫기masterhuang7 84ms14260kbC++231.9kb2024-10-22 19:50:412024-10-22 19:50:52

Judging History

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

  • [2024-10-22 19:50:52]
  • 评测
  • 测评结果:7
  • 用时:84ms
  • 内存:14260kb
  • [2024-10-22 19:50:41]
  • 提交

answer

#include "breakthru.h"
#include<bits/stdc++.h>
#define LL long long
#define P pair<LL,LL>
#define fi first
#define se second
#define fr(x) freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);
using namespace std;
const int N=1e4+5,M=N<<3;const LL inf=1e17;
int n,m,V=1e9,q,l[N],r[N];LL lt[M];P a[M],lt1[M];
vector<P>T;
inline void pushup(int wz){a[wz]=min(a[wz<<1],a[wz<<1|1]);}
inline void upd(int wz,LL x){a[wz].fi+=x,lt[wz]+=x,lt1[wz].fi+=x;}
inline void upd1(int wz,P x){a[wz]=min(a[wz],x);lt1[wz]=min(lt1[wz],x);}
inline void pushdown(int wz)
{
	LL &lt=::lt[wz];P &lt1=::lt1[wz];
	if(lt) upd(wz<<1,lt),upd(wz<<1|1,lt),lt=0;
	if(lt1.fi!=inf) upd1(wz<<1,lt1),upd1(wz<<1|1,lt1),lt1={inf,inf};
}
void updata(int l,int r,int wz,int L,int R,LL x)
{
	if(L<=l&&r<=R) return upd(wz,x);
	int mid=(l+r)>>1;pushdown(wz);
	if(L<=mid) updata(l,mid,wz<<1,L,R,x);
	if(mid<R) updata(mid+1,r,wz<<1|1,L,R,x);
	pushup(wz);
}
inline P sol(int A,int B)
{
	for(int i=1;i<=(m<<2);i++) lt[i]=0,a[i]=lt1[i]={0,0};
	for(int i=1;i<=n;i++)
	{
		updata(1,m,1,l[i],r[i],B);P t=a[1];
		upd1(1,{t.fi+A,t.se+1});
	}auto [u,v]=a[1];
	return {v,(u-v*A)/B};
}
inline LL MUL(P A,P B){return A.fi*B.fi+A.se*B.se;}
void dfs(P A,P B)
{
	P t={A.se-B.se,B.fi-A.fi},C=sol(t.fi,t.se);
	if(MUL(C,t)!=MUL(A,t)) T.push_back(C),dfs(A,C),dfs(C,B);
}
void init(int _n,int _m,vector<int>Y1,vector<int>Y2)
{
	n=_n,m=_m;basic_string<int>g;g+=0,g+=m;
	for(int i=1;i<=n;i++) l[i]=Y1[i-1],r[i]=Y2[i-1],g+=l[i],g+=r[i]+1;
	sort(g.begin(),g.end());g.erase(unique(g.begin(),g.end()),g.end());
	for(int i=1;i<=n;i++) l[i]=lower_bound(g.begin(),g.end(),l[i])-g.begin()+1,
	r[i]=upper_bound(g.begin(),g.end(),r[i])-g.begin();m=g.size()-1;
	P A=sol(V,1),B=sol(1,V);T.push_back(A),T.push_back(B);dfs(A,B);
	sort(T.begin(),T.end());
}
LL minimize(int A,int B)
{
	P t={A,B};int l=0,r=T.size()-1,mid;
	while(l<r) mid=(l+r)>>1,(MUL(T[mid],t)<MUL(T[mid+1],t))?r=mid:l=mid+1;
	return MUL(T[l],t);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 7
Accepted

Test #1:

score: 7
Accepted
time: 1ms
memory: 3792kb

input:

6 2 1
1 1
0 1
0 0
0 1
1 1
0 1
724642704 32998300

output:

131993200

result:

ok single line: '131993200'

Test #2:

score: 7
Accepted
time: 1ms
memory: 3796kb

input:

10 3 1
1 2
1 2
0 2
1 2
2 2
0 2
1 1
0 2
0 1
1 2
686137157 255736273

output:

1022945092

result:

ok single line: '1022945092'

Test #3:

score: 7
Accepted
time: 1ms
memory: 5896kb

input:

50 5 1
0 1
4 4
3 4
1 4
0 3
1 4
1 3
0 4
0 0
0 3
0 1
0 3
0 0
2 3
0 0
3 4
1 1
2 2
0 1
0 1
0 4
1 4
3 4
0 1
0 4
2 2
0 3
0 3
0 4
0 3
0 4
2 4
0 0
4 4
3 3
1 4
2 3
0 2
0 1
0 3
2 3
3 3
2 3
2 4
2 2
0 2
1 2
0 4
1 3
2 4
404445464 361978179

output:

6196096328

result:

ok single line: '6196096328'

Test #4:

score: 7
Accepted
time: 1ms
memory: 3644kb

input:

121 7 1
2 5
5 6
1 6
0 6
4 5
1 6
2 4
2 4
0 6
2 6
1 5
3 4
0 4
1 6
0 2
0 5
2 6
1 6
1 2
1 4
0 6
1 5
0 5
0 6
0 6
0 6
1 4
0 4
3 5
1 6
0 0
0 5
1 3
0 6
0 3
1 3
1 2
2 3
0 5
1 4
2 4
0 5
0 0
1 3
1 6
0 2
1 6
2 5
2 4
0 6
1 2
2 4
3 4
0 5
0 6
0 6
1 6
0 6
0 4
2 6
0 1
0 2
0 3
0 5
3 6
2 4
4 4
1 6
5 5
0 4
0 5
0 0
2 3
...

output:

16848723090

result:

ok single line: '16848723090'

Test #5:

score: 7
Accepted
time: 2ms
memory: 5636kb

input:

243 9 1
0 7
1 7
0 3
3 7
1 8
5 6
4 6
3 5
5 6
0 6
0 8
1 8
7 8
4 8
1 8
0 5
3 3
5 8
5 7
8 8
3 6
0 6
4 4
1 3
0 7
2 5
0 2
6 6
4 7
1 3
0 8
1 4
0 8
2 8
6 8
5 8
1 8
0 8
7 8
3 3
3 4
0 8
6 8
0 4
2 8
0 8
1 7
0 6
4 4
1 8
6 8
0 7
4 8
0 8
1 5
4 7
0 8
3 3
1 1
5 8
1 4
5 7
3 4
1 7
1 8
1 8
6 8
0 4
0 8
2 8
3 7
2 8
0 3
...

output:

27719095584

result:

ok single line: '27719095584'

Test #6:

score: 7
Accepted
time: 2ms
memory: 5728kb

input:

1000 102 1
46 74
33 80
4 84
22 96
1 100
10 36
35 68
0 65
4 26
26 93
25 90
0 79
14 101
24 57
4 53
37 60
4 77
32 97
44 70
29 65
44 99
2 49
0 86
69 76
3 57
1 93
16 83
38 60
1 86
1 40
19 97
28 94
4 45
16 72
23 94
26 89
20 60
29 32
21 39
14 83
26 74
24 77
15 88
72 93
12 90
1 81
27 60
15 90
36 78
18 39
12...

output:

23789206007

result:

ok single line: '23789206007'

Test #7:

score: 7
Accepted
time: 8ms
memory: 5784kb

input:

2000 123 1
48 81
27 95
16 109
19 106
26 115
4 116
66 83
2 111
39 118
15 47
21 122
1 120
78 101
35 120
55 95
36 59
75 75
42 64
71 105
11 121
31 122
30 112
93 116
1 61
77 84
26 90
28 109
14 116
9 118
80 91
8 101
13 113
29 51
2 118
5 77
23 93
25 108
3 120
8 120
22 64
36 65
7 83
7 115
14 93
8 50
7 116
5...

output:

40092503040

result:

ok single line: '40092503040'

Test #8:

score: 7
Accepted
time: 13ms
memory: 6008kb

input:

3000 143 1
0 142
28 140
36 139
27 48
1 137
21 142
35 103
40 91
55 82
2 135
27 123
42 58
38 126
105 106
43 65
13 103
78 99
71 102
21 106
94 127
31 40
14 131
94 120
1 117
5 128
48 120
27 135
31 107
49 107
2 132
89 102
22 123
23 139
76 137
125 136
80 122
12 127
17 91
84 136
82 139
45 131
38 85
9 142
24...

output:

53183710390

result:

ok single line: '53183710390'

Test #9:

score: 7
Accepted
time: 8ms
memory: 5748kb

input:

3000 123 1
38 120
3 97
6 57
11 11
29 76
39 115
69 89
57 122
11 122
43 66
46 104
6 43
4 119
8 59
28 107
73 102
18 119
70 108
62 95
4 115
19 79
29 91
2 40
114 120
67 83
37 46
14 110
4 70
2 35
35 120
21 28
20 111
4 121
10 103
7 122
36 105
21 28
15 26
54 72
65 113
24 118
58 115
49 115
13 112
105 120
0 1...

output:

9990597533

result:

ok single line: '9990597533'

Test #10:

score: 7
Accepted
time: 13ms
memory: 3792kb

input:

3000 102 1
94 95
51 101
91 99
9 92
8 80
2 60
45 57
1 96
40 83
8 8
15 87
10 98
44 89
40 96
13 62
4 67
6 35
0 101
36 95
15 53
56 86
55 88
38 74
11 50
0 61
0 93
32 69
7 60
32 82
9 98
7 97
18 100
70 91
26 80
27 101
21 69
0 101
43 49
45 97
17 73
1 12
0 36
40 86
44 92
57 68
15 87
57 68
54 75
66 101
10 88
...

output:

69226624268

result:

ok single line: '69226624268'

Test #11:

score: 7
Accepted
time: 3ms
memory: 5804kb

input:

3000 6 1
4 4
5 5
2 2
0 5
3 3
0 5
0 4
1 4
0 2
0 4
1 5
1 5
0 3
4 5
2 3
1 5
1 3
3 5
0 3
3 3
3 5
1 3
2 2
1 5
0 1
3 4
2 4
0 0
4 4
0 2
1 4
3 4
1 3
0 1
0 1
0 0
2 4
0 2
0 4
2 5
0 5
0 4
0 1
0 3
1 5
2 4
2 4
0 5
2 5
3 4
0 5
1 5
4 5
2 4
1 1
1 3
0 5
0 4
0 3
5 5
1 5
0 2
1 5
2 5
0 5
0 3
2 3
3 4
4 4
2 3
2 5
0 1
4 5...

output:

282532939566

result:

ok single line: '282532939566'

Test #12:

score: 7
Accepted
time: 5ms
memory: 5804kb

input:

3000 7 1
2 6
1 6
1 2
5 6
1 4
2 6
2 6
1 1
2 6
2 4
1 3
1 3
2 6
0 6
3 4
1 2
1 3
0 5
0 0
0 0
0 3
3 6
0 4
4 6
1 1
0 0
2 4
0 5
3 6
2 4
2 4
1 4
2 5
4 5
2 4
2 5
0 6
2 6
4 5
2 3
0 5
4 4
3 6
1 6
5 5
1 6
2 4
2 4
0 6
1 6
3 4
0 5
2 6
0 6
1 6
2 4
0 0
0 4
2 5
5 6
4 5
4 5
0 1
3 6
1 6
0 6
0 5
4 5
1 2
0 3
1 2
0 6
2 5...

output:

71432089700

result:

ok single line: '71432089700'

Test #13:

score: 7
Accepted
time: 8ms
memory: 3688kb

input:

3000 8 1
3 5
2 4
1 7
3 3
0 4
3 4
2 4
1 3
4 5
0 0
1 4
2 2
2 6
1 7
1 7
0 7
0 2
0 6
1 7
4 6
0 2
0 7
0 2
6 7
0 7
1 5
1 7
0 6
0 7
4 7
0 7
5 6
1 7
1 2
1 3
2 6
0 3
1 5
2 7
1 7
2 3
0 7
2 5
3 7
2 7
7 7
2 5
2 4
0 6
1 5
0 1
0 5
0 7
6 6
1 4
3 6
0 6
3 4
1 5
6 7
0 7
1 5
4 7
1 3
7 7
1 7
0 4
1 7
1 7
1 5
3 7
0 7
1 7...

output:

89022157300

result:

ok single line: '89022157300'

Test #14:

score: 7
Accepted
time: 9ms
memory: 6036kb

input:

3000 9 1
1 8
0 3
1 7
3 7
2 7
0 8
1 8
3 8
0 8
2 3
2 7
1 7
0 5
0 8
3 7
1 5
0 8
4 4
1 7
6 6
5 6
3 4
1 4
1 7
0 8
0 6
5 8
0 0
0 7
1 3
1 7
2 5
1 4
1 7
4 7
0 8
0 8
1 8
0 7
4 8
3 8
0 8
0 8
0 6
0 8
2 3
2 8
2 7
2 7
0 8
2 3
0 3
3 7
2 5
0 8
1 4
1 4
2 6
3 6
3 6
6 8
2 7
3 8
1 3
0 8
2 6
3 7
2 6
0 4
1 8
4 8
0 6
1 8...

output:

379045773469

result:

ok single line: '379045773469'

Test #15:

score: 7
Accepted
time: 9ms
memory: 5804kb

input:

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

output:

331629106039

result:

ok single line: '331629106039'

Test #16:

score: 7
Accepted
time: 10ms
memory: 4104kb

input:

3000 2934 1
1970 2832
110 2030
61 2595
313 2018
546 1871
1131 2583
216 2779
909 1996
864 1914
1011 1315
1365 2599
508 1996
955 2087
310 1272
1955 2337
781 1719
155 815
837 1681
25 2913
841 1953
376 2752
388 1124
1099 2382
1323 2198
851 2217
1459 2721
465 2160
312 2250
55 1080
180 339
764 2865
82 253...

output:

2426370144

result:

ok single line: '2426370144'

Test #17:

score: 7
Accepted
time: 4ms
memory: 5960kb

input:

2942 3000 1
425 2447
791 893
243 2737
447 1479
1447 2468
181 2810
1219 2995
2407 2628
296 1770
1535 1779
1338 2418
441 1346
1916 2767
740 2628
4 1462
230 2239
1755 1880
33 2815
283 2054
922 1731
1236 2809
513 2469
190 2711
1692 1850
31 2959
369 1998
246 2694
2524 2867
1076 2822
1204 2795
153 1294
28...

output:

3475348346

result:

ok single line: '3475348346'

Test #18:

score: 7
Accepted
time: 8ms
memory: 5920kb

input:

3000 3000 1
1390 1947
533 1520
288 2002
824 1075
363 2519
1187 2858
532 2977
31 2120
1 2937
1545 2305
1125 2756
835 2017
2055 2309
1621 2143
1316 1826
244 2875
1299 2494
509 2480
1384 1735
23 2976
443 752
290 993
495 2557
484 2973
718 1717
20 2576
470 1167
25 2557
157 2901
360 2798
1488 1917
719 294...

output:

1096040253

result:

ok single line: '1096040253'

Test #19:

score: 7
Accepted
time: 10ms
memory: 5672kb

input:

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

output:

231189542188

result:

ok single line: '231189542188'

Test #20:

score: 7
Accepted
time: 12ms
memory: 3696kb

input:

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

output:

149422997346

result:

ok single line: '149422997346'

Test #21:

score: 7
Accepted
time: 11ms
memory: 5936kb

input:

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

output:

193191161451

result:

ok single line: '193191161451'

Test #22:

score: 7
Accepted
time: 35ms
memory: 6084kb

input:

3000 3000 1
0 557
0 987
0 1714
0 251
843 2999
0 1671
0 2445
910 2999
63 2999
2239 2999
0 1631
1817 2999
2745 2999
2477 2999
0 510
0 2631
0 1195
1028 2999
0 351
0 2953
2690 2999
0 703
937 2999
0 2489
2000 2999
0 2556
0 697
467 2999
255 2999
0 2438
2570 2999
777 2999
0 964
0 1963
1344 2999
0 1766
2199...

output:

210328057904

result:

ok single line: '210328057904'

Test #23:

score: 7
Accepted
time: 48ms
memory: 4016kb

input:

3000 2983 1
0 133
2599 2982
2541 2982
0 389
0 2825
0 432
561 2982
2514 2982
0 1865
0 706
720 2982
3 2982
1648 2982
0 1731
1890 2982
1570 2982
0 937
1853 2982
0 1418
687 2982
0 799
1530 2982
1446 2982
2216 2982
0 2047
0 2530
0 2971
0 1736
1767 2982
0 1447
0 47
601 2982
0 1758
84 2982
0 2756
0 2116
0 ...

output:

571590929028

result:

ok single line: '571590929028'

Test #24:

score: 7
Accepted
time: 44ms
memory: 5856kb

input:

2984 3000 1
0 1161
1028 2999
0 2476
0 2636
0 1914
0 776
0 2136
248 2999
0 48
2645 2999
0 829
2998 2999
359 2999
0 1766
0 927
2847 2999
1471 2999
0 1945
188 2999
295 2999
1426 2999
1831 2999
697 2999
1280 2999
0 1876
735 2999
0 1413
2326 2999
0 2970
537 2999
1249 2999
1147 2999
0 1827
0 943
0 213
0 1...

output:

472133773188

result:

ok single line: '472133773188'

Test #25:

score: 7
Accepted
time: 2ms
memory: 5924kb

input:

300 3000 1
2218 2999
2936 2999
2708 2999
2281 2999
0 1722
0 1888
0 1064
0 704
1925 2999
0 1753
2426 2999
0 1862
0 1830
572 2999
0 2435
798 2999
95 2999
1193 2999
507 2999
0 1299
0 2105
0 508
2672 2999
1956 2999
1742 2999
0 2278
0 118
586 2999
1966 2999
0 1101
77 2999
2768 2999
1755 2999
0 81
0 1013
...

output:

54180869583

result:

ok single line: '54180869583'

Test #26:

score: 7
Accepted
time: 1ms
memory: 5620kb

input:

102 3000 1
0 689
840 2999
1957 2999
0 1676
0 415
2411 2999
2855 2999
2582 2999
0 2096
2287 2999
1961 2999
0 1601
2643 2999
1220 2999
820 2999
0 1470
802 2999
392 2999
0 1762
1064 2999
2595 2999
0 748
1501 2999
0 991
0 617
0 1021
0 1598
1753 2999
0 717
0 2553
1705 2999
0 646
0 106
109 2999
0 2738
284...

output:

1972426860

result:

ok single line: '1972426860'

Test #27:

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

input:

30 3000 1
0 6
2934 2999
419 2999
0 2107
0 2694
0 1094
0 714
2652 2999
0 166
0 1841
0 1480
654 2999
922 2999
503 2999
0 1267
0 680
0 2078
0 815
1096 2999
417 2999
2967 2999
764 2999
0 585
0 703
0 2031
1558 2999
1048 2999
893 2999
0 551
0 2839
997165834 387960850

output:

4100852634

result:

ok single line: '4100852634'

Test #28:

score: 7
Accepted
time: 7ms
memory: 3868kb

input:

3000 3000 1
2 2888
284 2922
152 2772
112 2784
140 2943
32 2566
262 2972
67 2987
97 2809
69 2766
282 2975
411 2876
515 2970
66 2929
240 2686
357 2972
22 2884
27 2627
139 2776
108 2593
401 2822
26 2988
61 2845
154 2847
101 2961
80 2756
56 2833
15 2750
118 2661
130 2870
132 2799
369 2815
32 2570
252 27...

output:

4441208350

result:

ok single line: '4441208350'

Test #29:

score: 7
Accepted
time: 11ms
memory: 5912kb

input:

3000 2998 1
0 2979
109 2505
172 2990
313 2748
175 2591
167 2968
284 2698
24 2815
107 2604
34 2965
123 2877
25 2992
75 2989
38 2836
286 2960
308 2919
393 2797
1 2533
350 2969
442 2864
170 2994
57 2749
75 2846
235 2967
180 2712
135 2883
307 2871
34 2556
463 2873
352 2984
111 2721
191 2827
193 2953
51 ...

output:

707002430

result:

ok single line: '707002430'

Test #30:

score: 7
Accepted
time: 11ms
memory: 5820kb

input:

2983 3000 1
287 2693
86 2847
39 2840
24 2998
132 2547
70 2707
166 2884
168 2850
17 2994
18 2863
60 2490
164 2746
59 2806
0 2991
236 2799
189 2682
224 2705
55 2742
105 2848
131 2954
39 2975
51 2672
55 2970
108 2972
30 2539
24 2991
39 2863
193 2987
135 2838
0 2998
6 2827
349 2934
24 2618
51 2911
131 2...

output:

5259263969

result:

ok single line: '5259263969'

Subtask #2:

score: 0
Runtime Error

Dependency #1:

100%
Accepted

Test #31:

score: 0
Runtime Error

input:

500 1000000000 1
393977 997870502
1756198 996576675
709934 998910119
17244831 952957551
142872155 968927704
30385278 942410694
85734427 939378703
37926488 882420546
46151590 899775163
85788461 920969935
45003485 970828908
67012830 999694016
121553395 948429920
74733065 879692791
28285744 997261133
1...

output:

Unauthorized output

result:


Subtask #3:

score: 0
Runtime Error

Test #60:

score: 19
Accepted
time: 78ms
memory: 14008kb

input:

500 10 1000000
2 9
2 7
3 6
1 6
3 5
0 5
3 4
6 8
4 8
1 6
1 5
6 7
7 7
6 9
0 7
4 5
0 6
0 2
4 6
0 6
1 7
2 8
0 9
0 9
0 9
0 7
3 6
8 8
2 4
4 4
0 5
2 5
1 6
0 9
2 7
0 8
9 9
1 4
0 9
2 4
1 9
2 8
2 6
0 4
5 9
4 5
3 9
2 6
1 9
0 6
6 8
2 9
4 9
7 9
2 7
1 5
1 8
0 6
0 9
2 9
3 9
0 2
4 4
5 9
4 7
8 9
4 9
1 8
3 8
2 9
6 6
3...

output:

109125435050
79679504214
40397444309
33486843995
50549382350
8831039674
29373662236
35916635082
1627822212
83193326242
7021463069
18347246004
17908310304
40111838606
42807634739
83808922569
36682521996
87471336298
56912099994
74488880562
59044328919
71779759293
47086282044
46402519236
10235901992
55...

result:

ok 1000000 lines

Test #61:

score: 19
Accepted
time: 84ms
memory: 12032kb

input:

500 10 1000000
2 3
0 5
4 8
5 9
1 3
3 8
0 1
3 8
2 8
2 9
1 3
3 3
1 8
5 9
3 9
4 5
6 9
2 9
2 3
0 8
2 9
0 3
1 9
9 9
2 9
2 7
2 8
2 4
6 9
2 9
0 9
2 8
2 8
0 4
2 6
7 8
0 9
0 8
0 9
2 7
5 7
4 7
0 9
5 6
0 4
2 7
0 7
2 9
2 8
0 2
1 6
0 9
1 6
0 7
7 9
0 8
4 9
1 5
0 9
1 7
0 2
4 8
2 2
5 5
4 8
3 7
8 8
1 5
9 9
0 8
4 4
0...

output:

93932220045
43423248548
63878537436
19958848316
34458591915
74471642637
29392721565
108979131384
68348696934
50344204576
86393681343
95187505608
59870044263
83702649696
40342598040
43679949188
38834691528
68528731476
73704081803
21220971702
17051904446
74680125785
33411395765
34066852792
84600145110...

result:

ok 1000000 lines

Test #62:

score: 19
Accepted
time: 83ms
memory: 13964kb

input:

500 10 1000000
0 9
0 9
1 9
1 9
2 9
0 8
5 7
0 8
6 9
0 5
3 6
1 8
4 8
0 6
1 3
3 3
3 7
0 9
2 3
6 7
0 4
3 9
2 8
7 9
4 5
6 9
8 9
2 6
5 8
5 7
1 1
0 5
0 9
0 1
4 8
0 9
3 8
2 9
3 8
0 8
5 8
0 9
0 8
2 5
0 9
5 8
5 9
2 3
6 8
0 6
2 4
5 7
5 8
2 9
0 7
1 8
0 9
6 8
3 7
0 5
0 7
3 5
1 8
2 8
0 8
7 9
7 9
2 2
0 9
1 8
5 5
5...

output:

57026961526
17848690951
99635443948
24983590233
44471894109
48040845836
78801683211
92617033538
95131564360
76003932078
4524951945
104824016509
83455743908
78148882789
31398746199
56921062405
8610055861
12034412595
76850763508
52731113665
57708287054
70697847727
42403292275
24664520532
110883680880
...

result:

ok 1000000 lines

Test #63:

score: 19
Accepted
time: 80ms
memory: 11960kb

input:

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

output:

1682886942
24547047035
28044067479
21544869984
37457824459
21807891666
12535873263
39058433438
15537998652
2799387492
33589097504
32808718666
6788665554
8354240532
49177937664
6588657240
16703830918
13056441408
22283139757
6172652706
15907683793
29853165323
40623679424
16570232136
30822528460
927439...

result:

ok 1000000 lines

Test #64:

score: 19
Accepted
time: 79ms
memory: 14012kb

input:

500 100 1000000
12 40
12 78
71 75
7 38
39 72
5 79
7 93
61 96
2 17
56 69
48 75
14 89
42 61
69 95
0 37
4 77
56 58
41 45
12 48
15 97
61 90
37 80
8 98
17 55
19 75
0 99
29 92
86 89
27 85
0 99
7 51
44 69
20 90
0 99
16 62
38 92
15 97
86 90
22 61
9 99
21 88
1 96
17 92
13 76
19 68
28 41
25 92
11 81
8 95
13 8...

output:

10988225774
5504731720
441633920
9290732611
6706382331
7857623930
11273383215
5345054639
9652306650
5914154221
8069547220
8866759952
3116937590
2592298060
10401981927
14936811345
3391814137
10333635330
12960453780
465646090
2798518461
7871021669
5722363002
8470234801
9682475574
12097205292
136381334...

result:

ok 1000000 lines

Test #65:

score: 19
Accepted
time: 78ms
memory: 14012kb

input:

500 300 1000000
88 185
41 237
53 271
0 298
27 290
84 228
195 288
189 233
3 296
36 221
9 217
29 236
200 217
176 268
178 192
94 290
112 255
195 237
257 260
51 283
166 255
81 289
157 261
9 266
68 191
84 278
2 192
69 288
15 286
183 293
68 146
45 252
16 285
30 183
113 273
17 280
79 154
29 136
97 196
9 29...

output:

1422329238
2919687863
7119642704
672800499
6014379402
4739246672
3069955647
7659622998
1337464440
6984813040
2222325756
1146485898
4938601596
466923060
8011461669
467153109
7689619432
4784843700
2054082828
5653772982
4884345216
3480035702
3979915008
458414901
79911189
1909412604
1990931154
648673532...

result:

ok 1000000 lines

Test #66:

score: 19
Accepted
time: 73ms
memory: 14260kb

input:

500 1000 1000000
454 771
520 972
748 827
83 997
498 578
513 670
514 920
539 721
87 955
275 756
57 823
169 975
94 478
382 999
562 922
160 946
228 836
839 965
470 867
151 755
34 860
399 415
185 687
162 269
640 697
203 244
323 862
121 627
132 898
220 381
575 742
665 745
584 921
10 244
346 491
139 979
4...

output:

91791012
667395126
201193380
532453492
368499806
311208270
153792080
271290494
1640604762
175231348
416012654
806280172
627119284
1459037444
1572592072
1013760144
1065223140
1053268520
1916359642
1571895280
262570982
8702284
1246993112
1257050644
131623928
1029866948
401820388
1548649184
325397498
1...

result:

ok 1000000 lines

Test #67:

score: 0
Runtime Error

input:

498 1000000000 1000000
275236581 909660211
282273693 552318537
72471176 596874952
5370144 157978009
218782810 764479143
542606339 595496083
77620368 904732953
103695080 188214441
230385264 349044110
335618885 745032822
42126459 107117126
504224060 780948498
56392775 133129896
279191324 948705048
324...

output:

Unauthorized output

result:


Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%