#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
typedef pair<int,int> P;
typedef long long ll;



int main() {
    int n, l;
    cin >> n >> l;
    
    int mn = 1000, sum = 0;
    rep(i,n) {
        int t = i + l;
        sum += t;
        mn = min(abs(t),abs(mn));
        if(t < 0)
            mn *= -1;
    }
    
    cout << sum - mn << endl;
    
    
    
    return 0;
}

#include <bits/stdc++.h>

const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;

typedef long long ll;

#define REP(i, n) for (int i = 0; i < int(n); i++)
#define REPD(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = a; i < int(b); i++)
#define FORD(i, a, b) for (int i = b - 1; i >= int(a); i--)
#define WRAP(y, x, h, w) (0 <= y && y < h && 0 <= x && x < w)

#define ALL(x) (x).begin(), (x).end()

int dx[4] = { 1, 0, -1, 0 };
int dy[4] = { 0, 1, 0, -1 };

int main()
{
    int n, m;
    cin >> n >> m;
    if (n % 2 == 1) {
        REP(i, m)
        {
            cout << i + 1 << " " << n - 1 - i << endl;
        }
    } else {
        REP(i, m)
        {
            if (i > (n-4)/4)
                cout << n / 2 - i << " " << n / 2 + 2 + i << endl;
            else
                cout << n / 2 - i << " " << n / 2 + 1 + i << endl;
        }
    }
}