QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#360556#5437. Graph CompletingqwqUwU_AC ✓153ms200440kbC++142.6kb2024-03-21 21:33:032024-03-21 21:33:03

Judging History

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

  • [2024-03-21 21:33:03]
  • 评测
  • 测评结果:AC
  • 用时:153ms
  • 内存:200440kb
  • [2024-03-21 21:33:03]
  • 提交

answer

// clang-format off
#include<bits/stdc++.h>
#define pb push_back
#define P make_pair
#define st first
#define nd second
#define bit(s,x) (((s)>>(x))&1)
#define ctz(s) __builtin_popcount(s)
using namespace std;
typedef long long ll; 
typedef unsigned long long ull; 
//typedef __int128 i128; 
typedef long double ld;
typedef pair<int,int> pii; typedef pair<ll,int> pli; typedef pair<ll,ll> pll; typedef pair<int,ll> pil;
inline ll read(){
	ll x=0,f=1,c=getchar();
	while(c<'0'||c>'9')f=(c=='-'?-1:1),c=getchar();
	while(c>='0'&&c<='9')x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x*f;
}
inline void write(ll x){ if(x<0) putchar('-'),x=-x; if(x>9) write(x/10); putchar(x%10+'0'); }
// remember to change!!!
const int mod=998244353;
inline void plust(int &x,int y,int p=mod){x=x+y<p?x+y:x+y-p;}
inline void mul(int &x,int y,int p=mod){x=1ll*x*y%p;}
inline int fp(int x,ll p=mod-2,int m=mod,int res=1){
	for(;p;p>>=1){if(p&1)mul(res,x,m);mul(x,x,m);}
	return res;
}
const int N=5e3+3;
const int INF=0x3fffffff;
// clang-format on
int n,m;
vector<int>G[N],G2[N];
stack<int>stk;
int dfn[N],low[N],col[N],tim,dcc;
inline void dfs(int u,int fa){
	dfn[u]=low[u]=++tim;stk.push(u);
	for(auto v:G[u])if(v!=fa){
		if(!dfn[v]){
			dfs(v,u),low[u]=min(low[u],low[v]);
			if(low[v] == dfn[v]){
				++dcc;
				for(;stk.top()!=v;stk.pop())col[stk.top()]=dcc;
				stk.pop();col[v]=dcc;
			}
		}
		else low[u] = min(low[u],dfn[v]);
	}
}
int siz[N],eg[N],dp[N][N];
int p2[N*N];
inline void dfs2(int u,int fa){
	dp[u][siz[u]]=1;
	for(auto v:G2[u])if(v!=fa){
		dfs2(v,u);
		int s=0;
		vector<int>tmp(siz[u]+siz[v]+1);
		for(int i=1;i<=siz[v];++i)plust(s,dp[v][i]);
		for(int i=1;i<=siz[u];++i)tmp[i] = 1ll*dp[u][i]*(mod-s)%mod;
		for(int i=1;i<=siz[u];++i)for(int j=1;j<=siz[v];++j)plust(tmp[i+j],1ll*dp[u][i]*dp[v][j]%mod*p2[i*j-1]%mod);
		siz[u] += siz[v];
		for(int i=1;i<=siz[u];++i)dp[u][i] = tmp[i];
	}
}
int main() {
    //freopen("data.in", "r", stdin);
    // freopen(".in","r",stdin);
    // freopen("myans.out","w",stdout);
	p2[0]=1;
	for(int i=1;i<N*N;++i)p2[i] = 1ll*p2[i-1]*2%mod;
	n=read(),m=read();
	for(int i=1;i<=m;++i){
		int u=read(),v=read();
		G[u].pb(v),G[v].pb(u);
	}
	dfs(1,0);
	++dcc;for(;!stk.empty();stk.pop())col[stk.top()]=dcc;
	for(int i=1;i<=n;++i) ++siz[col[i]];
	for(int i=1;i<=n;++i) for(auto j:G[i])if(i<j){
		if(col[i] == col[j]){++eg[col[i]];continue;}
		G2[col[i]].pb(col[j]), G2[col[j]].pb(col[i]);
	}
	int t=1;
	for(int i=1;i<=dcc;++i)mul(t,p2[siz[i]*(siz[i]-1)/2 - eg[i]]);
	dfs2(1,0);
	int ans=0;
	for(int i=1;i<=n;++i)plust(ans,dp[1][i]);
	cout<<1ll*ans*t%mod<<"\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 89ms
memory: 102844kb

input:

3 2
1 2
2 3

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 81ms
memory: 103648kb

input:

4 4
1 2
2 3
3 4
4 1

output:

4

result:

ok 1 number(s): "4"

Test #3:

score: 0
Accepted
time: 98ms
memory: 103608kb

input:

2 1
1 2

output:

0

result:

ok 1 number(s): "0"

Test #4:

score: 0
Accepted
time: 89ms
memory: 103600kb

input:

3 3
1 2
2 3
3 1

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 89ms
memory: 102552kb

input:

4 3
1 2
2 3
3 4

output:

5

result:

ok 1 number(s): "5"

Test #6:

score: 0
Accepted
time: 89ms
memory: 102544kb

input:

4 3
1 2
1 3
1 4

output:

4

result:

ok 1 number(s): "4"

Test #7:

score: 0
Accepted
time: 94ms
memory: 105344kb

input:

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

output:

2

result:

ok 1 number(s): "2"

Test #8:

score: 0
Accepted
time: 82ms
memory: 102068kb

input:

4 6
1 2
2 3
3 4
4 1
1 3
2 4

output:

1

result:

ok 1 number(s): "1"

Test #9:

score: 0
Accepted
time: 86ms
memory: 102036kb

input:

141 9870
124 111
31 87
121 106
127 90
54 125
38 17
115 23
129 111
8 116
90 85
10 29
96 110
24 125
51 113
119 33
58 64
8 5
54 97
112 44
70 138
116 85
38 138
138 21
26 18
69 128
68 31
69 42
126 110
49 118
83 124
69 4
9 110
88 104
48 53
46 30
111 120
99 85
13 85
73 85
40 124
39 38
121 40
46 100
29 61
4...

output:

1

result:

ok 1 number(s): "1"

Test #10:

score: 0
Accepted
time: 91ms
memory: 103188kb

input:

142 10000
19 3
4 86
36 122
36 88
130 86
107 59
3 119
132 90
80 124
122 95
75 66
70 123
63 119
8 44
114 9
81 19
106 77
96 93
79 141
104 50
117 66
30 48
128 109
56 73
106 116
70 8
72 130
59 110
140 20
40 11
134 71
27 51
33 93
82 96
133 118
50 14
32 64
71 12
48 33
22 32
116 17
104 45
66 71
111 142
131 ...

output:

2048

result:

ok 1 number(s): "2048"

Test #11:

score: 0
Accepted
time: 90ms
memory: 103736kb

input:

200 10000
47 42
33 120
146 144
94 170
170 181
20 101
185 190
197 33
18 37
12 86
148 115
136 120
41 182
120 11
44 132
167 67
118 139
114 52
80 37
171 56
93 139
113 112
129 122
166 4
47 60
57 6
104 119
179 104
107 1
8 70
197 70
39 127
134 1
18 26
85 100
158 121
61 105
33 113
51 54
45 85
45 130
97 164
...

output:

365281854

result:

ok 1 number(s): "365281854"

Test #12:

score: 0
Accepted
time: 90ms
memory: 105540kb

input:

500 10000
453 98
266 181
170 163
213 8
447 241
197 380
44 136
383 217
142 351
252 381
34 87
8 100
173 306
322 35
481 398
267 493
94 457
391 198
381 436
455 468
481 415
307 470
376 1
178 480
379 75
133 248
466 165
394 296
302 50
142 42
388 454
92 239
63 310
118 159
397 257
282 308
137 370
24 389
353 ...

output:

980584487

result:

ok 1 number(s): "980584487"

Test #13:

score: 0
Accepted
time: 94ms
memory: 102488kb

input:

1000 10000
818 182
136 75
353 22
34 927
455 560
720 103
752 822
493 253
627 976
34 951
329 587
292 180
189 524
345 84
420 939
97 11
141 631
232 79
600 473
351 100
567 735
237 571
582 459
39 723
709 632
784 391
448 176
643 808
336 874
696 44
819 143
5 470
690 781
875 230
872 570
681 211
270 157
106 1...

output:

588230924

result:

ok 1 number(s): "588230924"

Test #14:

score: 0
Accepted
time: 87ms
memory: 103924kb

input:

2000 10000
820 636
1257 375
1342 1314
1243 1839
1469 1206
46 675
172 1422
1121 412
1882 900
1543 709
1811 727
1217 1205
1411 674
365 738
1184 1568
1781 1999
1591 556
1755 432
28 1231
1809 1461
270 1485
1087 1636
1471 1683
148 984
452 321
393 1844
800 1491
657 951
1943 1550
1593 924
1201 1474
1148 70...

output:

950164126

result:

ok 1 number(s): "950164126"

Test #15:

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

input:

5000 10000
2319 4192
4971 4546
4619 2058
1652 3642
2789 4237
2458 3238
2642 4855
2347 4170
1752 4173
2834 3683
1659 4380
4572 2645
116 4683
2667 3234
895 4589
2283 2027
53 3963
3590 726
783 3836
2019 722
3464 461
1805 2302
2404 3192
4015 3107
4256 1911
4734 3106
2902 3995
4592 2782
2099 478
3687 228...

output:

583179928

result:

ok 1 number(s): "583179928"

Test #16:

score: 0
Accepted
time: 143ms
memory: 198632kb

input:

5000 4999
2338 1012
4038 1912
2148 2944
1852 501
3624 2551
857 852
3031 1067
1102 808
2019 1627
1351 879
2463 4890
4431 724
1626 2136
2952 698
3556 378
1651 28
3163 3413
4862 2026
4448 104
3909 147
1718 862
4537 3495
20 1589
2520 2860
990 2316
727 4827
178 3027
4199 4590
683 4827
1724 3072
2717 1854...

output:

327217607

result:

ok 1 number(s): "327217607"

Test #17:

score: 0
Accepted
time: 147ms
memory: 199048kb

input:

5000 4999
900 1057
1438 871
129 49
3364 950
2628 2103
4737 3455
4038 1928
4953 2614
2063 387
3855 2903
1048 3621
4365 149
463 4726
772 4301
3310 2518
2340 2074
3338 4293
1719 3978
2276 1414
3531 3768
1105 1874
1429 4464
3624 4204
1628 3866
3104 4844
217 3582
1828 2650
2050 4317
938 2110
3301 3000
16...

output:

192742148

result:

ok 1 number(s): "192742148"

Test #18:

score: 0
Accepted
time: 141ms
memory: 200052kb

input:

5000 4999
684 4606
4488 3074
2368 3680
605 944
2423 4494
3550 3009
1936 4186
1192 2026
1178 1276
4130 2188
1625 2432
1252 525
2246 723
4925 2802
1570 426
3339 4012
1911 846
1246 93
3723 4701
1083 3118
1454 1231
1890 3105
2299 2859
183 1709
3795 3192
172 1141
1958 1935
4322 3687
2230 1317
2591 3113
3...

output:

883927828

result:

ok 1 number(s): "883927828"

Test #19:

score: 0
Accepted
time: 126ms
memory: 200152kb

input:

5000 4999
2387 599
1095 2475
3705 3783
4919 3010
1982 2086
1947 1120
2116 384
188 3812
1391 1156
3914 2521
171 3880
4596 3522
4298 3812
1502 2810
1786 131
2762 35
3009 2439
3045 1881
930 3228
413 1928
1215 899
4933 4777
1481 2281
2455 733
4266 4462
4071 1657
1604 4062
4153 1007
1637 4081
2006 4054
2...

output:

255927739

result:

ok 1 number(s): "255927739"

Test #20:

score: 0
Accepted
time: 153ms
memory: 199416kb

input:

5000 4999
4285 3047
2628 806
376 1906
3723 3855
2288 1040
1646 4070
2296 538
4449 1608
846 2519
4125 4225
2003 3366
1713 4225
2442 4465
2335 1261
4479 4109
4254 814
463 453
982 3886
4109 38
4347 71
4925 4641
3458 3242
1626 4516
3107 226
3409 2456
1488 2860
3973 3636
2128 3047
3918 982
1116 4605
2696...

output:

985107047

result:

ok 1 number(s): "985107047"

Test #21:

score: 0
Accepted
time: 136ms
memory: 199960kb

input:

5000 4999
4151 4433
120 4433
4433 3695
4433 1857
3963 4433
4433 3693
1361 4433
3933 4433
4433 2848
4433 1427
4477 4433
4433 3470
315 4433
4433 4069
2048 4433
4036 4433
864 4433
2276 4433
881 4433
4433 3171
4433 1969
4092 4433
93 4433
4433 3214
2598 4433
4433 142
1676 4433
4433 2133
2935 4433
4570 44...

output:

304255325

result:

ok 1 number(s): "304255325"

Test #22:

score: 0
Accepted
time: 137ms
memory: 198992kb

input:

5000 4999
3403 135
1409 4838
2740 3618
1415 4021
3008 777
1647 1771
199 3700
4467 3994
947 2516
2069 2507
2702 4848
411 4995
2566 2286
717 2063
556 1929
1455 3558
3681 1151
2892 1125
3773 492
158 3640
4935 3944
1216 2676
4525 3688
1364 2936
3359 4586
1100 3768
2835 4412
3105 325
3586 1662
31 4487
10...

output:

439137793

result:

ok 1 number(s): "439137793"

Test #23:

score: 0
Accepted
time: 137ms
memory: 199844kb

input:

5000 4999
699 1646
3138 1640
4600 234
3366 3433
969 4708
1703 592
3522 3138
2271 3138
4813 1068
1175 1068
3138 2554
3135 3138
4741 2408
2338 3138
1743 1663
2245 3521
2940 2103
4481 4982
2124 1748
2103 1824
4647 3326
2402 4536
3138 1406
2924 605
3209 2046
1965 2722
2103 305
1302 3587
227 4332
1068 33...

output:

537358047

result:

ok 1 number(s): "537358047"

Test #24:

score: 0
Accepted
time: 129ms
memory: 197304kb

input:

5000 5000
3538 1980
4034 4365
2972 291
1562 1169
3800 4649
1402 1928
3838 1857
2115 3420
2757 2583
1017 370
4441 2535
3096 3812
2966 967
4083 2427
2419 672
2741 590
2114 3931
1779 43
558 1348
156 881
4817 4318
2799 1750
4191 3247
536 3514
3345 1906
1833 1305
4341 378
4884 4290
3807 2383
1348 3628
23...

output:

260596042

result:

ok 1 number(s): "260596042"

Test #25:

score: 0
Accepted
time: 138ms
memory: 198352kb

input:

5000 5001
1060 1462
4870 973
1091 3733
3165 4080
2253 4245
1603 2501
4358 1415
2253 3087
2649 2236
2343 2654
4785 146
3726 2582
2293 3107
1907 389
941 1945
3088 3492
3111 1687
3802 2029
279 4591
1231 436
495 3791
4153 983
1573 2221
1728 2253
83 2704
4231 4561
2777 4552
1793 1163
2443 2253
79 1617
36...

output:

828056301

result:

ok 1 number(s): "828056301"

Test #26:

score: 0
Accepted
time: 139ms
memory: 200100kb

input:

5000 5002
1369 255
1644 3270
2063 2550
3689 2554
2137 3238
845 1513
3609 2136
2516 1724
4574 1575
196 2381
318 3985
4662 4376
2288 4225
2215 2400
868 685
722 994
3689 3941
2653 4955
638 4095
4360 1404
1489 2828
3450 2150
1460 3330
619 4687
1369 422
1566 2259
1643 2911
4046 2673
2553 801
985 3727
785...

output:

75926842

result:

ok 1 number(s): "75926842"

Test #27:

score: 0
Accepted
time: 131ms
memory: 191724kb

input:

5000 5003
3443 4929
518 2920
3122 708
4385 2034
835 2847
4624 376
4737 3567
1487 3145
3177 2908
1707 3645
4488 3082
4646 3446
2377 4652
3447 3496
559 2349
1266 995
1860 3318
4497 16
4408 2960
3441 3813
276 633
2572 2760
2746 1801
2627 156
4891 491
2555 2157
975 353
4497 1454
1575 2558
1432 2461
4300...

output:

588966935

result:

ok 1 number(s): "588966935"

Test #28:

score: 0
Accepted
time: 132ms
memory: 183948kb

input:

5000 5004
3043 4958
1889 2821
2916 274
453 1078
1489 1655
932 4730
4543 2018
4486 60
2183 4210
1541 3730
1814 4974
3730 3699
3402 1798
3178 3920
732 3475
1465 4900
1437 2220
2831 239
460 203
4730 1847
1507 1976
470 2170
2969 3276
4431 925
1906 4193
1167 1679
4074 3866
4524 4152
1664 2295
272 3730
47...

output:

246584470

result:

ok 1 number(s): "246584470"

Test #29:

score: 0
Accepted
time: 135ms
memory: 192456kb

input:

5000 5005
1568 4464
4187 3962
1969 3025
1607 3573
4893 2060
3861 3285
3531 2060
4372 2438
3374 3344
2645 2569
1864 3375
4964 3687
3452 4728
2539 3653
4408 4862
3879 4045
1094 2844
2447 3066
1824 3573
1774 616
3816 376
1746 2060
3573 3037
994 537
2060 4611
2130 3573
4324 1856
397 4180
884 1374
3573 4...

output:

203655663

result:

ok 1 number(s): "203655663"

Test #30:

score: 0
Accepted
time: 135ms
memory: 187540kb

input:

5000 5006
2152 3794
2497 1572
4610 1158
1958 4363
4663 2227
1958 249
2275 3019
2516 680
4153 3220
1521 3525
4286 1809
95 254
1774 3600
1841 3185
862 2392
2289 107
1155 4867
967 106
338 905
2573 2488
1074 3539
4651 2386
879 4574
4764 4184
2047 1851
4649 3152
3532 1158
2899 4336
4071 2188
237 977
3085...

output:

579831851

result:

ok 1 number(s): "579831851"

Test #31:

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

input:

5000 5007
842 2913
2709 411
7 3610
2158 3189
1109 1137
3058 2143
145 4455
478 3063
1686 2852
4091 172
3040 2489
879 1448
804 4570
1060 2567
1102 2140
4149 1046
3939 2149
2253 2895
126 1933
2464 3511
3885 2428
4200 1839
4835 4091
712 3424
2261 1585
2257 3935
930 1776
2378 807
403 3494
4518 3041
395 4...

output:

179515872

result:

ok 1 number(s): "179515872"

Test #32:

score: 0
Accepted
time: 127ms
memory: 183096kb

input:

5000 5008
247 3054
4449 4406
3107 702
2022 4710
206 2461
4914 4724
4036 3011
993 3054
623 1680
3480 659
4314 3953
3535 2330
4882 3521
1832 324
173 2421
4223 1686
1483 4737
1401 2337
4322 787
551 3879
4418 4717
1945 1829
3177 2543
588 2047
1719 4686
3896 1789
1300 2609
3500 712
3829 2329
162 582
560 ...

output:

364458675

result:

ok 1 number(s): "364458675"

Test #33:

score: 0
Accepted
time: 130ms
memory: 184264kb

input:

5000 5009
3424 1042
1481 729
3854 3851
1859 1660
3458 2272
3736 4496
3455 2338
4867 4599
2372 4490
785 891
3664 4846
2338 196
3144 268
959 2338
4619 1158
2846 2338
4898 1935
2808 3179
4987 3396
3259 3696
15 4268
2579 2512
4462 40
2509 1859
2338 3694
2108 2809
218 1134
3966 4928
2230 3069
4037 4329
1...

output:

596423312

result:

ok 1 number(s): "596423312"

Test #34:

score: 0
Accepted
time: 131ms
memory: 189928kb

input:

5000 5010
4419 1224
4776 4058
2292 4522
4703 4113
2706 3428
2219 3287
3700 2359
3988 56
3912 3150
137 4562
2009 4832
2678 1161
2882 2458
477 1490
903 515
4008 2014
983 4304
1391 4178
603 3643
3956 2159
720 4620
4708 321
912 3354
3526 3626
4557 4864
962 558
2048 4942
825 4278
555 1189
4520 1411
3344 ...

output:

192132691

result:

ok 1 number(s): "192132691"

Test #35:

score: 0
Accepted
time: 123ms
memory: 196480kb

input:

5000 5010
3381 3844
2152 4336
2928 3867
3417 1817
3719 4794
4910 2601
1401 422
316 1621
3205 1658
1776 4397
4393 3650
2383 2950
1092 4027
2971 3785
576 3074
2327 3763
4561 4318
644 2772
1705 2175
4804 1532
849 2492
2201 1345
2749 3876
2768 465
1476 4145
4043 4582
2352 2954
4062 2893
3095 2878
1095 4...

output:

387088506

result:

ok 1 number(s): "387088506"

Test #36:

score: 0
Accepted
time: 137ms
memory: 164812kb

input:

5000 5010
2132 2822
73 648
3499 483
2197 1457
3267 3755
1839 1735
3381 2650
934 2945
2049 131
3026 2944
200 2257
1861 4309
3261 630
3828 4269
2946 3289
3840 4060
1587 908
3852 3223
2182 2540
3934 4233
4370 2244
2830 1088
3513 3047
2440 1093
1616 454
3785 4913
2160 1511
4692 4058
2554 1246
1585 1247
...

output:

440650

result:

ok 1 number(s): "440650"

Test #37:

score: 0
Accepted
time: 102ms
memory: 109560kb

input:

5000 5010
2874 2215
4119 4537
1169 1961
1903 4935
3209 658
738 3501
168 4038
4405 2293
925 122
4537 768
3877 4833
4504 3336
3845 4204
2495 3239
168 1644
3173 3180
3171 4424
1193 4665
1385 4378
317 3066
88 2516
1341 2210
4753 17
2383 1116
3483 1439
1006 4205
4642 276
4628 2760
245 3021
4378 180
1811 ...

output:

444653610

result:

ok 1 number(s): "444653610"

Test #38:

score: 0
Accepted
time: 141ms
memory: 199880kb

input:

5000 5010
2259 4894
928 396
1033 3274
2853 2689
4332 3911
2920 3656
2459 3411
4081 417
4987 2528
4874 4058
4791 3591
305 1949
1651 2684
2314 1866
886 4378
4957 4730
45 2261
415 1644
2727 898
4120 1664
3905 4848
3122 1923
3453 4757
983 3989
2290 4471
1715 2748
3290 4242
1770 4460
2780 4835
4679 4611
...

output:

946250223

result:

ok 1 number(s): "946250223"

Test #39:

score: 0
Accepted
time: 129ms
memory: 199924kb

input:

5000 5010
3737 3474
3474 2110
3474 2547
3474 2314
2462 3474
3474 1470
2485 3474
3474 4228
1463 3474
2682 3474
1137 3474
3488 3474
3327 3474
3474 3527
1312 3474
2023 3474
2737 3474
3474 990
3474 942
3474 4651
418 3474
3474 4112
4810 3474
3474 977
1351 3474
1704 3474
1208 3474
2348 3474
4299 3474
3474...

output:

746037837

result:

ok 1 number(s): "746037837"

Test #40:

score: 0
Accepted
time: 124ms
memory: 177300kb

input:

5000 5010
4521 4688
4197 1398
2983 3012
599 2229
2368 1866
3102 4959
848 3677
2948 242
4875 2562
4334 1869
1490 4074
4463 168
1943 3074
1735 2637
3032 633
1957 593
2132 3446
1781 2185
2385 3945
2574 138
339 1653
1200 1146
3107 2642
334 4458
1269 2123
4757 3960
1831 5000
3112 1793
2477 1319
4513 2267...

output:

880463316

result:

ok 1 number(s): "880463316"

Test #41:

score: 0
Accepted
time: 137ms
memory: 182860kb

input:

5000 5010
4345 3365
3488 429
1734 3885
4632 2652
2399 3040
836 2160
320 3530
1447 1440
4007 461
579 3571
4932 776
2099 3572
3655 2160
2917 956
2160 2594
3267 1841
4939 2477
4887 703
2096 222
4104 4166
1534 1867
4117 1232
4805 253
1814 817
1374 1135
4322 4840
2442 4023
4434 2906
2255 3837
3884 1217
1...

output:

562560379

result:

ok 1 number(s): "562560379"

Test #42:

score: 0
Accepted
time: 137ms
memory: 186500kb

input:

5000 5020
1648 1988
4907 3918
664 2380
801 4182
3170 1062
4335 4661
4215 1084
1988 470
1976 2326
86 116
1988 728
93 4788
3245 4917
891 717
665 2103
2622 3252
3125 4964
165 2758
1735 3252
4392 1984
1533 1751
599 955
98 830
3948 2970
591 1594
1504 2088
3073 750
4073 3252
3450 658
4247 4501
359 935
198...

output:

933739069

result:

ok 1 number(s): "933739069"

Test #43:

score: 0
Accepted
time: 123ms
memory: 158700kb

input:

5000 5030
3867 2909
2437 1635
2811 3172
4258 3780
3773 1144
4022 2185
2688 3581
1751 3134
4542 1071
4987 4054
1826 2855
4972 1239
3225 4678
3854 4005
784 3522
1301 4580
2396 4855
4830 1370
2711 3149
3323 2916
474 4206
2476 4070
2241 1504
4110 4528
2512 971
1226 1879
4987 2965
28 255
1951 1858
1322 3...

output:

290123872

result:

ok 1 number(s): "290123872"

Test #44:

score: 0
Accepted
time: 120ms
memory: 174144kb

input:

5000 5040
2986 2021
820 793
4098 2525
3847 184
859 2419
1792 4789
1207 3413
2149 3750
3725 4732
3809 974
617 4764
4339 3769
378 3436
2894 606
3647 1201
4227 4950
2621 4341
3371 4669
881 174
576 734
1503 2819
4491 1187
230 745
1927 3309
3014 4462
2239 3038
2951 3961
1440 3697
1152 2958
1710 1832
3010...

output:

484542926

result:

ok 1 number(s): "484542926"

Test #45:

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

input:

5000 5050
2167 2234
2437 2818
4633 1670
637 2162
1436 3543
1400 2225
4360 1485
1376 3626
4941 513
2509 4732
4803 2587
3157 2876
3705 3375
3284 4833
4938 1458
4318 2663
3281 4755
301 503
4193 2812
1864 4090
3089 540
4804 2826
4668 876
951 1443
1302 4836
267 4063
2722 2840
3151 582
1992 2859
4607 72
4...

output:

424678908

result:

ok 1 number(s): "424678908"

Test #46:

score: 0
Accepted
time: 114ms
memory: 172440kb

input:

5000 5060
1003 3424
1988 526
1944 53
2362 1193
818 1283
2385 618
446 846
4183 3126
4744 4722
388 2037
2993 2565
803 3008
2637 2276
257 3902
1234 1970
2170 4831
2763 1863
843 1747
4637 4995
3621 1731
835 771
1524 1960
908 975
1601 4678
4730 1486
4962 1934
1852 3440
646 623
4898 3798
4598 249
288 1886...

output:

485011121

result:

ok 1 number(s): "485011121"

Test #47:

score: 0
Accepted
time: 129ms
memory: 171856kb

input:

5000 5070
2335 3634
1273 4178
1422 3547
2703 2533
4916 1463
1908 2623
3703 373
435 1938
646 769
712 311
3371 4104
3691 1786
4864 112
3337 916
2206 1552
3411 677
832 2380
3851 2491
1639 375
776 2081
3390 996
2533 2644
1676 794
2876 1385
4263 1466
1292 1184
4738 3460
1919 4375
4178 1509
1597 3784
3411...

output:

84785011

result:

ok 1 number(s): "84785011"

Test #48:

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

input:

5000 5080
3924 1515
4240 3063
2613 2356
1805 4402
2897 2263
260 2241
4120 392
3526 2420
1600 3714
1670 779
1843 3740
710 3386
1805 2700
1244 1544
3689 1488
3042 4803
861 2692
2419 3154
2713 3
4394 2919
3706 2722
2098 246
4975 1778
4649 3813
563 4668
2649 3453
2184 1062
2893 4519
4412 1871
1551 1805
...

output:

717036054

result:

ok 1 number(s): "717036054"

Test #49:

score: 0
Accepted
time: 117ms
memory: 163492kb

input:

5000 5090
916 3236
78 267
332 3924
2117 25
4360 3559
4053 3001
1280 4365
4504 640
4920 1184
58 3994
4813 3145
2274 259
1691 497
2218 342
1594 635
739 1675
2477 4780
3381 207
4949 4556
1610 2822
1592 4183
3351 2969
4765 2681
2257 3223
4619 2432
2255 588
299 525
2747 1691
1691 4926
4465 1233
1691 4787...

output:

65386033

result:

ok 1 number(s): "65386033"

Test #50:

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

input:

5000 5100
357 710
2333 38
4389 4239
2828 4138
3442 2777
1719 3281
2786 3490
3029 2701
216 1201
4308 1978
4643 4776
1093 2625
94 4652
2385 2255
1879 3092
2169 4183
391 4856
4730 4059
3472 2567
4203 2629
258 252
3041 2628
3238 1792
4048 766
3875 3968
3592 514
3734 155
3486 3838
1640 1895
3058 4328
234...

output:

591640461

result:

ok 1 number(s): "591640461"

Test #51:

score: 0
Accepted
time: 134ms
memory: 182276kb

input:

5000 5100
4701 2146
4406 1698
1601 1136
3273 827
133 4642
3181 4473
4436 3383
2289 4396
3199 4540
2909 1252
451 2550
793 2799
4232 2751
157 3498
2903 820
2322 660
936 1450
942 1390
2484 997
57 2523
263 4167
4164 3699
4008 3066
4669 460
608 3560
4057 1960
3501 3709
630 1181
397 3413
3155 4866
3208 27...

output:

783840300

result:

ok 1 number(s): "783840300"

Test #52:

score: 0
Accepted
time: 134ms
memory: 169044kb

input:

5000 5100
4257 1318
475 583
1245 2869
2648 4840
383 3861
2896 3216
4280 4902
1075 917
3508 4662
1144 623
2810 4250
1163 1016
3894 1204
2509 4484
2636 1367
1027 2958
3731 1893
3510 244
565 2951
2005 1960
2236 1996
464 2678
4321 4353
901 4270
733 68
1304 1102
4643 4845
1687 4711
1172 2111
1490 1933
19...

output:

784919376

result:

ok 1 number(s): "784919376"

Test #53:

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

input:

5000 5100
4539 3662
1267 3352
3547 4373
4168 4608
2582 1037
2290 2520
36 159
4613 1650
1334 32
4958 3135
441 4090
3858 1350
1319 462
1105 4807
2739 1900
1781 2025
3870 3216
1981 189
322 3177
1604 2105
4218 773
325 4499
2681 4086
2472 3479
2566 2325
4381 1501
297 2271
4602 3997
4659 4088
3753 1095
48...

output:

774244927

result:

ok 1 number(s): "774244927"

Test #54:

score: 0
Accepted
time: 130ms
memory: 189880kb

input:

5000 5100
3605 1719
4843 3624
4574 730
3505 4651
2434 161
1513 2770
3848 1227
4519 4500
2538 4350
632 1702
1727 3245
3666 1743
3532 2975
413 1625
533 4205
4167 1974
3235 2209
3908 4310
3614 2919
3582 230
3235 1808
2917 3
4310 1884
4449 2590
1724 2671
2019 4782
1711 3213
3250 1427
4197 2604
4703 1306...

output:

398896499

result:

ok 1 number(s): "398896499"

Test #55:

score: 0
Accepted
time: 132ms
memory: 196060kb

input:

5000 5100
3695 498
4599 498
498 3283
498 2961
2106 498
3795 498
1078 498
3470 498
590 498
4966 498
3296 498
3584 4174
498 1006
498 4310
498 1990
2724 498
498 1832
719 498
498 4470
2592 498
3307 498
498 676
498 4853
498 1843
4828 498
498 246
1282 498
854 498
816 498
2204 498
498 542
498 3688
3990 498...

output:

451375782

result:

ok 1 number(s): "451375782"

Test #56:

score: 0
Accepted
time: 107ms
memory: 137544kb

input:

5000 5100
2643 2689
4572 1347
3436 793
1274 130
4602 2564
3533 1716
303 1564
1424 505
1878 1442
58 3334
4375 3199
2349 2267
3188 169
884 3416
4197 2374
2612 645
2501 301
3512 3622
1374 3580
2421 4027
4075 2571
2846 727
3786 399
4008 4684
926 2183
4629 1152
2947 1297
4244 4456
621 1670
3919 2047
2182...

output:

188087211

result:

ok 1 number(s): "188087211"

Test #57:

score: 0
Accepted
time: 129ms
memory: 167196kb

input:

5000 5100
3161 2635
1872 4206
1032 4824
238 3173
2377 1330
3643 4536
3933 1576
1584 3316
1604 3848
1671 454
858 1578
3705 2557
1499 532
3268 3211
1125 1064
1381 4631
2712 2265
2099 264
2222 3884
1605 238
763 3107
1019 1286
2656 4819
4765 4421
3024 38
1216 2551
772 2248
4177 1670
1803 955
2686 3844
4...

output:

928186741

result:

ok 1 number(s): "928186741"

Test #58:

score: 0
Accepted
time: 124ms
memory: 154080kb

input:

5000 5200
4219 1683
141 2129
4843 1479
1258 2429
2693 1469
849 4457
1937 1850
3429 4853
3491 302
3483 2533
3460 2807
3053 316
3491 834
2580 3179
4444 3656
1307 2768
1127 1349
3357 903
1287 2474
823 3523
1103 206
3869 2815
1003 4789
3853 4749
309 3263
4592 2208
669 4597
2224 4519
3982 396
1589 382
31...

output:

187538861

result:

ok 1 number(s): "187538861"

Test #59:

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

input:

5000 5300
430 4974
3570 286
2748 1356
857 654
1692 326
1743 890
4164 2378
1537 4328
4504 450
1285 4726
4287 4119
1098 1759
4132 3570
921 693
1075 705
3098 921
4628 3570
3570 1968
983 1134
2355 3570
562 1617
1073 4840
2907 2543
2144 3561
4065 3456
4322 2954
772 3570
440 3397
4692 4333
4976 3570
4328 ...

output:

702860807

result:

ok 1 number(s): "702860807"

Test #60:

score: 0
Accepted
time: 121ms
memory: 154716kb

input:

5000 5400
4565 2988
4539 2178
229 2403
4840 965
1192 3349
4949 3416
2063 4879
1433 616
1338 4717
4498 380
3566 610
833 2496
3623 881
420 3633
4876 833
4884 170
1429 879
1434 474
934 3728
4795 447
3220 4197
4028 1604
3832 2111
1590 4103
2377 1210
4855 4985
1245 3631
591 3757
3802 3705
3719 359
4187 4...

output:

465825795

result:

ok 1 number(s): "465825795"

Test #61:

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

input:

5000 5500
4209 3759
4303 1882
1046 3796
2184 2914
1863 3884
2842 3759
4163 1938
2286 2793
1893 4230
3268 3759
1060 4230
3254 1865
109 840
261 4280
4230 4575
2568 2850
152 1018
35 4592
1439 2209
2286 225
4230 888
1407 4230
2194 4163
1954 297
4736 1882
3759 2018
4163 1983
1636 307
3264 1882
3100 3982
...

output:

725760155

result:

ok 1 number(s): "725760155"

Test #62:

score: 0
Accepted
time: 120ms
memory: 145396kb

input:

5000 5600
1069 2024
2981 4972
4692 3219
1895 365
3699 3678
1342 3587
4187 3037
1196 3057
3981 960
802 1405
143 1795
1575 326
4786 1581
3207 4504
4263 1852
1722 1419
1837 4860
824 1283
4118 1447
1074 4722
3225 874
3617 4676
154 1428
363 4858
187 3210
3891 1132
3565 135
3529 2101
4748 1509
2957 209
42...

output:

597799000

result:

ok 1 number(s): "597799000"

Test #63:

score: 0
Accepted
time: 117ms
memory: 143868kb

input:

5000 5700
2672 3986
1650 4617
2683 4795
885 618
3174 408
4047 1350
921 1234
1431 1457
345 526
4691 4600
3601 307
758 1130
1259 3863
2972 3853
2960 2601
971 389
4672 3548
658 4592
4993 3130
1736 3971
2165 3787
4964 2211
4722 3078
3443 2468
2486 3495
4842 305
1195 3493
751 4275
4179 2963
2904 320
1674...

output:

827274883

result:

ok 1 number(s): "827274883"

Test #64:

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

input:

5000 5800
1257 2931
1288 3528
3330 1688
1184 3438
3255 3171
473 3695
4129 2782
4858 2212
3528 3128
347 2054
2324 3012
1144 1701
2702 1850
4205 1830
3528 1761
2057 438
3833 3500
421 4886
4291 347
2024 1024
2816 4798
4069 470
1137 1958
1219 2691
1441 112
2183 4539
2964 4099
1591 3364
3800 1613
859 423...

output:

851962362

result:

ok 1 number(s): "851962362"

Test #65:

score: 0
Accepted
time: 120ms
memory: 139432kb

input:

5000 5900
212 3376
978 4362
4572 4887
4309 3972
3099 4839
1488 3446
4224 2788
1071 134
4358 4545
879 175
2654 121
2750 4122
4064 3366
1810 3845
4886 4279
3648 4308
374 3122
4128 546
3468 4002
776 4853
1089 1917
2503 4242
1357 3805
354 243
3931 1755
4546 2118
4739 841
3668 3285
1947 2225
1186 4954
25...

output:

248705659

result:

ok 1 number(s): "248705659"

Test #66:

score: 0
Accepted
time: 117ms
memory: 136176kb

input:

5000 6000
3862 4536
2754 3433
1956 4242
2588 3704
48 2549
942 4324
1949 3945
2113 1073
3192 2163
1089 1732
4831 1775
1196 2844
1869 4906
2062 2264
183 706
3580 271
3953 4564
1450 2287
1896 1558
2939 1795
2437 4964
4801 1645
1899 1566
3632 2544
3028 54
3168 3283
178 197
3770 671
4270 4207
1614 3041
4...

output:

524954268

result:

ok 1 number(s): "524954268"

Test #67:

score: 0
Accepted
time: 123ms
memory: 140152kb

input:

5000 6000
3678 3934
3582 904
438 1772
3086 1206
4660 3459
330 1988
3609 913
2149 892
2565 484
2769 1786
4419 1574
1975 3549
3979 3017
3236 1926
2421 2366
4883 1868
2009 867
2676 2511
1467 4933
2204 3721
867 3738
1732 2301
4113 1384
223 3389
449 2342
3810 2924
3737 2054
191 618
4494 4828
3189 2405
13...

output:

286600339

result:

ok 1 number(s): "286600339"

Test #68:

score: 0
Accepted
time: 110ms
memory: 139332kb

input:

5000 6000
3300 1429
1920 2171
4435 1801
2002 1992
4419 1724
3711 3463
212 772
447 3313
1352 839
159 205
2093 3058
3875 1479
3452 3172
1002 3212
2265 756
4647 2743
2726 3376
491 855
2082 134
1203 1461
1249 4979
256 755
1829 4746
1706 49
4676 3461
1332 1938
2339 971
2027 1585
50 2469
4938 3201
1434 26...

output:

993098110

result:

ok 1 number(s): "993098110"

Test #69:

score: 0
Accepted
time: 87ms
memory: 103424kb

input:

5000 6000
4270 3273
2365 3581
667 976
2701 3091
2441 3981
4246 2840
4692 3533
2086 3193
1874 4021
2291 3357
3068 2720
1978 2546
4109 1841
4593 3573
4952 812
1092 780
2041 3313
4124 5
844 1404
3769 1651
83 4166
4856 4108
1011 696
2736 4294
114 3246
952 3271
2676 1058
398 2466
2519 1377
4347 4560
4644...

output:

411010531

result:

ok 1 number(s): "411010531"

Test #70:

score: 0
Accepted
time: 135ms
memory: 161176kb

input:

5000 6000
768 96
975 2149
1768 1195
778 1019
949 3158
373 4864
4286 104
3769 229
4023 3048
4807 2432
3802 3200
1811 50
2217 3749
3025 974
3390 217
3964 3692
2453 591
1984 1906
3782 4452
3678 2353
3442 1560
1334 118
530 192
2875 4370
1637 109
3853 162
2596 1239
986 3136
4816 319
426 457
978 902
252 2...

output:

961628177

result:

ok 1 number(s): "961628177"

Test #71:

score: 0
Accepted
time: 138ms
memory: 168152kb

input:

5000 6000
771 591
4503 4213
591 4506
3277 591
591 1435
591 3438
137 591
591 2288
591 1713
591 4351
591 191
614 4562
2041 591
2302 4255
255 202
4182 591
2137 1386
980 1595
1526 591
591 2411
591 342
591 4818
2090 591
1877 591
3066 591
2669 591
783 591
4512 591
3886 591
2062 591
591 2640
816 591
591 40...

output:

341283262

result:

ok 1 number(s): "341283262"

Test #72:

score: 0
Accepted
time: 87ms
memory: 105512kb

input:

5000 6000
4835 1801
3309 3730
4969 1582
4424 2683
3562 4029
3771 425
4072 3948
4658 818
1456 2828
1999 206
318 4762
963 652
4889 3147
2328 3010
4378 2547
1322 369
1379 90
3576 4740
3999 3888
669 450
4838 3209
2474 2495
4338 2286
4102 2181
1578 3651
870 3821
1655 2295
3737 1604
275 66
2461 151
179 33...

output:

25001508

result:

ok 1 number(s): "25001508"

Test #73:

score: 0
Accepted
time: 116ms
memory: 145416kb

input:

5000 6000
2689 1692
4483 3621
3918 3186
2689 4168
4382 412
4428 4167
2689 4946
762 4938
4098 2572
242 2861
1872 2729
4428 1064
101 3889
887 2689
4083 4428
1999 3444
4188 181
3816 3174
752 1717
763 2734
4446 621
4146 4428
4428 3682
1835 3608
2689 4430
4721 2810
2633 763
1327 2693
2689 76
2689 3548
41...

output:

236725432

result:

ok 1 number(s): "236725432"

Test #74:

score: 0
Accepted
time: 109ms
memory: 122024kb

input:

5000 7000
2956 3803
2058 4114
1730 1059
4308 907
637 3844
601 3761
1459 339
14 1351
217 1212
2066 4332
2714 1308
2372 208
3120 4249
2223 1415
177 4579
1415 1132
3764 4791
215 2256
2552 3545
4889 2283
4568 2914
3656 854
741 4430
10 3928
3326 3788
706 321
2812 956
1008 1009
4411 1256
1108 2287
4445 69...

output:

944250423

result:

ok 1 number(s): "944250423"

Test #75:

score: 0
Accepted
time: 109ms
memory: 116948kb

input:

5000 8000
2688 611
1328 1748
658 478
2038 4508
690 4836
528 2020
4157 2621
3607 4698
3280 1432
4752 2228
4994 2581
3402 3125
759 4195
3466 4666
4917 695
323 799
3686 1216
222 1966
3773 4377
1212 2379
4261 336
2421 279
3046 2896
165 3925
3918 4238
1185 2750
1432 2330
629 3968
1469 1647
2810 2599
1878...

output:

553433460

result:

ok 1 number(s): "553433460"

Test #76:

score: 0
Accepted
time: 106ms
memory: 114400kb

input:

5000 9000
1488 1382
3226 1382
2701 1966
2767 4926
1239 2837
3181 1723
2377 4397
3181 2514
2945 4200
3072 1966
2701 4192
1092 422
4939 2271
3217 1300
4047 294
3181 4345
3739 3089
2278 2701
4743 3568
4999 2180
4699 490
1682 3490
277 3096
278 1382
2096 750
1828 1340
3302 1736
43 4392
3488 944
1246 3553...

output:

649442361

result:

ok 1 number(s): "649442361"

Test #77:

score: 0
Accepted
time: 96ms
memory: 108412kb

input:

5000 10000
588 4568
786 802
4305 2297
3951 477
634 548
3044 1019
3920 3656
3301 1605
1216 4949
141 2768
1304 4254
2496 946
1012 3509
4437 1672
3516 30
564 1811
2838 2004
1048 2561
1755 2032
1440 2595
2688 1526
3185 168
2541 3132
2328 85
702 780
2408 1654
4442 1553
486 1469
973 2708
3851 2148
2206 18...

output:

85367948

result:

ok 1 number(s): "85367948"

Test #78:

score: 0
Accepted
time: 97ms
memory: 106944kb

input:

5000 10000
2996 4534
1470 1826
2556 905
4126 2249
191 1620
2606 3751
1060 4847
4665 1753
1742 4948
2335 2136
2632 140
2051 4000
4057 2996
1170 3781
3811 3895
2147 1614
4106 3801
1941 1530
1164 4469
3503 2155
208 3772
3302 3910
3575 1632
1473 1380
325 1654
3926 4802
1185 2925
69 4774
4640 3168
4964 3...

output:

442405976

result:

ok 1 number(s): "442405976"

Test #79:

score: 0
Accepted
time: 102ms
memory: 110756kb

input:

5000 10000
1648 203
639 933
1393 1647
1124 3198
3807 1228
4943 4331
391 2326
949 556
11 3116
2471 2151
924 1323
2286 3210
4640 4626
914 3025
1778 1659
4216 200
2103 1266
291 1492
381 216
3801 4449
4342 1707
1380 641
2504 593
3138 69
3201 807
4537 4013
3709 2069
4695 4458
3243 2215
3879 2147
285 3425...

output:

778149262

result:

ok 1 number(s): "778149262"

Test #80:

score: 0
Accepted
time: 91ms
memory: 102188kb

input:

5000 10000
702 3665
318 3340
2767 1601
2396 3310
3867 2399
2454 1690
1677 2134
2586 2248
347 3225
1378 813
1152 292
2907 3810
3751 1890
3343 3368
4405 3341
346 1416
993 3259
433 4276
4098 4900
1861 2775
2870 3817
4908 2496
4171 1689
2708 454
1842 721
394 621
1222 46
2849 1975
2954 1144
1314 1992
151...

output:

240273594

result:

ok 1 number(s): "240273594"

Test #81:

score: 0
Accepted
time: 98ms
memory: 109336kb

input:

5000 10000
4182 1244
2951 3193
925 4220
646 2761
4778 4692
3098 4465
4604 635
4735 1984
4822 4220
1565 2420
4867 4396
2145 4794
2477 2211
3154 3259
1514 3921
1182 132
1683 2666
4446 3920
1526 3935
2653 865
1561 4306
1283 2694
1987 3261
4486 3895
3950 65
3370 3090
1337 2237
2782 4346
2303 513
3549 10...

output:

164600781

result:

ok 1 number(s): "164600781"

Test #82:

score: 0
Accepted
time: 109ms
memory: 115568kb

input:

5000 10000
4645 2267
4170 2351
4596 1509
2267 390
1647 1048
1156 2267
2806 2267
4365 370
742 3833
129 4135
2267 4419
4132 203
2415 2182
2267 3455
451 2037
4396 2267
4650 3537
1475 4633
2458 3828
2963 4981
2267 4152
2157 3666
2285 4285
2267 3385
1792 925
1764 4957
2267 841
1254 3960
4832 2267
4820 22...

output:

389435823

result:

ok 1 number(s): "389435823"

Test #83:

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

input:

5000 10000
3706 1646
2324 3904
4189 2357
1764 3048
714 1340
3679 805
2308 2981
3148 4169
3891 4803
1769 485
94 869
2067 1279
1767 421
135 2391
1932 1979
2659 302
709 4130
4365 1529
2700 4403
3763 1578
2642 3309
4165 1427
167 1196
1637 3903
1716 453
4388 1520
940 1575
2286 1640
4651 1125
2481 914
124...

output:

144741200

result:

ok 1 number(s): "144741200"

Test #84:

score: 0
Accepted
time: 89ms
memory: 108564kb

input:

5000 10000
2272 800
1027 1151
218 314
2607 4207
4652 2032
4541 4806
3467 3249
4270 4995
4361 1626
643 1274
2604 3463
4909 29
4542 4373
3367 1801
2165 172
2624 963
1477 3054
2477 1762
35 227
4954 2487
4518 1664
3148 4762
4689 2715
1749 3089
1897 476
1134 3837
3118 1627
4449 1263
2641 526
959 3278
56 ...

output:

616715702

result:

ok 1 number(s): "616715702"

Test #85:

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

input:

5000 10000
3785 4154
4419 2359
3094 989
1339 2535
3807 104
1837 2064
1984 4287
1840 1151
3181 2234
3944 3975
3209 3615
512 3301
3642 3835
2679 291
2173 1154
564 1610
298 4296
751 2062
1309 4432
1852 23
3871 4827
1549 1398
3487 540
2634 4296
1635 3739
3155 1946
4866 1543
2116 4280
2253 4299
3364 3920...

output:

901333245

result:

ok 1 number(s): "901333245"

Test #86:

score: 0
Accepted
time: 115ms
memory: 143928kb

input:

5000 10000
2535 2418
1471 4526
2416 778
1846 3619
4749 1358
2637 1495
431 2929
450 3412
1900 2636
2592 1585
4874 2047
1339 2667
2638 2172
2636 2489
1278 2334
1630 4379
4784 1310
3502 2428
3765 2629
724 2925
660 3508
2930 4362
4083 4605
2713 4033
721 2075
2766 4938
2782 4230
2586 3183
3945 434
3848 4...

output:

685911080

result:

ok 1 number(s): "685911080"

Test #87:

score: 0
Accepted
time: 126ms
memory: 157416kb

input:

5000 10000
1785 1435
1987 3061
4786 621
3916 2467
4150 1174
3020 710
3042 1869
514 4037
3949 664
2489 4919
4825 4727
3731 1040
206 4951
3754 4314
3757 1549
1848 170
255 3789
1427 2905
2184 3117
595 2595
2310 1005
4184 3299
4741 3336
3623 1269
1622 2891
4344 4303
1549 3266
1302 4290
4482 2411
1638 48...

output:

673736895

result:

ok 1 number(s): "673736895"

Test #88:

score: 0
Accepted
time: 135ms
memory: 200440kb

input:

5000 4999
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
5...

output:

255927739

result:

ok 1 number(s): "255927739"

Test #89:

score: 0
Accepted
time: 90ms
memory: 103316kb

input:

5000 5000
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
5...

output:

715970461

result:

ok 1 number(s): "715970461"