QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#423946#8174. Set ConstructioncqbzlyAC ✓4ms3916kbC++201.7kb2024-05-28 19:56:112024-05-28 19:56:12

Judging History

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

  • [2024-05-28 19:56:12]
  • 评测
  • 测评结果:AC
  • 用时:4ms
  • 内存:3916kb
  • [2024-05-28 19:56:11]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long 
#define fi first
#define se second
#define pb push_back
#define inf 0x3f3f3f3f
#define vi vector<ll>
using namespace std;
//map<int,int>mp,res;
int T,n,m;
vector<ll>num;
void sol1(int x){
	assert(x>=0);
	ll y=0;
	for(int i=x;i<n;i++)y+=1ll<<i;
	num.pb(y); 
}
void sol2(int x){
	assert(x>=0);
	int sz=num.size();
	for(int i=0;i<sz;i++){
		num.pb(num[i]+(1ll<<x));
	}
}
//mt19937 gen(114514);
//int n=5;
//bool dfs(){
//	if(mp.size()>15)return 0;
//	if(mp.size()==15){
//		res=mp;
//		return 1;
//	}
//	map<int,int>mp0=mp;
//	for(int i=1;i<=10;i++){
//		int x=gen()%(1<<n);
//		if(mp[x])continue;
//		mp[x]=1;
//		for(auto e:mp){
//			mp[e.fi&x]=1;
//			mp[e.fi|x]=1;
//		}
//		if(dfs())return 1;
//		mp=mp0;
//	}return 0;
//}
int main(){
    //freopen("data.in","r",stdin);
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
//    srand(time(0));
//    mp[0]=mp[(1<<n)-1]=1;
//    dfs();
//    for(auto e:res){
//    	cout<<e.fi<<" ";
//	}
    cin>>T;
    while(T--){
    	cin>>n>>m;
    	if(n==5&&m==15){
    		cout<<"0 2 3 10 11 16 18 19 20 22 23 26 27 30 31"<<"\n";
    		continue;
		}
		vector<int>v;
		int tmp=m;
		while(tmp)v.pb(tmp&1),tmp>>=1;
		reverse(v.begin(),v.end());
		vector<int>vec;
		if(v[1])vec.pb(0);
		for(int i=2;i<v.size();i++){
			vec.pb(1);
			if(v[i])vec.pb(0);
		}
		int rest=n-1-vec.size();
		ll val=1ll<<n-1;int cur=n-2;
		for(int i=0;i<rest;i++){
			val+=1ll<<cur;
			cur--;
		}
		num.clear(),num.pb(0),num.pb(val);
		for(auto e:vec){
			if(!e)sol1(cur--);
			else sol2(cur--);
		}
		for(auto e:num)cout<<e<<" ";
		cout<<"\n";
	}
}

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 4 2 6 7 
0 12 2 14 1 13 3 15 
0 1152921504606846975 

result:

ok AC

Test #2:

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

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 62 63 
0 62 1 63 
0 60 2 62 63 
0 60 62 1 61 63 
0 56 60 2 58 62 63 
0 60 2 62 1 61 3 63 
0 56 4 60 2 58 6 62 63 
0 56 4 60 62 1 57 5 61 63 
0 48 8 56 60 2 50 10 58 62 63 
0 56 60 2 58 62 1 57 61 3 59 63 
0 48 56 4 52 60 2 50 58 6 54 62 63 
0 48 56 4 52 60 62 1 49 57 5 53 61 63 
0 32 48 8 40...

result:

ok AC

Test #3:

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

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 120 124 2 122 126 1 121 125 3 123 127 
0 112 120 4 116 124 2 114 122 6 118 126 127 
0 112 120 4 116 124 126 1 113 121 5 117 125 127 
0 96 112 8 104 120 124 2 98 114 10 106 122 126 127 
0 120 4 124 2 122 6 126 1 121 5 125 3 123 7 127 
0 112 8 120 4 116 12 124 2 114 10 122 6 118 14 126 127 
0 112 8 ...

result:

ok AC

