|
| 1 | +// https://codeforces.com/contest/1660/problem/A |
| 2 | +/* |
| 3 | +
|
| 4 | + ░██████╗██████╗░░█████╗░██████╗░░██████╗██╗░░██╗ ░██████╗░██╗░░░██╗██████╗░████████╗░█████╗░ |
| 5 | + ██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝██║░░██║ ██╔════╝░██║░░░██║██╔══██╗╚══██╔══╝██╔══██╗ |
| 6 | + ╚█████╗░██████╔╝███████║██████╔╝╚█████╗░███████║ ██║░░██╗░██║░░░██║██████╔╝░░░██║░░░███████║ |
| 7 | + ░╚═══██╗██╔═══╝░██╔══██║██╔══██╗░╚═══██╗██╔══██║ ██║░░╚██╗██║░░░██║██╔═══╝░░░░██║░░░██╔══██║ |
| 8 | + ██████╔╝██║░░░░░██║░░██║██║░░██║██████╔╝██║░░██║ ╚██████╔╝╚██████╔╝██║░░░░░░░░██║░░░██║░░██║ |
| 9 | + ╚═════╝░╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░╚═╝░░╚═╝ ░╚═════╝░░╚═════╝░╚═╝░░░░░░░░╚═╝░░░╚═╝░░╚═╝ |
| 10 | + ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |
| 11 | + █████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗ |
| 12 | + ╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝ |
| 13 | + ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ |
| 14 | +
|
| 15 | +*/ |
| 16 | + |
| 17 | +#include <bits/stdc++.h> |
| 18 | + |
| 19 | +using namespace std; |
| 20 | + |
| 21 | +#define fi first |
| 22 | +#define se second |
| 23 | +#define pb push_back |
| 24 | +#define mp make_pair |
| 25 | +#define all(x) x.begin(), x.end() |
| 26 | +#define ll long long |
| 27 | +#define pll pair<ll, ll> |
| 28 | +#define vll vector<long long> |
| 29 | +#define vpll vector<pll> |
| 30 | +#define mll map<ll, ll> |
| 31 | +#define sz(x) ((int) x.size()) |
| 32 | +#define inf 1e18 |
| 33 | +#define que_max priority_queue<ll> |
| 34 | +#define que_min priority_queue <ll, vll, greater<ll>> |
| 35 | +#define gcd(a, b) __gcd(a, b) |
| 36 | +#define range(a,b) substr(a,b-a+1) |
| 37 | +#define setbits(x) __builtin_popcountll(x) |
| 38 | +#define zrobits(x) __builtin_ctzll(x) |
| 39 | +#define fori(a, n) for (ll i = a; i < n; i++) |
| 40 | +#define forj(a, n) for (ll j = a; j < n; j++) |
| 41 | +#define fork(a, n) for (ll k = a; k < n; k++) |
| 42 | +#define print(x) for (auto i : x) cout << i << " "; cout << "\n"; |
| 43 | +#define print1(x) for (auto i : x) cout << i.fi << " " << i.se << "\n"; |
| 44 | +#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) |
| 45 | +mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); |
| 46 | + |
| 47 | +inline ll power(ll a, ll b) |
| 48 | +{ |
| 49 | + ll x = 1; |
| 50 | + while (b) { |
| 51 | + if (b & 1) |
| 52 | + x *= a; |
| 53 | + a *= a; |
| 54 | + b >>= 1; |
| 55 | + } |
| 56 | + return x; |
| 57 | +} |
| 58 | + |
| 59 | +template <class T> |
| 60 | +bool comp(T a, T b) { |
| 61 | + if (a < b) |
| 62 | + return true; |
| 63 | + return false; |
| 64 | +} |
| 65 | + |
| 66 | +void solve() { |
| 67 | + ll a, b; |
| 68 | + cin >> a >> b; |
| 69 | + if (a == 0) |
| 70 | + cout << 1 << "\n"; |
| 71 | + else |
| 72 | + cout << 2 * b + a + 1 << "\n"; |
| 73 | +} |
| 74 | + |
| 75 | +int32_t main() |
| 76 | +{ |
| 77 | + FIO; |
| 78 | + |
| 79 | + #ifndef ONLINE_JUDGE |
| 80 | + //remove this piece of code when this has to be submitted in kickstart, coding ninjas |
| 81 | + freopen("input.txt", "r", stdin); |
| 82 | + freopen("output.txt", "w", stdout); |
| 83 | + //freopen is used to associate a file with stdin or stdout stream in C++ |
| 84 | + #endif |
| 85 | + |
| 86 | + clock_t z = clock(); |
| 87 | + |
| 88 | + ll t = 1; |
| 89 | + cin >> t; |
| 90 | + while (t--) { |
| 91 | + solve(); |
| 92 | + } |
| 93 | + |
| 94 | + cerr << "Run Time: " << ((double)(clock() - z) / CLOCKS_PER_SEC) << "\n"; |
| 95 | + |
| 96 | + return 0; |
| 97 | +} |
| 98 | + |
0 commit comments