SHARE
TWEET

Untitled

a guest Mar 13th, 2019 465 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. signed main() {
  5.     #ifdef HOME
  6.         freopen("input.txt", "r", stdin);
  7.     #else
  8.         ios_base::sync_with_stdio(0); cin.tie(0); cout.precision(20);
  9.     #endif
  10.     int n, p;
  11.     cin >> n >> p;
  12.     cout << (2 * n + 1) + (n - 1) + min(p - 1, n - p) << '\n';
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top