Test #4:

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

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 224 240 8 232 248 252 2 226 242 10 234 250 254 255 
0 248 4 252 2 250 6 254 1 249 5 253 3 251 7 255 
0 240 8 248 4 244 12 252 2 242 10 250 6 246 14 254 255 
0 240 8 248 4 244 12 252 254 1 241 9 249 5 245 13 253 255 
0 224 16 240 8 232 24 248 252 2 226 18 242 10 234 26 250 254 255 
0 240 8 248 252 ...

result:

ok AC

Test #5:

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

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 504 4 508 510 1 505 5 509 511 
0 496 8 504 508 2 498 10 506 510 511 
0 504 508 2 506 510 1 505 509 3 507 511 
0 496 504 4 500 508 2 498 506 6 502 510 511 
0 496 504 4 500 508 510 1 497 505 5 501 509 511 
0 480 496 8 488 504 508 2 482 498 10 490 506 510 511 
0 504 4 508 2 506 6 510 1 505 5 509 3 50...

result:

ok AC

Test #6:

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

input:

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

output:

0 480 16 496 504 4 484 20 500 508 2 482 18 498 506 6 486 22 502 510 1 481 17 497 505 5 485 21 501 509 3 483 19 499 507 7 487 23 503 511 
0 448 32 480 496 8 456 40 488 504 4 452 36 484 500 12 460 44 492 508 2 450 34 482 498 10 458 42 490 506 6 454 38 486 502 14 462 46 494 510 511 
0 448 32 480 496 8 ...

result:

ok AC

Test #7:

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

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 1152921504606838784 1152921504606842880 2048 1152921504606840832 1152921504606844928 1152921504606845952 512 1152921504606839296 1152921504606843392 2560 1152921504606841344 1152921504606845440 1152921504606846464 256 1152921504606839040 1152921504606843136 2304 1152921504606841088 115292150460684...

result:

ok AC

Test #8:

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

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 576460752303390720 576460752303407104 8192 576460752303398912 576460752303415296 4096 576460752303394816 576460752303411200 12288 576460752303403008 576460752303419392 576460752303421440 1024 576460752303391744 576460752303408128 9216 576460752303399936 576460752303416320 5120 576460752303395840 5...

result:

ok AC

Test #9:

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

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 288230376151703552 288230376151707648 2048 288230376151705600 288230376151709696 1024 288230376151704576 288230376151708672 3072 288230376151706624 288230376151710720 288230376151711232 256 288230376151703808 288230376151707904 2304 288230376151705856 288230376151709952 1280 288230376151704832 288...

result:

ok AC

Test #10:

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

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

result:

ok AC

Test #11:

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

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 2 3 
0 30 1 31 
0 8 4 12 2 10 6 14 15 
0 30 1 31 
0 3 
0 16 8 24 28 2 18 10 26 30 31 
0 3 
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 4 2 6 7 
0 2 3 
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 3 
0 24 4 28 2 26 6 30 31 
0 8 12 2 10 14 15 
0 15 
0 4 2 6 7 
0 12 14 1 13 15 
0 2 3 
0 3 
0 16 24 4 2...

result:

ok AC

Test #12:

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

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 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 10 11 16 18 19 20 22 23 26 27 30 31
0 2 3 ...

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 536869888 536870400 256 536870144 536870656 536870784 64 536869952 536870464 320 536870208 536870720 536870848 536870880 16 536869904 536870416 272 536870160 536870672 536870800 80 536869968 536870480 336 536870224 536870736 536870864 536870896 8 536869896 536870408 264 536870152 536870664 5368707...

result:

ok AC

Test #14:

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

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 281474976710400 128 281474976710528 64 281474976710464 192 281474976710592 32 281474976710432 160 281474976710560 96 281474976710496 224 281474976710624 16 281474976710416 144 281474976710544 80 281474976710480 208 281474976710608 48 281474976710448 176 281474976710576 112 281474976710512 240 2814...

result:

ok AC

Test #15:

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

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 8387584 512 8388096 256 8387840 768 8388352 8388480 64 8387648 576 8388160 320 8387904 832 8388416 8388544 8388576 16 8387600 528 8388112 272 8387856 784 8388368 8388496 80 8387664 592 8388176 336 8387920 848 8388432 8388560 8388592 8 8387592 520 8388104 264 8387848 776 8388360 8388488 72 8387656 ...

result:

ok AC

Test #16:

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

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 72057594037923840 72057594037925888 1024 72057594037924864 72057594037926912 72057594037927424 256 72057594037924096 72057594037926144 1280 72057594037925120 72057594037927168 72057594037927680 72057594037927808 64 72057594037923904 72057594037925952 1088 72057594037924928 72057594037926976 720575...

result:

ok AC

Test #17:

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

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 9007199254740480 256 9007199254740736 128 9007199254740608 384 9007199254740864 64 9007199254740544 320 9007199254740800 192 9007199254740672 448 9007199254740928 32 9007199254740512 288 9007199254740768 160 9007199254740640 416 9007199254740896 96 9007199254740576 352 9007199254740832 224 9007199...

result:

ok AC

Test #18:

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

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 68719475712 68719476224 256 68719475968 68719476480 128 68719475840 68719476352 384 68719476096 68719476608 64 68719475776 68719476288 320 68719476032 68719476544 192 68719475904 68719476416 448 68719476160 68719476672 68719476704 16 68719475728 68719476240 272 68719475984 68719476496 144 68719475...

result:

ok AC

Test #19:

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

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 140737488351232 140737488353280 1024 140737488352256 140737488354304 512 140737488351744 140737488353792 1536 140737488352768 140737488354816 256 140737488351488 140737488353536 1280 140737488352512 140737488354560 768 140737488352000 140737488354048 1792 140737488353024 140737488355072 128 140737...

result:

ok AC

Test #20:

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

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 33554176 128 33554304 33554368 32 33554208 160 33554336 33554400 16 33554192 144 33554320 33554384 48 33554224 176 33554352 33554416 8 33554184 136 33554312 33554376 40 33554216 168 33554344 33554408 24 33554200 152 33554328 33554392 56 33554232 184 33554360 33554424 4 33554180 132 33554308 335543...

result:

ok AC

Test #21:

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

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 9007199254724608 8192 9007199254732800 9007199254736896 2048 9007199254726656 10240 9007199254734848 9007199254738944 1024 9007199254725632 9216 9007199254733824 9007199254737920 3072 9007199254727680 11264 9007199254735872 9007199254739968 9007199254740480 256 9007199254724864 8448 90071992547330...

result:

ok AC

Test #22:

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

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 33553920 256 33554176 33554304 64 33553984 320 33554240 33554368 32 33553952 288 33554208 33554336 96 33554016 352 33554272 33554400 16 33553936 272 33554192 33554320 80 33554000 336 33554256 33554384 48 33553968 304 33554224 33554352 112 33554032 368 33554288 33554416 8 33553928 264 33554184 3355...

result:

ok AC

Test #23:

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

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 1048448 64 1048512 1048544 16 1048464 80 1048528 1048560 8 1048456 72 1048520 1048552 24 1048472 88 1048536 1048568 4 1048452 68 1048516 1048548 20 1048468 84 1048532 1048564 12 1048460 76 1048524 1048556 28 1048476 92 1048540 1048572 2 1048450 66 1048514 1048546 18 1048466 82 1048530 1048562 10 1...

result:

ok AC

Test #24:

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

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 562949953404928 8192 562949953413120 4096 562949953409024 12288 562949953417216 2048 562949953406976 10240 562949953415168 6144 562949953411072 14336 562949953419264 562949953420288 512 562949953405440 8704 562949953413632 4608 562949953409536 12800 562949953417728 2560 562949953407488 10752 56294...

result:

ok AC

Test #25:

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

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 35184372072448 8192 35184372080640 35184372084736 2048 35184372074496 10240 35184372082688 35184372086784 35184372087808 512 35184372072960 8704 35184372081152 35184372085248 2560 35184372075008 10752 35184372083200 35184372087296 35184372088320 35184372088576 128 35184372072576 8320 3518437208076...

result:

ok AC

Test #26:

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

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 1920 1984 32 1952 2016 2032 8 1928 1992 40 1960 2024 2040 2044 2 1922 1986 34 1954 2018 2034 10 1930 1994 42 1962 2026 2042 2046 1 1921 1985 33 1953 2017 2033 9 1929 1993 41 1961 2025 2041 2045 3 1923 1987 35 1955 2019 2035 11 1931 1995 43 1963 2027 2043 2047 
0 562949953419264 1024 56294995342028...

result:

ok AC

Test #27:

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

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 4398046510080 4398046510592 256 4398046510336 4398046510848 4398046510976 64 4398046510144 4398046510656 320 4398046510400 4398046510912 4398046511040 32 4398046510112 4398046510624 288 4398046510368 4398046510880 4398046511008 96 4398046510176 4398046510688 352 4398046510432 4398046510944 4398046...

result:

ok AC

Test #28:

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

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 2251799813677056 4096 2251799813681152 2048 2251799813679104 6144 2251799813683200 2251799813684224 512 2251799813677568 4608 2251799813681664 2560 2251799813679616 6656 2251799813683712 2251799813684736 256 2251799813677312 4352 2251799813681408 2304 2251799813679360 6400 2251799813683456 2251799...

result:

ok AC

Test #29:

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

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 33552384 33553408 512 33552896 33553920 256 33552640 33553664 768 33553152 33554176 33554304 64 33552448 33553472 576 33552960 33553984 320 33552704 33553728 832 33553216 33554240 33554368 33554400 16 33552400 33553424 528 33552912 33553936 272 33552656 33553680 784 33553168 33554192 33554320 80 3...

result:

ok AC

Test #30:

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

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 1125899906841600 512 1125899906842112 1125899906842368 128 1125899906841728 640 1125899906842240 1125899906842496 1125899906842560 32 1125899906841632 544 1125899906842144 1125899906842400 160 1125899906841760 672 1125899906842272 1125899906842528 1125899906842592 16 1125899906841616 528 112589990...

result:

ok AC

Test #31:

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

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 9007199254732800 9007199254736896 2048 9007199254734848 9007199254738944 9007199254739968 512 9007199254733312 9007199254737408 2560 9007199254735360 9007199254739456 9007199254740480 9007199254740736 128 9007199254732928 9007199254737024 2176 9007199254734976 9007199254739072 9007199254740096 640...

result:

ok AC

Test #32:

score: 0
Accepted
time: 0ms
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 281474976706560 2048 281474976708608 1024 281474976707584 3072 281474976709632 512 281474976707072 2560 281474976709120 1536 281474976708096 3584 281474976710144 256 281474976706816 2304 281474976708864 1280 281474976707840 3328 281474976709888 768 281474976707328 2816 281474976709376 1792 2814749...

result:

ok AC

Test #33:

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

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 9007199254740960 9007199254740976 8 9007199254740968 9007199254740984 4 9007199254740964 9007199254740980 12 9007199254740972 9007199254740988 2 9007199254740962 9007199254740978 10 9007199254740970 9007199254740986 6 9007199254740966 9007199254740982 14 9007199254740974 9007199254740990 900719925...

result:

ok AC

Test #34:

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

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 17592186044288 17592186044352 32 17592186044320 17592186044384 17592186044400 8 17592186044296 17592186044360 40 17592186044328 17592186044392 17592186044408 17592186044412 2 17592186044290 17592186044354 34 17592186044322 175921...

result:

ok AC

Test #35:

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

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 18014398509481968 18014398509481976 4 18014398509481972 18014398509481980 2 18014398509481970 18014398509481978 6 18014398509481974 18014398509481982 18014398509481983 
0 72057594037927872 72057594037927904 16 72057594037927888 72057594037927920 8 72057594037927880 72057594037927912 24 72057594037...

result:

ok AC

Test #36:

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

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 8589934560 8589934576 8 8589934568 8589934584 4 8589934564 8589934580 12 8589934572 8589934588 8589934590 1 8589934561 8589934577 9 8589934569 8589934585 5 8589934565 8589934581 13 8589934573 8589934589 8589934591 
0 536870908 536870910 1 536870909 536870911 
0 549755813872 549755813880 4 54975581...

result:

ok AC

Test #37:

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

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 1073741792 1073741808 8 1073741800 1073741816 4 1073741796 1073741812 12 1073741804 1073741820 1073741822 1 1073741793 1073741809 9 1073741801 1073741817 5 1073741797 1073741813 13 1073741805 1073741821 1073741823 
0 33554428 2 33554430 1 33554429 3 33554431 
0 1099511627760 8 1099511627768 109951...

result:

ok AC

Test #38:

score: 0
Accepted
time: 1ms
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:

0 960 32 992 1008 8 968 40 1000 1016 1020 2 962 34 994 1010 10 970 42 1002 1018 1022 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 4398046511040 32 4398046...

result:

ok AC

Test #39:

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

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 4190208 4192256 1024 4191232 4193280 4193792 256 4190464 4192512 1280 4191488 4193536 4194048 4194176 64 4190272 4192320 1088 4191296 4193344 4193856 320 4190528 4192576 1344 4191552 4193600 4194112 4194240 4194272 16 4190224 4192272 1040 4191248 4193296 4193808 272 4190480 4192528 1296 4191504 41...

result:

ok AC

Test #40:

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

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 4398046509056 4398046510080 512 4398046509568 4398046510592 4398046510848 128 4398046509184 4398046510208 640 4398046509696 4398046510720 4398046510976 64 4398046509120 4398046510144 576 4398046509632 4398046510656 4398046510912 192 4398046509248 4398046510272 704 4398046509760 4398046510784 43980...

result:

ok AC

Test #41:

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

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 2199023253504 2199023254528 512 2199023254016 2199023255040 256 2199023253760 2199023254784 768 2199023254272 2199023255296 2199023255424 64 2199023253568 2199023254592 576 2199023254080 2199023255104 320 2199023253824 2199023254848 832 2199023254336 2199023255360 2199023255488 32 2199023253536 21...

result:

ok AC

Test #42:

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

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 64512 65024 256 64768 65280 65408 64 64576 65088 320 64832 65344 65472 65504 16 64528 65040 272 64784 65296 65424 80 64592 65104 336 64848 65360 65488 65520 8 64520 65032 264 64776 65288 65416 72 64584 65096 328 64840 65352 65480 65512 24 64536 65048 280 64792 65304 65432 88 64600 65112 344 64856 ...

result:

ok AC

Test #43:

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

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 268434432 268434944 256 268434688 268435200 128 268434560 268435072 384 268434816 268435328 64 268434496 268435008 320 268434752 268435264 192 268434624 268435136 448 268434880 268435392 32 268434464 268434976 288 268434720 268435232 160 268434592 268435104 416 268434848 268435360 96 268434528 268...

result:

ok AC

Test #44:

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

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 34359734272 2048 34359736320 1024 34359735296 3072 34359737344 34359737856 256 34359734528 2304 34359736576 1280 34359735552 3328 34359737600 34359738112 34359738240 64 34359734336 2112 34359736384 1088 34359735360 3136 34359737408 34359737920 320 34359734592 2368 34359736640 1344 34359735616 3392...

result:

ok AC

Test #45:

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

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 1152921504606838784 4096 1152921504606842880 2048 1152921504606840832 6144 1152921504606844928 1024 1152921504606839808 5120 1152921504606843904 3072 1152921504606841856 7168 1152921504606845952 1152921504606846464 256 1152921504606839040 4352 1152921504606843136 2304 1152921504606841088 6400 1152...

result:

ok AC

Test #46:

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

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 1152921504606845952 1152921504606846464 256 1152921504606846208 1152921504606846720 1152921504606846848 64 1152921504606846016 1152921504606846528 320 1152921504606846272 1152921504606846784 1152921504606846912 32 1152921504606845984 1152921504606846496 288 1152921504606846240 1152921504606846752 ...

result:

ok AC

Test #47:

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

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 288230376151695360 8192 288230376151703552 288230376151707648 2048 288230376151697408 10240 288230376151705600 288230376151709696 1024 288230376151696384 9216 288230376151704576 288230376151708672 3072 288230376151698432 11264 288230376151706624 288230376151710720 288230376151711232 256 2882303761...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed