-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
32 lines (28 loc) · 756 Bytes
/
A.cpp
File metadata and controls
32 lines (28 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>;
using namespace std;
//----------------------Code Starts Here-----------------------------//
const int N = 2e5 + 1;
int p[N];
signed main() {
cin.tie(0);
cout.tie(0);
ios_base::sync_with_stdio(0);
int T;
cin >> T;
while (T--) {
long long a, b;
cin >> a >> b;
set<int> st;
st.insert(a * 1 + b * 2 + 1);
if (a == 0)
st.insert(1);
cout << *st.begin() << endl;
}
}