Problem: It's been long after the events of the previous problems, and Karen has now moved on from student life and is looking to relocate to a new neighborhood.

<image>

The neighborhood consists of n houses in a straight line, labelled 1 to n from left to right, all an equal distance apart.

Everyone in this neighborhood loves peace and quiet. Because of this, whenever a new person moves into the neighborhood, he or she always chooses the house whose minimum distance to any occupied house is maximized. If there are multiple houses with the maximum possible minimum distance, he or she chooses the leftmost one.

Note that the first person to arrive always moves into house 1.

Karen is the k-th person to enter this neighborhood. If everyone, including herself, follows this rule, which house will she move into?

Input

The first and only line of input contains two integers, n and k (1 ≤ k ≤ n ≤ 1018), describing the number of houses in the neighborhood, and that Karen was the k-th person to move in, respectively.

Output

Output a single integer on a line by itself, the label of the house Karen will move into.

Examples

Input

6 4


Output

2


Input

39 3


Output

20

Note

In the first test case, there are 6 houses in the neighborhood, and Karen is the fourth person to move in:

  1. The first person moves into house 1. 
  2. The second person moves into house 6. 
  3. The third person moves into house 3. 
  4. The fourth person moves into house 2. 



In the second test case, there are 39 houses in the neighborhood, and Karen is the third person to move in:

  1. The first person moves into house 1. 
  2. The second person moves into house 39. 
  3. The third person moves into house 20. 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T>& operator--(vector<T>& v) {
  for (auto& i : v) --i;
  return v;
}
template <typename T>
vector<T>& operator++(vector<T>& v) {
  for (auto& i : v) ++i;
  return v;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& i : v) is >> i;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto& i : v) os << i << ' ';
  return os;
}
template <typename T, typename U>
istream& operator>>(istream& is, pair<T, U>& p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <typename T, typename U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
template <typename T, typename U>
void umin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void umax(T& a, U b) {
  if (a < b) a = b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  if (k == 1) {
    cout << 1 << '\n';
    return 0;
  }
  if (k == 2) {
    cout << n << '\n';
    return 0;
  }
  k -= 2;
  long long l = -1, r = n + 10;
  while (r - l > 1) {
    long long c = (l + r) / 2;
    map<long long, long long> m;
    function<long long(long long, long long)> count = [&](long long l,
                                                          long long r) {
      if (l + 1 >= r) return 0ll;
      if (m.count(r - l)) return m[r - l];
      long long mid = (l + r) / 2;
      if (abs(mid - l) < c) return 0ll;
      return m[r - l] = count(l, mid) + count(mid, r) + 1;
    };
    auto cnt = count(1, n);
    if (cnt < k)
      r = c;
    else
      l = c;
  }
  long long d = l;
  42;
  ;
  map<pair<long long, long long>, long long> m;
  function<long long(long long, long long, long long)> count =
      [&](long long l, long long r, long long d) {
        if (l + 1 >= r) return 0ll;
        if (m.count({r - l, d})) return m[{r - l, d}];
        long long mid = (l + r) / 2;
        if (abs(mid - l) < d) return 0ll;
        return m[{r - l, d}] = count(l, mid, d) + count(mid, r, d) + 1;
      };
  map<long long, long long> m2;
  function<long long(long long, long long)> count2 = [&](long long l,
                                                         long long r) {
    if (l + 1 >= r) return 0ll;
    if (m2.count(r - l)) return m2[r - l];
    long long mid = (l + r) / 2;
    if (abs(mid - l) < d) return 0ll;
    return m2[r - l] = count2(l, mid) + count2(mid, r) + (mid - l == d);
  };
  k -= count(1, n, d + 1);
  function<long long(long long, long long, long long)> get_ans =
      [&](long long l, long long r, long long k) {
        42;
        ;
        long long mid = (l + r) / 2;
        k -= (mid - l == d);
        if (k == 0) return mid;
        long long cnt = count2(l, mid);
        42;
        ;
        if (cnt >= k)
          return get_ans(l, mid, k);
        else
          return get_ans(mid, r, k - cnt);
      };
  cout << get_ans(1, n, k) << '\n';
  return 0;
}