QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#408294#8174. Set ConstructionNetwork_ErrorAC ✓337ms3816kbC++141.4kb2024-05-09 23:29:352024-05-09 23:29:37

Judging History

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

  • [2024-05-09 23:29:37]
  • 评测
  • 测评结果:AC
  • 用时:337ms
  • 内存:3816kb
  • [2024-05-09 23:29:35]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define int long long
int n,m;
map<int,bool> vis;
vector<int> st,ans;
bool chk(){
	for(int i=1;i<st.size();i++)
		for(int j=0;j<i;j++) 
			if(!vis[st[i]|st[j]]||!vis[st[i]&st[j]])return 0; return 1;
}
bool dfs(int i,int n,int m){
	if(st.size()>m)return 0;
	if(i>=(1ll<<n)-1){
		if(st.size()==m&&chk())return ans=st,1;return 0;
	}
	
	if(st.size()<m){
		st.pb(i),vis[i]=1;
		if(dfs(i+1,n,m))return 1;
		st.pop_back(),vis[i]=0;
	}
	if(dfs(i+1,n,m))return 1;return 0;
}
vector<int> sol(int n,int m){
	if(n<=5){
		vis[0]=vis[(1ll<<n)-1]=1;
		st.pb(0),st.pb((1ll<<n)-1);
					return dfs(1,n,m),ans;
	} 
	if(m<=n*(n-1)/2){
		auto ans=sol(n-1,m);
		for(auto &x:ans){
			x=x<<1|(x&1);
		}			return ans;
	}
	if(~m&1){
		auto ans=sol(n-1,m/2);
		vector<int> res(0);
		for(auto &x:ans)res.pb(x<<1),res.pb(x<<1|1);
					return res;
	}
	if(m&1){
		auto ans=sol(n-1,m-1);
		for(auto &x:ans)x=x<<1|1;
		ans.pb(0);	return ans;
	}
}
void work(){
	st.clear(),vis.clear(),ans.clear();
	cin>>n>>m;
	auto ans=sol(n,m);
	for(auto x:ans)cout<<x<<' ';cout<<'\n';
}
signed main(){
	ios::sync_with_stdio(0),
	cin.tie(0),cout.tie(0);
	int T=1;cin>>T;while(T--)work();
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
3 5
4 8
60 2

output:

0 7 1 2 3 
0 15 1 2 3 5 7 11 
0 1152921504606846975 

result:

ok AC

Test #2:

score: 0
Accepted
time: 50ms
memory: 3560kb

input:

30
6 2
6 3
6 4
6 5
6 6
6 7
6 8
6 9
6 10
6 11
6 12
6 13
6 14
6 15
6 16
6 17
6 18
6 19
6 20
6 21
7 2
7 3
7 4
7 5
7 6
7 7
7 8
7 9
7 10
7 11

output:

0 63 
0 63 3 
0 63 3 7 
0 63 3 4 7 
0 63 3 4 7 15 
0 63 3 4 7 11 15 
0 63 3 4 7 11 15 31 
0 63 3 4 7 8 11 12 15 
0 63 3 4 7 8 11 12 15 31 
0 63 3 4 7 8 11 12 15 23 31 
0 63 3 4 7 8 11 12 15 23 31 47 
0 63 3 4 7 8 11 12 15 19 23 27 31 
0 63 3 4 7 8 11 12 15 19 23 27 31 47 
0 63 3 4 7 8 11 12 15 19 23...

result:

ok AC

Test #3:

score: 0
Accepted
time: 58ms
memory: 3760kb

input:

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

output:

0 127 7 8 15 16 23 24 31 47 63 95 
0 127 7 8 15 16 23 24 31 39 47 55 63 
0 127 7 8 15 16 23 24 31 39 47 55 63 95 
0 127 7 8 15 16 23 24 31 39 47 55 63 88 95 
0 3 124 127 4 7 8 11 12 15 20 23 28 31 60 63 
3 127 7 11 15 19 23 27 31 39 47 55 63 79 95 111 0 
0 3 124 127 4 7 8 11 12 15 16 19 20 23 24 27 ...

result:

ok AC

Test #4:

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

input:

30
8 15
8 16
8 17
8 18
8 19
8 20
8 21
8 22
8 23
8 24
8 25
8 26
8 27
8 28
8 29
8 30
8 31
8 32
8 33
8 34
8 35
8 36
9 2
9 3
9 4
9 5
9 6
9 7
9 8
9 9

output:

0 255 15 16 31 32 47 48 63 79 95 111 127 176 191 
0 7 248 255 8 15 16 23 24 31 40 47 56 63 120 127 
7 255 15 23 31 39 47 55 63 79 95 111 127 159 191 223 0 
0 7 248 255 8 15 16 23 24 31 32 39 40 47 48 55 56 63 
7 255 15 23 31 39 47 55 63 71 79 87 95 103 111 119 127 191 0 
0 7 248 255 8 15 16 23 24 31...

result:

ok AC

Test #5:

score: 0
Accepted
time: 145ms
memory: 3588kb

input:

30
9 10
9 11
9 12
9 13
9 14
9 15
9 16
9 17
9 18
9 19
9 20
9 21
9 22
9 23
9 24
9 25
9 26
9 27
9 28
9 29
9 30
9 31
9 32
9 33
9 34
9 35
9 36
9 37
9 38
9 39

output:

0 511 31 32 63 64 95 96 127 255 
0 511 31 32 63 64 95 96 127 191 255 
0 511 31 32 63 64 95 96 127 191 255 383 
0 511 31 32 63 64 95 96 127 159 191 223 255 
0 511 31 32 63 64 95 96 127 159 191 223 255 383 
0 511 31 32 63 64 95 96 127 159 191 223 255 352 383 
0 15 496 511 16 31 32 47 48 63 80 95 112 1...

result:

ok AC

Test #6:

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

input:

6
9 40
9 41
9 42
9 43
9 44
9 45

output:

0 1 14 15 496 497 510 511 16 17 30 31 32 33 46 47 48 49 62 63 64 65 78 79 80 81 94 95 96 97 110 111 112 113 126 127 240 241 254 255 
1 3 13 15 497 499 509 511 17 19 29 31 33 35 45 47 49 51 61 63 65 67 77 79 81 83 93 95 97 99 109 111 113 115 125 127 241 243 253 255 0 
14 15 510 511 30 31 46 47 62 63 ...

result:

ok AC

Test #7:

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

input:

30
60 1801
60 1802
60 1803
60 1804
60 1805
60 1806
60 1807
60 1808
60 1809
60 1810
60 1811
60 1812
60 1813
60 1814
60 1815
60 1816
60 1817
60 1818
60 1819
60 1820
60 1821
60 1822
60 1823
60 1824
60 1825
60 1826
60 1827
60 1828
60 1829
60 1830

output:

1097364144129 1097364144131 1097364668413 1097364668415 1099511103489 1099511103491 1099511627773 1099511627775 2196875771905 2196875771907 2196876296189 2196876296191 2199022731265 2199022731267 2199023255549 2199023255551 69267085066241 69267085066243 69267085590525 69267085590527 69269232025601 6...

result:

ok AC

Test #8:

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

input:

30
59 1741
59 1742
59 1743
59 1744
59 1745
59 1746
59 1747
59 1748
59 1749
59 1750
59 1751
59 1752
59 1753
59 1754
59 1755
59 1756
59 1757
59 1758
59 1759
59 1760
59 1761
59 1762
59 1763
59 1764
59 1765
59 1766
59 1767
59 1768
59 1769
59 1770

output:

7881846955966465 7881846955966467 7881846956228605 7881846956228607 7881849103450113 7881849103450115 7881849103712253 7881849103712255 7882396711780353 7882396711780355 7882396712042493 7882396712042495 7882398859264001 7882398859264003 7882398859526141 7882398859526143 7915931816427521 79159318164...

result:

ok AC

Test #9:

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

input:

30
58 1682
58 1683
58 1684
58 1685
58 1686
58 1687
58 1688
58 1689
58 1690
58 1691
58 1692
58 1693
58 1694
58 1695
58 1696
58 1697
58 1698
58 1699
58 1700
58 1701
58 1702
58 1703
58 1704
58 1705
58 1706
58 1707
58 1708
58 1709
58 1710
58 1711

output:

34634616537086 34634616537087 34634616799230 34634616799231 34635689754622 34635689754623 34635690016766 34635690016767 35183298609150 35183298609151 35183298871294 35183298871295 35184371826686 35184371826687 35184372088830 35184372088831 69818988625918 69818988625919 69818988888062 69818988888063 ...

result:

ok AC

Test #10:

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

input:

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

output:

0 3 
0 3 1 
0 7 
0 7 1 
0 7 1 3 
0 7 1 2 3 
0 7 1 2 3 5 
0 15 
0 15 1 
0 15 1 3 
0 15 1 2 3 
0 15 1 2 3 7 
0 15 1 2 3 5 7 
0 15 1 2 3 5 7 11 
0 15 1 2 3 4 5 6 7 
0 15 1 2 3 4 5 6 7 11 
0 31 
0 31 1 
0 31 1 3 
0 31 1 2 3 
0 31 1 2 3 7 
0 31 1 2 3 5 7 
0 31 1 2 3 5 7 15 
0 31 1 2 3 4 5 6 7 
0 31 1 2 3...

result:

ok AC

Test #11:

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

input:

30
2 3
5 4
4 9
5 4
2 2
5 11
2 2
5 15
3 5
2 3
5 15
2 2
5 9
4 7
4 2
3 5
4 6
2 3
2 2
5 13
5 11
5 9
4 5
4 9
4 6
3 3
5 4
3 5
4 3
4 6

output:

0 3 1 
0 31 1 3 
0 15 1 2 3 4 5 6 7 
0 31 1 3 
0 3 
0 31 1 2 3 4 5 6 7 11 15 
0 3 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 7 1 2 3 
0 3 1 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 3 
0 31 1 2 3 4 5 6 7 
0 15 1 2 3 5 7 
0 15 
0 7 1 2 3 
0 15 1 2 3 7 
0 3 1 
0 3 
0 31 1 2 3 4 5 6 7 9 11 13 15 
0 31 1 2 3...

result:

ok AC

Test #12:

score: 0
Accepted
time: 337ms
memory: 3680kb

input:

30
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15
5 15

output:

0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31 1 2 3 4 5 6 7 9 11 13 15 22 23 
0 31...

result:

ok AC

Test #13:

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

input:

30
29 242
30 171
41 291
4 7
57 306
30 107
53 75
36 493
47 946
28 376
11 44
31 256
47 672
33 361
55 1258
8 10
13 57
5 15
52 760
17 17
25 145
58 436
49 1087
29 175
57 1015
5 12
42 595
4 6
49 987
54 660

output:

16128 16383 32512 32767 507648 507903 524032 524287 3686144 3686399 3702528 3702783 4177664 4177919 4194048 4194303 532692736 532692991 532709120 532709375 533184256 533184511 533200640 533200895 536362752 536363007 536379136 536379391 536854272 536854527 536870656 536870911 29376256 29376511 293926...

result:

ok AC

Test #14:

score: 0
Accepted
time: 78ms
memory: 3584kb

input:

30
48 131
20 28
57 765
59 1532
52 881
56 660
22 19
31 192
47 255
36 487
21 170
18 68
4 9
5 13
8 16
53 1071
19 16
10 2
48 1044
58 933
7 16
60 1410
57 1413
45 213
31 49
26 214
4 3
54 31
59 1075
46 393

output:

266287972351 274877906943 541165879295 549755813887 1915555414015 1924145348607 2190433320959 2199023255551 6863357739007 6871947673599 7138235645951 7146825580543 8512625180671 8521215115263 8787503087615 8796093022207 272945171660799 272953761595391 273220049567743 273228639502335 274594439102463 ...

result:

ok AC

Test #15:

score: 0
Accepted
time: 166ms
memory: 3620kb

input:

30
23 155
51 597
36 137
22 41
32 181
15 13
50 538
51 1239
13 83
22 17
51 896
31 170
10 34
5 13
18 165
13 6
52 340
60 570
60 7
57 494
20 5
13 55
16 15
6 7
22 160
38 427
55 315
56 233
29 48
58 1320

output:

233407 233471 237503 237567 257983 258047 262079 262143 8359871 8359935 8363967 8364031 8384447 8384511 8388543 8388607 495551 495615 499647 499711 520127 520191 524223 524287 757695 757759 761791 761855 782271 782335 786367 786431 1019839 1019903 1023935 1023999 1044415 1044479 1048511 1048575 1281...

result:

ok AC

Test #16:

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

input:

30
56 489
21 111
3 3
8 23
41 834
27 145
22 172
52 413
17 57
3 2
35 232
5 11
59 113
33 47
38 475
20 114
16 133
46 265
6 10
18 3
8 28
60 1429
40 373
46 882
4 9
54 1257
20 182
11 54
3 4
22 54

output:

68169788030975 68169855139839 68204013551615 68204080660479 70334451548159 70334518657023 70368677068799 70368744177663 138538532208639 138538599317503 138572757729279 138572824838143 140703195725823 140703262834687 140737421246463 140737488355327 490382253096959 490382320205823 490416478617599 4904...

result:

ok AC

Test #17:

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

input:

30
53 261
40 344
32 159
11 23
41 739
6 14
14 54
20 146
9 22
20 194
44 524
17 13
22 247
48 1142
37 282
33 41
33 205
31 141
31 270
3 6
57 773
60 1036
12 77
22 98
45 994
7 24
23 209
10 33
37 657
57 179

output:

8523362598911 8525510082559 8793945538559 8796093022207 17319455621119 17321603104767 17590038560767 17592186044415 61299920732159 61302068215807 61570503671807 61572651155455 70096013754367 70098161238015 70366596694015 70368744177663 219629595131903 219631742615551 219900178071551 219902325555199 ...

result:

ok AC

Test #18:

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

input:

30
36 401
40 314
11 22
18 99
26 313
25 90
41 13
43 388
26 74
45 846
53 1400
24 54
21 160
38 231
54 493
26 270
57 1410
23 242
41 826
5 9
59 370
41 185
56 1344
34 342
49 453
52 118
46 36
35 227
58 324
6 10

output:

939524607 939525119 939654655 939655167 947782143 947782655 947912191 947912703 1065353727 1065354239 1065483775 1065484287 1073611263 1073611775 1073741311 1073741823 2013266431 2013266943 2013396479 2013396991 2021523967 2021524479 2021654015 2021654527 2139095551 2139096063 2139225599 2139226111 ...

result:

ok AC

Test #19:

score: 0
Accepted
time: 182ms
memory: 3568kb

input:

30
47 781
34 565
24 65
51 211
20 148
24 272
36 382
3 6
59 1251
36 485
30 273
18 118
25 266
31 352
60 144
15 96
56 732
57 1376
20 159
39 397
29 330
14 17
51 1317
57 639
12 38
2 2
38 661
40 578
27 308
18 141

output:

16910385407 16910385663 16911433471 16911433727 17178820863 17178821119 17179868927 17179869183 34090254591 34090254847 34091302655 34091302911 34358690047 34358690303 34359738111 34359738367 257428553983 257428554239 257429602047 257429602303 257696989439 257696989695 257698037503 257698037759 2746...

result:

ok AC

Test #20:

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

input:

30
25 161
34 346
39 713
31 172
27 222
36 650
5 15
52 902
33 453
22 229
21 83
43 338
31 282
56 1472
12 59
44 511
15 3
36 398
48 762
48 943
10 13
43 896
38 159
14 80
11 20
26 28
53 1355
2 3
51 649
24 47

output:

255 511 7935 8191 123135 123391 130815 131071 917759 918015 925439 925695 1040639 1040895 1048319 1048575 32506111 32506367 32513791 32514047 32628991 32629247 32636671 32636927 33423615 33423871 33431295 33431551 33546495 33546751 33554175 33554431 1048831 1049087 1056511 1056767 1171711 1171967 11...

result:

ok AC

Test #21:

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

input:

30
53 1388
3 6
3 6
41 29
2 3
34 581
50 790
5 15
6 13
23 188
14 64
47 694
51 69
47 155
16 105
23 70
32 520
8 3
37 488
47 85
41 300
36 487
32 106
36 175
50 117
27 3
13 58
57 786
35 105
3 4

output:

244125672538112 244125672538113 244125672669182 244125672669183 244125940973568 244125940973569 244125941104638 244125941104639 244160032276480 244160032276481 244160032407550 244160032407551 244160300711936 244160300711937 244160300843006 244160300843007 246255976316928 246255976316929 246255976447...

result:

ok AC

Test #22:

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

input:

30
25 321
51 371
19 131
4 2
25 176
28 305
52 538
43 411
43 852
58 817
33 253
36 59
47 207
4 4
60 80
36 3
49 287
57 545
37 191
24 39
57 681
49 641
48 674
38 378
22 68
39 201
29 359
45 330
8 19
59 377

output:

1 3 253 255 7937 7939 8189 8191 122881 122883 123133 123135 130817 130819 131069 131071 917505 917507 917757 917759 925441 925443 925693 925695 1040385 1040387 1040637 1040639 1048321 1048323 1048573 1048575 32505857 32505859 32506109 32506111 32513793 32513795 32514045 32514047 32628737 32628739 32...

result:

ok AC

Test #23:

score: 0
Accepted
time: 151ms
memory: 3580kb

input:

30
20 81
36 479
59 459
24 204
27 231
24 231
39 270
7 15
40 90
21 137
46 603
33 461
39 244
48 556
19 103
9 7
10 33
16 97
8 10
53 985
54 1383
27 375
57 1527
37 336
54 822
3 5
24 261
22 35
9 18
58 103

output:

255 511 3839 4095 28927 29183 32511 32767 1016063 1016319 1019647 1019903 1044735 1044991 1048319 1048575 33023 33279 36607 36863 61695 61951 65279 65535 65791 66047 69375 69631 94463 94719 98047 98303 98559 98815 102143 102399 127231 127487 130815 131071 131327 131583 134911 135167 159999 160255 16...

result:

ok AC

Test #24:

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

input:

30
49 575
44 266
38 706
49 462
5 14
57 1386
42 147
51 941
12 14
2 3
25 295
47 636
20 86
30 4
47 1019
11 56
41 42
55 1428
55 1227
16 13
35 606
49 915
38 703
56 3
31 241
49 352
27 230
14 97
54 1147
39 432

output:

12910604517375 12910604582911 12910671626239 12910671691775 12919194451967 12919194517503 12919261560831 12919261626367 13185482424319 13185482489855 13185549533183 13185549598719 13194072358911 13194072424447 13194139467775 13194139533311 17308651028479 17308651094015 17308718137343 17308718202879 ...

result:

ok AC

Test #25:

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

input:

30
45 755
31 23
26 167
22 197
58 527
24 207
8 24
11 33
56 1138
42 94
46 825
33 309
52 2
28 391
33 558
7 24
18 31
51 219
59 1720
42 707
38 239
21 226
60 953
46 132
38 9
34 62
41 50
47 862
19 6
17 69

output:

476741894015 476741894143 476742418303 476742418431 476875063167 476875063295 476875587455 476875587583 480902643583 480902643711 480903167871 480903167999 481035812735 481035812863 481036337023 481036337151 545461370751 545461370879 545461895039 545461895167 545594539903 545594540031 545595064191 5...

result:

ok AC

Test #26:

score: 0
Accepted
time: 152ms
memory: 3816kb

input:

30
11 60
49 190
48 228
60 60
13 13
36 427
21 159
31 425
34 303
59 101
37 571
33 135
21 111
45 638
60 1399
6 6
45 178
29 241
20 86
50 262
60 241
17 86
25 149
7 5
59 609
43 151
14 48
59 1060
47 140
12 35

output:

0 1 14 15 2032 2033 2046 2047 112 113 126 127 128 129 142 143 240 241 254 255 256 257 270 271 368 369 382 383 384 385 398 399 496 497 510 511 624 625 638 639 752 753 766 767 880 881 894 895 1008 1009 1022 1023 1408 1409 1422 1423 1520 1521 1534 1535 
7625714434048 7627861917695 7694433910784 7696581...

result:

ok AC

Test #27:

score: 0
Accepted
time: 58ms
memory: 3572kb

input:

30
42 456
27 250
9 24
60 1201
31 119
46 460
45 177
8 24
8 10
45 212
28 262
2 2
46 97
35 72
19 149
44 296
16 98
55 626
18 44
34 40
33 293
22 214
27 352
28 347
44 418
4 6
54 1147
28 203
7 5
43 47

output:

4026531840 4026540031 4030717952 4030726143 4290772992 4290781183 4294959104 4294967295 8321499136 8321507327 8325685248 8325693439 8585740288 8585748479 8589926400 8589934591 64156073984 64156082175 64160260096 64160268287 64420315136 64420323327 64424501248 64424509439 68451041280 68451049471 6845...

result:

ok AC

Test #28:

score: 0
Accepted
time: 168ms
memory: 3584kb

input:

30
51 1193
51 241
33 525
42 382
50 512
56 346
50 947
43 237
54 1024
49 241
12 25
50 141
33 442
51 987
37 498
24 153
15 110
33 103
34 460
3 4
3 5
34 70
20 79
15 103
47 1112
45 150
48 207
33 181
53 1023
19 4

output:

7730672697351 7730672697359 7730672828407 7730672828415 7730941001735 7730941001743 7730941132791 7730941132799 7765032435719 7765032435727 7765032566775 7765032566783 7765300740103 7765300740111 7765300871159 7765300871167 8761464848391 8761464848399 8761464979447 8761464979455 8761733152775 876173...

result:

ok AC

Test #29:

score: 0
Accepted
time: 113ms
memory: 3572kb

input:

30
25 222
48 693
57 48
33 555
41 78
11 44
11 44
43 551
50 1262
5 11
30 193
57 1176
48 762
28 315
29 391
47 774
6 12
51 526
54 521
5 4
26 245
20 145
55 759
13 3
58 937
57 1542
17 149
16 95
41 137
36 333

output:

456672 456703 458720 458751 522208 522239 524256 524287 980960 980991 983008 983039 1046496 1046527 1048544 1048575 32962528 32962559 32964576 32964607 33028064 33028095 33030112 33030143 33486816 33486847 33488864 33488895 33552352 33552383 33554400 33554431 1505248 1505279 1507296 1507327 1570784 ...

result:

ok AC

Test #30:

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

input:

29
50 179
36 37
14 47
15 3
52 734
25 246
33 92
42 327
56 1017
19 84
50 720
13 71
34 141
25 31
29 183
11 40
14 58
28 383
27 45
47 428
19 103
9 40
58 1437
40 222
10 29
59 112
39 510
56 1194
44 875

output:

270582939647 274877906943 545460846591 549755813887 4118873636863 4123168604159 4393751543807 4398046511103 13464722472959 13469017440255 13739600379903 13743895347199 17313013170175 17317308137471 17587891077119 17592186044415 1108578303737855 1108582598705151 1108853181644799 1108857476612095 1112...

result:

ok AC

Test #31:

score: 0
Accepted
time: 196ms
memory: 3644kb

input:

29
53 491
27 267
55 1268
7 28
7 25
31 224
22 122
36 338
30 102
4 3
18 112
43 596
45 534
24 255
15 22
26 291
17 70
33 243
47 556
44 117
24 70
35 375
26 232
44 361
46 678
4 2
19 139
46 1056
47 323

output:

8525501693951 8525510082559 8529796661247 8529805049855 8791789666303 8791798054911 8796084633599 8796093022207 17321594716159 17321603104767 17325889683455 17325898072063 17587882688511 17587891077119 17592177655807 17592186044415 61302059827199 61302068215807 61306354794495 61306363183103 61568347...

result:

ok AC

Test #32:

score: 0
Accepted
time: 66ms
memory: 3604kb

input:

29
48 527
20 42
31 377
19 102
38 130
14 63
38 271
54 1151
14 28
46 312
57 326
2 2
7 23
13 56
59 119
37 376
31 217
50 773
49 1204
53 107
13 55
31 251
46 712
51 802
52 799
36 661
38 581
28 100
29 21

output:

266220732415 266220863487 266287841279 266287972351 274810667007 274810798079 274877775871 274877906943 541098639359 541098770431 541165748223 541165879295 549688573951 549688705023 549755682815 549755813887 1915488174079 1915488305151 1915555282943 1915555414015 1924078108671 1924078239743 19241452...

result:

ok AC

Test #33:

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

input:

30
53 25
49 23
20 23
23 9
32 9
54 15
26 11
35 19
33 7
35 8
34 30
16 17
24 5
35 30
29 5
25 12
12 28
52 27
53 7
21 27
36 16
45 12
55 26
32 7
31 2
19 20
10 14
36 4
46 30
21 23

output:

140737488355327 281474976710655 8866461766385663 9007199254740991 422212465065983 562949953421311 703687441776639 844424930131967 985162418487295 1125899906842623 1266637395197951 1407374883553279 1548112371908607 1688849860263935 1829587348619263 1970324836974591 2111062325329919 2251799813685247 3...

result:

ok AC

Test #34:

score: 0
Accepted
time: 73ms
memory: 3592kb

input:

30
44 8
44 31
38 8
15 9
29 16
14 23
24 15
18 7
36 2
21 5
12 4
34 23
28 20
15 23
48 32
51 21
19 5
37 8
10 16
49 5
18 11
49 10
36 21
13 12
59 2
52 13
53 5
60 29
25 15
46 17

output:

0 17592186044415 1099511627775 1099511627776 2199023255551 3298534883327 4398046511103 8796093022207 
137438953471 274877906943 17454747090943 17592186044415 962072674303 1099511627775 1236950581247 1374389534719 2061584302079 2199023255551 2336462209023 2473901162495 3161095929855 3298534883327 343...

result:

ok AC

Test #35:

score: 0
Accepted
time: 45ms
memory: 3768kb

input:

30
54 13
56 27
40 9
47 19
48 3
55 6
34 30
57 21
57 23
41 24
38 27
59 19
31 9
52 15
26 28
28 16
20 32
34 19
28 24
55 15
32 23
50 20
55 27
52 32
40 13
57 28
48 27
37 5
20 2
26 11

output:

0 18014398509481983 1125899906842623 1125899906842624 2251799813685247 2251799813685248 3377699720527871 3377699720527872 4503599627370495 5629499534213119 6755399441055743 7881299347898367 9007199254740991 
1125899906842623 2251799813685247 70931694131085311 72057594037927935 3377699720527871 45035...

result:

ok AC

Test #36:

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

input:

30
33 26
29 6
39 24
23 11
46 19
19 5
37 27
23 17
42 25
42 16
16 32
41 17
44 31
55 26
26 2
14 2
58 9
43 15
56 16
14 17
41 11
38 16
20 16
27 18
44 2
45 3
15 21
24 29
40 23
17 25

output:

0 134217727 8455716864 8589934591 402653184 536870911 536870912 671088639 939524096 1073741823 1073741824 1207959551 1476395008 1610612735 1610612736 1744830463 2013265920 2147483647 2550136832 2684354559 3087007744 3221225471 3623878656 3758096383 4160749568 4294967295 
0 536870911 33554431 3355443...

result:

ok AC

Test #37:

score: 0
Accepted
time: 57ms
memory: 3496kb

input:

30
30 26
25 8
40 11
55 15
44 6
18 29
33 6
11 21
45 5
25 8
55 29
42 23
34 2
47 7
21 13
25 31
58 20
37 31
51 14
38 30
14 22
15 5
28 21
60 9
47 7
16 32
50 7
56 18
23 14
10 27

output:

0 16777215 1056964608 1073741823 50331648 67108863 67108864 83886079 117440512 134217727 134217728 150994943 184549376 201326591 201326592 218103807 251658240 268435455 318767104 335544319 385875968 402653183 452984832 469762047 520093696 536870911 
0 33554431 2097151 2097152 4194303 6291455 8388607...

result:

ok AC

Test #38:

score: 0
Accepted
time: 148ms
memory: 3592kb

input:

30
10 23
26 32
42 23
18 10
51 8
38 13
53 31
58 20
56 30
54 17
37 25
36 6
26 20
60 13
27 7
44 32
60 11
55 17
46 18
50 17
57 28
28 8
30 10
18 31
45 28
34 26
56 29
30 29
60 13
42 23

output:

15 31 1007 1023 47 63 79 95 111 127 143 159 175 191 207 223 239 255 367 383 495 511 0 
0 524287 1572864 2097151 65011712 65535999 66584576 67108863 2097152 2621439 3670016 4194303 4194304 4718591 5767168 6291455 6291456 6815743 7864320 8388607 10485760 11010047 12058624 12582911 14680064 15204351 16...

result:

ok AC

Test #39:

score: 0
Accepted
time: 216ms
memory: 3584kb

input:

30
22 253
55 1512
44 980
25 318
60 1814
24 287
55 1535
16 124
53 1423
36 661
44 975
25 313
22 240
54 1475
33 556
37 697
48 1147
60 1805
42 883
48 1154
45 1020
50 1272
27 378
51 1320
47 1122
50 1263
23 254
57 1624
32 514
38 724

output:

28545 28547 28669 28671 32641 32643 32765 32767 61313 61315 61437 61439 65409 65411 65533 65535 4157313 4157315 4157437 4157439 4161409 4161411 4161533 4161535 4190081 4190083 4190205 4190207 4194177 4194179 4194301 4194303 225153 225155 225277 225279 229249 229251 229373 229375 257921 257923 258045...

result:

ok AC

Test #40:

score: 0
Accepted
time: 73ms
memory: 3796kb

input:

30
42 897
30 463
22 226
57 1647
38 735
59 1751
16 113
17 152
18 146
22 241
26 322
10 43
39 758
11 44
14 98
34 570
46 1057
26 338
19 163
58 1684
34 586
28 385
57 1645
11 36
56 1573
27 370
48 1160
32 498
24 295
28 402

output:

1 3 8189 8191 4186113 4186115 4194301 4194303 264241153 264241155 264249341 264249343 268427265 268427267 268435453 268435455 4026531841 4026531843 4026540029 4026540031 4030717953 4030717955 4030726141 4030726143 4290772993 4290772995 4290781181 4290781183 4294959105 4294959107 4294967293 429496729...

result:

ok AC

Test #41:

score: 0
Accepted
time: 161ms
memory: 3800kb

input:

30
41 834
57 1653
55 1512
29 413
12 66
54 1459
34 569
50 1249
34 590
21 203
58 1681
35 609
47 1118
11 59
10 29
50 1270
10 31
26 322
42 899
46 1059
18 171
35 613
27 363
33 541
55 1525
31 469
47 1098
42 879
46 1065
23 275

output:

8190 8191 16382 16383 4186110 4186111 4194302 4194303 264249342 264249343 264257534 264257535 268427262 268427263 268435454 268435455 4026540030 4026540031 4026548222 4026548223 4030717950 4030717951 4030726142 4030726143 4290781182 4290781183 4290789374 4290789375 4294959102 4294959103 4294967294 4...

result:

ok AC

Test #42:

score: 0
Accepted
time: 142ms
memory: 3588kb

input:

30
16 123
23 269
53 1421
42 887
60 1808
31 480
33 538
49 1225
35 609
59 1744
48 1150
52 1350
35 612
44 987
17 144
15 94
16 123
21 216
23 268
57 1633
23 273
28 406
54 1455
32 507
28 380
11 51
14 98
32 526
45 1022
53 1404

output:

61 63 125 127 445 447 509 511 65085 65087 65149 65151 65469 65471 65533 65535 3645 3647 3709 3711 4029 4031 4093 4095 4157 4159 4221 4223 4541 4543 4605 4607 7741 7743 7805 7807 8125 8127 8189 8191 8253 8255 8317 8319 8637 8639 8701 8703 11837 11839 11901 11903 12221 12223 12285 12287 12349 12351 12...

result:

ok AC

Test #43:

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

input:

30
28 393
40 819
56 1571
11 37
41 849
27 375
20 202
53 1430
56 1584
32 510
43 937
25 300
22 225
55 1529
11 42
18 151
17 126
36 662
13 91
60 1813
28 383
53 1418
60 1826
25 297
33 536
58 1683
14 102
47 1101
32 509
32 516

output:

491521 491523 492029 492031 523777 523779 524285 524287 1015809 1015811 1016317 1016319 1048065 1048067 1048573 1048575 3637249 3637251 3637757 3637759 3669505 3669507 3670013 3670015 4161537 4161539 4162045 4162047 4193793 4193795 4194301 4194303 264732673 264732675 264733181 264733183 264764929 26...

result:

ok AC

Test #44:

score: 0
Accepted
time: 103ms
memory: 3616kb

input:

30
35 626
11 60
46 1053
47 1098
38 727
54 1455
27 363
40 814
29 412
19 169
49 1216
34 578
10 29
22 240
51 1312
57 1642
44 966
36 655
27 368
35 617
59 1747
53 1423
26 325
49 1209
34 574
11 45
53 1414
57 1645
35 606
40 814

output:

922748926 922748927 922750974 922750975 923006974 923006975 923009022 923009023 939263998 939263999 939266046 939266047 939522046 939522047 939524094 939524095 1056966654 1056966655 1056968702 1056968703 1057224702 1057224703 1057226750 1057226751 1073481726 1073481727 1073483774 1073483775 10737397...

result:

ok AC

Test #45:

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

input:

30
60 1102
60 403
58 82
58 65
59 428
58 1173
58 626
58 1153
58 1448
59 1581
58 929
60 1019
58 530
60 1629
60 1546
60 824
59 3
58 1399
59 1165
60 417
59 1260
59 1310
58 1164
60 384
59 1325
58 131
60 1559
59 224
59 1489
60 1129

output:

27038914803908608 27038914803924991 27038915072344064 27038915072360447 27039189681815552 27039189681831935 27039189950251008 27039189950267391 27056506989953024 27056506989969407 27056507258388480 27056507258404863 27056781867859968 27056781867876351 27056782136295424 27056782136311807 275666803852...

result:

ok AC

Test #46:

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

input:

30
60 452
60 169
59 682
60 1006
60 1426
60 585
59 1368
60 1572
60 761
59 1113
59 1271
59 793
60 890
58 620
60 1774
58 285
60 1525
59 1277
58 861
60 515
60 1529
58 523
58 1129
59 917
60 1459
60 491
60 872
58 624
58 711
59 953

output:

69269232549888 69271380033535 70366596694016 70368744177663 139637976727552 139640124211199 140735340871680 140737488355327 1054431651037184 1054433798520831 1055529015181312 1055531162664959 1124800395214848 1124802542698495 1125897759358976 1125899906842623 16957767835189248 16957769982672895 1695...

result:

ok AC

Test #47:

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

input:

30
58 1370
59 14
60 79
59 1121
59 347
59 843
60 110
60 301
58 480
58 597
59 648
59 482
58 1169
60 340
58 681
59 1725
60 568
60 719
60 1327
59 577
60 380
58 882
58 934
58 1238
58 347
59 1007
59 143
60 1021
59 567
59 1572

output:

7949460483080064 7949460483080191 7949460487274368 7949460487274495 7949469064626048 7949469064626175 7949469068820352 7949469068820479 7951659506335616 7951659506335743 7951659510529920 7951659510530047 7951668087881600 7951668087881727 7951668092075904 7951668092076031 8019829227257728 80198292272...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed