QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#423187#8174. Set ConstructionqwqwfAC ✓3ms3744kbC++14839b2024-05-27 21:28:042024-05-27 21:28:05

Judging History

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

  • [2024-05-27 21:28:05]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3744kb
  • [2024-05-27 21:28:04]
  • 提交

answer

#pragma GCC optimize("Ofast","unroll-loops","inline")
#include<bits/stdc++.h>
#define ll long long
//#define int ll
#define pb push_back
using namespace std;
const int N=5e5+10,M=1e6+10,mod=998244353;
vector<ll> ans;
void dfs(int n,int m){
	if(m==2) return ans.pb(0),ans.pb((1ll<<n)-1),void();
	if(m&1) return dfs(n-1,m-1),ans.pb((1ll<<n)-1),void();
	else{
		dfs(n-1,m>>1);
		int sz=ans.size();
		for(int i=0;i<sz;i++) ans[i]<<=1,ans.pb(ans[i]|1);
	}
}
void solve(){
	int n,m;cin>>n>>m;
	ans.clear();
    if(n==5&&m==15) ans={0,1,3,5,7,8,9,11,13,15,24,25,27,29,31};
    else dfs(n,m);
    for(ll x:ans) cout<<x<<' ';cout<<'\n';
}
signed main(){
//	freopen("a.in","r",stdin);
//	freopen("a.out","w",stdout);
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int T;cin>>T;
	while(T--) solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
3 5
4 8
60 2

output:

0 2 1 3 7 
0 12 2 14 1 13 3 15 
0 1152921504606846975 

result:

ok AC

Test #2:

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

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 31 63 
0 62 1 63 
0 30 1 31 63 
0 30 62 1 31 63 
0 14 30 1 15 31 63 
0 60 2 62 1 61 3 63 
0 28 2 30 1 29 3 31 63 
0 28 2 30 62 1 29 3 31 63 
0 12 2 14 30 1 13 3 15 31 63 
0 28 60 2 30 62 1 29 61 3 31 63 
0 12 28 2 14 30 1 13 29 3 15 31 63 
0 12 28 2 14 30 62 1 13 29 3 15 31 63 
0 4 12 2 6 14...

result:

ok AC

Test #3:

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

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 60 124 2 62 126 1 61 125 3 63 127 
0 28 60 2 30 62 1 29 61 3 31 63 127 
0 28 60 2 30 62 126 1 29 61 3 31 63 127 
0 12 28 2 14 30 62 1 13 29 3 15 31 63 127 
0 120 4 124 2 122 6 126 1 121 5 125 3 123 7 127 
0 56 4 60 2 58 6 62 1 57 5 61 3 59 7 63 127 
0 56 4 60 2 58 6 62 126 1 57 5 61 3 59 7 63 127 ...

result:

ok AC

Test #4:

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

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 28 60 2 30 62 126 1 29 61 3 31 63 127 255 
0 248 4 252 2 250 6 254 1 249 5 253 3 251 7 255 
0 120 4 124 2 122 6 126 1 121 5 125 3 123 7 127 255 
0 120 4 124 2 122 6 126 254 1 121 5 125 3 123 7 127 255 
0 56 4 60 2 58 6 62 126 1 57 5 61 3 59 7 63 127 255 
0 120 4 124 252 2 122 6 126 254 1 121 5 125...

result:

ok AC

Test #5:

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

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 252 2 254 510 1 253 3 255 511 
0 124 2 126 254 1 125 3 127 255 511 
0 252 508 2 254 510 1 253 509 3 255 511 
0 124 252 2 126 254 1 125 253 3 127 255 511 
0 124 252 2 126 254 510 1 125 253 3 127 255 511 
0 60 124 2 62 126 254 1 61 125 3 63 127 255 511 
0 504 4 508 2 506 6 510 1 505 5 509 3 507 7 51...

result:

ok AC

Test #6:

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

input:

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

output:

0 240 8 248 504 4 244 12 252 508 2 242 10 250 506 6 246 14 254 510 1 241 9 249 505 5 245 13 253 509 3 243 11 251 507 7 247 15 255 511 
0 112 8 120 248 4 116 12 124 252 2 114 10 122 250 6 118 14 126 254 1 113 9 121 249 5 117 13 125 253 3 115 11 123 251 7 119 15 127 255 511 
0 112 8 120 248 4 116 12 1...

result:

ok AC

Test #7:

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

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:

0 72057594037927424 144115188075855360 256 72057594037927680 144115188075855616 288230376151711488 128 72057594037927552 144115188075855488 384 72057594037927808 144115188075855744 288230376151711616 64 72057594037927488 144115188075855424 320 72057594037927744 144115188075855680 288230376151711552 ...

result:

ok AC

Test #8:

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

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:

0 9007199254740480 18014398509481472 256 9007199254740736 18014398509481728 128 9007199254740608 18014398509481600 384 9007199254740864 18014398509481856 36028797018963840 64 9007199254740544 18014398509481536 320 9007199254740800 18014398509481792 192 9007199254740672 18014398509481664 448 90071992...

result:

ok AC

Test #9:

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

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:

0 18014398509481472 36028797018963456 256 18014398509481728 36028797018963712 128 18014398509481600 36028797018963584 384 18014398509481856 36028797018963840 72057594037927808 64 18014398509481536 36028797018963520 320 18014398509481792 36028797018963776 192 18014398509481664 36028797018963648 448 1...

result:

ok AC

Test #10:

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

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 1 3 
0 7 
0 3 7 
0 6 1 7 
0 2 1 3 7 
0 2 6 1 3 7 
0 15 
0 7 15 
0 14 1 15 
0 6 1 7 15 
0 6 14 1 7 15 
0 2 6 1 3 7 15 
0 12 2 14 1 13 3 15 
0 4 2 6 1 5 3 7 15 
0 4 2 6 14 1 5 3 7 15 
0 31 
0 15 31 
0 30 1 31 
0 14 1 15 31 
0 14 30 1 15 31 
0 6 14 1 7 15 31 
0 28 2 30 1 29 3 31 
0 12 2 14 1 13 ...

result:

ok AC

Test #11:

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

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 1 3 
0 30 1 31 
0 4 2 6 1 5 3 7 15 
0 30 1 31 
0 3 
0 4 2 6 14 1 5 3 7 15 31 
0 3 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 2 1 3 7 
0 1 3 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 3 
0 12 2 14 1 13 3 15 31 
0 2 6 1 3 7 15 
0 15 
0 2 1 3 7 
0 6 14 1 7 15 
0 1 3 
0 3 
0 4 12 2 6 14 1 5 13 3 7 15 31...

result:

ok AC

Test #12:

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

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 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 25 27 29 31 
0 1 3 5 7 8 9 11 13 15 24 2...

result:

ok AC

Test #13:

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

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:

0 33554368 67108800 32 33554400 67108832 134217696 16 33554384 67108816 48 33554416 67108848 134217712 268435440 8 33554376 67108808 40 33554408 67108840 134217704 24 33554392 67108824 56 33554424 67108856 134217720 268435448 4 33554372 67108804 36 33554404 67108836 134217700 20 33554388 67108820 52...

result:

ok AC

Test #14:

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

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:

0 70368744177600 32 70368744177632 16 70368744177616 48 70368744177648 8 70368744177608 40 70368744177640 24 70368744177624 56 70368744177656 4 70368744177604 36 70368744177636 20 70368744177620 52 70368744177652 12 70368744177612 44 70368744177644 28 70368744177628 60 70368744177660 2 7036874417760...

result:

ok AC

Test #15:

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

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:

0 524224 32 524256 16 524240 48 524272 1048560 8 524232 40 524264 24 524248 56 524280 1048568 2097144 4 524228 36 524260 20 524244 52 524276 1048564 12 524236 44 524268 28 524252 60 524284 1048572 2097148 2 524226 34 524258 18 524242 50 524274 1048562 10 524234 42 524266 26 524250 58 524282 1048570 ...

result:

ok AC

Test #16:

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

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:

0 2251799813685120 4503599627370368 64 2251799813685184 4503599627370432 9007199254740928 32 2251799813685152 4503599627370400 96 2251799813685216 4503599627370464 9007199254740960 18014398509481952 16 2251799813685136 4503599627370384 80 2251799813685200 4503599627370448 9007199254740944 48 2251799...

result:

ok AC

Test #17:

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

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:

0 2251799813685120 64 2251799813685184 32 2251799813685152 96 2251799813685216 16 2251799813685136 80 2251799813685200 48 2251799813685168 112 2251799813685232 8 2251799813685128 72 2251799813685192 40 2251799813685160 104 2251799813685224 24 2251799813685144 88 2251799813685208 56 2251799813685176 ...

result:

ok AC

Test #18:

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

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:

0 8589934464 17179869056 64 8589934528 17179869120 32 8589934496 17179869088 96 8589934560 17179869152 16 8589934480 17179869072 80 8589934544 17179869136 48 8589934512 17179869104 112 8589934576 17179869168 34359738352 8 8589934472 17179869064 72 8589934536 17179869128 40 8589934504 17179869096 104...

result:

ok AC

Test #19:

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

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:

0 8796093021952 17592186044160 128 8796093022080 17592186044288 64 8796093022016 17592186044224 192 8796093022144 17592186044352 32 8796093021984 17592186044192 160 8796093022112 17592186044320 96 8796093022048 17592186044256 224 8796093022176 17592186044384 16 8796093021968 17592186044176 144 87960...

result:

ok AC

Test #20:

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

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:

0 8388544 32 8388576 16777184 16 8388560 48 8388592 16777200 8 8388552 40 8388584 16777192 24 8388568 56 8388600 16777208 4 8388548 36 8388580 16777188 20 8388564 52 8388596 16777204 12 8388556 44 8388588 16777196 28 8388572 60 8388604 16777212 2 8388546 34 8388578 16777186 18 8388562 50 8388594 167...

result:

ok AC

Test #21:

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

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:

0 281474976710144 256 281474976710400 562949953421056 128 281474976710272 384 281474976710528 562949953421184 64 281474976710208 320 281474976710464 562949953421120 192 281474976710336 448 281474976710592 562949953421248 1125899906842560 32 281474976710176 288 281474976710432 562949953421088 160 281...

result:

ok AC

Test #22:

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

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:

0 8388480 64 8388544 16777152 32 8388512 96 8388576 16777184 16 8388496 80 8388560 16777168 48 8388528 112 8388592 16777200 8 8388488 72 8388552 16777160 40 8388520 104 8388584 16777192 24 8388504 88 8388568 16777176 56 8388536 120 8388600 16777208 4 8388484 68 8388548 16777156 36 8388516 100 838858...

result:

ok AC

Test #23:

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

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:

0 262112 16 262128 524272 8 262120 24 262136 524280 4 262116 20 262132 524276 12 262124 28 262140 524284 2 262114 18 262130 524274 10 262122 26 262138 524282 6 262118 22 262134 524278 14 262126 30 262142 524286 1 262113 17 262129 524273 9 262121 25 262137 524281 5 262117 21 262133 524277 13 262125 2...

result:

ok AC

Test #24:

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

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:

0 8796093021952 128 8796093022080 64 8796093022016 192 8796093022144 32 8796093021984 160 8796093022112 96 8796093022048 224 8796093022176 17592186044384 16 8796093021968 144 8796093022096 80 8796093022032 208 8796093022160 48 8796093022000 176 8796093022128 112 8796093022064 240 8796093022192 17592...

result:

ok AC

Test #25:

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

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:

0 549755813632 128 549755813760 1099511627648 64 549755813696 192 549755813824 1099511627712 2199023255488 32 549755813664 160 549755813792 1099511627680 96 549755813728 224 549755813856 1099511627744 2199023255520 4398046511072 16 549755813648 144 549755813776 1099511627664 80 549755813712 208 5497...

result:

ok AC

Test #26:

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

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 240 496 8 248 504 1016 4 244 500 12 252 508 1020 2044 2 242 498 10 250 506 1018 6 246 502 14 254 510 1022 2046 1 241 497 9 249 505 1017 5 245 501 13 253 509 1021 2045 3 243 499 11 251 507 1019 7 247 503 15 255 511 1023 2047 
0 17592186044352 32 17592186044384 35184372088800 16 17592186044368 48 17...

result:

ok AC

Test #27:

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

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:

0 549755813760 1099511627648 64 549755813824 1099511627712 2199023255488 32 549755813792 1099511627680 96 549755813856 1099511627744 2199023255520 16 549755813776 1099511627664 80 549755813840 1099511627728 2199023255504 48 549755813808 1099511627696 112 549755813872 1099511627760 2199023255536 8 54...

result:

ok AC

Test #28:

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

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:

0 140737488354816 256 140737488355072 128 140737488354944 384 140737488355200 281474976710528 64 140737488354880 320 140737488355136 192 140737488355008 448 140737488355264 281474976710592 32 140737488354848 288 140737488355104 160 140737488354976 416 140737488355232 281474976710560 96 1407374883549...

result:

ok AC

Test #29:

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

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:

0 1048512 2097088 32 1048544 2097120 16 1048528 2097104 48 1048560 2097136 4194288 8 1048520 2097096 40 1048552 2097128 24 1048536 2097112 56 1048568 2097144 4194296 8388600 4 1048516 2097092 36 1048548 2097124 20 1048532 2097108 52 1048564 2097140 4194292 12 1048524 2097100 44 1048556 2097132 28 10...

result:

ok AC

Test #30:

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

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:

0 70368744177600 32 70368744177632 140737488355296 16 70368744177616 48 70368744177648 140737488355312 281474976710640 8 70368744177608 40 70368744177640 140737488355304 24 70368744177624 56 70368744177656 140737488355320 281474976710648 4 70368744177604 36 70368744177636 140737488355300 20 70368744...

result:

ok AC

Test #31:

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

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:

0 140737488355200 281474976710528 64 140737488355264 281474976710592 562949953421248 32 140737488355232 281474976710560 96 140737488355296 281474976710624 562949953421280 1125899906842592 16 140737488355216 281474976710544 80 140737488355280 281474976710608 562949953421264 48 140737488355248 2814749...

result:

ok AC

Test #32:

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

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:

0 17592186044160 128 17592186044288 64 17592186044224 192 17592186044352 32 17592186044192 160 17592186044320 96 17592186044256 224 17592186044384 16 17592186044176 144 17592186044304 80 17592186044240 208 17592186044368 48 17592186044208 176 17592186044336 112 17592186044272 240 17592186044400 8 17...

result:

ok AC

Test #33:

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

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:

0 2251799813685240 4503599627370488 4 2251799813685244 4503599627370492 2 2251799813685242 4503599627370490 6 2251799813685246 4503599627370494 1 2251799813685241 4503599627370489 5 2251799813685245 4503599627370493 3 2251799813685243 4503599627370491 7 2251799813685247 4503599627370495 900719925474...

result:

ok AC

Test #34:

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

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 17592186044412 2 17592186044414 1 17592186044413 3 17592186044415 
0 1099511627768 2199023255544 4 1099511627772 2199023255548 4398046511100 2 1099511627770 2199023255546 6 1099511627774 2199023255550 4398046511102 8796093022206 1 1099511627769 2199023255545 5 1099511627773 2199023255549 439804651...

result:

ok AC

Test #35:

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

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 4503599627370492 9007199254740988 2 4503599627370494 9007199254740990 1 4503599627370493 9007199254740989 3 4503599627370495 9007199254740991 18014398509481983 
0 9007199254740984 18014398509481976 4 9007199254740988 18014398509481980 2 9007199254740986 18014398509481978 6 9007199254740990 1801439...

result:

ok AC

Test #36:

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

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 2147483640 4294967288 4 2147483644 4294967292 2 2147483642 4294967290 6 2147483646 4294967294 8589934590 1 2147483641 4294967289 5 2147483645 4294967293 3 2147483643 4294967291 7 2147483647 4294967295 8589934591 
0 268435454 536870910 1 268435455 536870911 
0 274877906936 549755813880 4 2748779069...

result:

ok AC

Test #37:

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

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 268435448 536870904 4 268435452 536870908 2 268435450 536870906 6 268435454 536870910 1073741822 1 268435449 536870905 5 268435453 536870909 3 268435451 536870907 7 268435455 536870911 1073741823 
0 33554428 2 33554430 1 33554429 3 33554431 
0 274877906940 2 274877906942 549755813886 1 27487790694...

result:

ok AC

Test #38:

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

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:

0 120 4 124 252 2 122 6 126 254 510 1 121 5 125 253 3 123 7 127 255 511 1023 
0 67108848 8 67108856 4 67108852 12 67108860 2 67108850 10 67108858 6 67108854 14 67108862 1 67108849 9 67108857 5 67108853 13 67108861 3 67108851 11 67108859 7 67108855 15 67108863 
0 549755813880 4 549755813884 109951162...

result:

ok AC

Test #39:

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

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:

0 65472 131008 32 65504 131040 262112 16 65488 131024 48 65520 131056 262128 524272 8 65480 131016 40 65512 131048 262120 24 65496 131032 56 65528 131064 262136 524280 1048568 4 65476 131012 36 65508 131044 262116 20 65492 131028 52 65524 131060 262132 524276 12 65484 131020 44 65516 131052 262124 2...

result:

ok AC

Test #40:

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

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:

0 549755813632 1099511627520 128 549755813760 1099511627648 2199023255424 64 549755813696 1099511627584 192 549755813824 1099511627712 2199023255488 32 549755813664 1099511627552 160 549755813792 1099511627680 2199023255456 96 549755813728 1099511627616 224 549755813856 1099511627744 2199023255520 1...

result:

ok AC

Test #41:

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

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:

0 274877906688 549755813632 128 274877906816 549755813760 64 274877906752 549755813696 192 274877906880 549755813824 1099511627712 32 274877906720 549755813664 160 274877906848 549755813792 96 274877906784 549755813728 224 274877906912 549755813856 1099511627744 16 274877906704 549755813648 144 2748...

result:

ok AC

Test #42:

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

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:

0 2016 4064 16 2032 4080 8176 8 2024 4072 24 2040 4088 8184 16376 4 2020 4068 20 2036 4084 8180 12 2028 4076 28 2044 4092 8188 16380 2 2018 4066 18 2034 4082 8178 10 2026 4074 26 2042 4090 8186 16378 6 2022 4070 22 2038 4086 8182 14 2030 4078 30 2046 4094 8190 16382 32766 1 2017 4065 17 2033 4081 81...

result:

ok AC

Test #43:

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

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:

0 33554304 67108736 64 33554368 67108800 32 33554336 67108768 96 33554400 67108832 16 33554320 67108752 80 33554384 67108816 48 33554352 67108784 112 33554416 67108848 8 33554312 67108744 72 33554376 67108808 40 33554344 67108776 104 33554408 67108840 24 33554328 67108760 88 33554392 67108824 56 335...

result:

ok AC

Test #44:

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

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:

0 2147483392 128 2147483520 64 2147483456 192 2147483584 4294967232 32 2147483424 160 2147483552 96 2147483488 224 2147483616 4294967264 8589934560 16 2147483408 144 2147483536 80 2147483472 208 2147483600 4294967248 48 2147483440 176 2147483568 112 2147483504 240 2147483632 4294967280 8589934576 17...

result:

ok AC

Test #45:

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

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:

0 72057594037927424 256 72057594037927680 128 72057594037927552 384 72057594037927808 64 72057594037927488 320 72057594037927744 192 72057594037927616 448 72057594037927872 144115188075855808 32 72057594037927456 288 72057594037927712 160 72057594037927584 416 72057594037927840 96 72057594037927520 ...

result:

ok AC

Test #46:

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

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:

0 144115188075855744 288230376151711616 64 144115188075855808 288230376151711680 576460752303423424 32 144115188075855776 288230376151711648 96 144115188075855840 288230376151711712 576460752303423456 16 144115188075855760 288230376151711632 80 144115188075855824 288230376151711696 57646075230342344...

result:

ok AC

Test #47:

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

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:

0 9007199254740480 256 9007199254740736 18014398509481728 128 9007199254740608 384 9007199254740864 18014398509481856 64 9007199254740544 320 9007199254740800 18014398509481792 192 9007199254740672 448 9007199254740928 18014398509481920 36028797018963904 32 9007199254740512 288 9007199254740768 1801...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed