Skip to content

Commit 8355a4f

Browse files
committed
Initial commit
1 parent e223efe commit 8355a4f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//author @Nishant
2+
3+
#include <iostream>
4+
using namespace std;
5+
int main()
6+
{
7+
int t;
8+
cin >> t;
9+
while(t--){
10+
unsigned long long a, b;
11+
cin >> a >> b;
12+
if(b - a == 1 || (b & (b - 1)) == b - 1){
13+
cout << (b & (b - 1)) << endl;
14+
}else{
15+
cout << b - 2 << endl;
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)