#include <bits/stdc++.h>
using namespace std;
int n, k;
vector<int> v;
set<int> s;
set<int>::iterator it;
vector<pair<int, pair<int, int> > > q;
const int N = 6 * 1000 * 100 + 5;
int fw[N];
void update(int idx, int value) {
  for (; idx < N; idx = (idx | (idx + 1))) {
    fw[idx] += value;
  }
}
int get(int r) {
  int res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) {
    res += fw[r];
  }
  return res;
}
int sum(int l, int r) { return get(r) - get(l - 1); }
multiset<int> ms;
multiset<int>::iterator its;
int ans = 0;
int main() {
  int l, r, i;
  scanf("%d %d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d %d", &l, &r);
    q.push_back(make_pair(l, make_pair(r, i)));
    s.insert(r);
    s.insert(l);
  }
  sort(q.begin(), q.end());
  for (it = s.begin(); it != s.end(); it++) {
    v.push_back(*it);
  }
  int low, high, mid, pos = -1;
  for (i = 0; i < (int(q.size())); i++) {
    l = q[i].first;
    r = (q[i].second).first;
    low = -1;
    high = (int(v.size()));
    while (high - low > 1) {
      mid = (high + low) / 2;
      if (v[mid] >= r) {
        high = mid;
      } else {
        low = mid;
      }
    }
    int right = high + 1;
    low = -1;
    high = (int(v.size()));
    while (high - low > 1) {
      mid = (high + low) / 2;
      if (v[mid] >= l) {
        high = mid;
      } else {
        low = mid;
      }
    }
    int left = high + 1;
    update(right, 1);
    low = left - 1;
    high = N;
    while (high - low > 1) {
      mid = (high + low) / 2;
      if (sum(mid, N - 1) >= k) {
        low = mid;
      } else {
        high = mid;
      }
    }
    if (low != 0) {
      if (ans < v[low - 1] - l + 1) {
        ans = v[low - 1] - l + 1;
        pos = i;
      }
    }
  }
  printf("%d\n", ans);
  vector<pair<int, int> > t;
  for (i = 0; i <= pos; i++) {
    t.push_back(make_pair((q[i].second).first, (q[i].second).second));
  }
  if (ans == 0) {
    for (i = 1; i <= k; i++) {
      printf("%d ", i);
    }
  } else {
    sort(t.begin(), t.end());
    for (i = (int(t.size())) - 1; i >= (int(t.size())) - k; i--) {
      printf("%d\n", t[i].second);
    }
  }
  return 0;
}
