#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

#define ll long long

int N, K;
ll L[30000];
ll R[30000];

struct Left  { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };
struct Right { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };

bool operator<(const Left  &a, const Left  &b) { return L[a.i] != L[b.i] ? L[a.i] < L[b.i] : a.i < b.i; }
bool operator<(const Right &a, const Right &b) { return R[a.i] != R[b.i] ? R[a.i] < R[b.i] : a.i < b.i; }

int main() {
	cin.tie(0); cout.tie(0);

	cin >> N >> K;
	set<Left> lefts;
	for(int i = 0; i < N; i++) {
		cin >> L[i] >> R[i];
		lefts.insert(Left{i});
	}
	set<Right> rights;
	set<Right>::iterator kth;
	ll best = 0;
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans > best) {
			best = ans;
		}
	}
	cout << best << "\n";
	if(best == 0) {
		if(N == 300000 && K == 234661) {
			cout << "wtf?" << endl;
		}
		for(int i = 1; i <= K; i++) {
			if(i > 1) cout << " ";
			cout << i;
		}
		cout << endl;
		return 0;
	}
	rights.clear();
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans == best) {
			int i = 0;
			for(auto r : rights) {
				if(i > 0) cout << " ";
				cout << r.i + 1;
				if(++i == K) {
					break;
				}
			}
			cout << "\n";
			break;
		}
	}
}


#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

#define ll long long

int N, K;
ll L[300001];
ll R[300001];

struct Left  { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };
struct Right { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };

bool operator<(const Left  &a, const Left  &b) { return L[a.i] != L[b.i] ? L[a.i] < L[b.i] : a.i < b.i; }
bool operator<(const Right &a, const Right &b) { return R[a.i] != R[b.i] ? R[a.i] < R[b.i] : a.i < b.i; }

int main() {
	cin.tie(0); cout.tie(0);

	cin >> N >> K;
	set<Left> lefts;
	for(int i = 0; i < N; i++) {
		cin >> L[i] >> R[i];
		lefts.insert(Left{i});
	}
	set<Right> rights;
	set<Right>::iterator kth;
	ll best = 0;
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.begin();
		else if(*kth < r) ++kth;
		ll ans = kth->r() - l.l() + 1;
		if(ans > best) {
			best = ans;
		}
	}
	cout << best << "\n";
	if(best == 0) {
		for(int i = 1; i <= K; i++) {
			if(i > 1) cout << " ";
			cout << i;
		}
		cout << endl;
		return 0;
	}
	rights.clear();
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.begin();
		else if(*kth < r) ++kth;
		ll ans = kth->r() - l.l() + 1;
		if(ans == best) {
			auto r = rights.end(); --r;
			for(int i = 0; i < K; i++) {
				if(i > 0) cout << " ";
				cout << r->i + 1;
				--r;
			}
			cout << "\n";
			break;
		}
	}
}


#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

#define ll long long

int N, K;
ll L[30000];
ll R[30000];

struct Left  { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };
struct Right { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };

bool operator<(const Left  &a, const Left  &b) { return L[a.i] != L[b.i] ? L[a.i] < L[b.i] : a.i < b.i; }
bool operator<(const Right &a, const Right &b) { return R[a.i] != R[b.i] ? R[a.i] < R[b.i] : a.i < b.i; }

int main() {
	cin >> N >> K;
	set<Left> lefts;
	for(int i = 0; i < N; i++) {
		cin >> L[i] >> R[i];
		lefts.insert(Left{i});
	}
	set<Right> rights;
	set<Right>::iterator kth;
	ll best = 0;
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans > best) {
			best = ans;
		}
	}
	cout << best << "\n";
	if(best == 0) {
		for(int i = 1; i <= K; i++) {
			if(i > 1) cout << " ";
			cout << i;
		}
		cout << "\n";
		return 0;
	}
	rights.clear();
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans == best) {
			int i = 0;
			for(auto r : rights) {
				if(i > 0) cout << " ";
				cout << r.i + 1;
				if(++i == K) {
					break;
				}
			}
			cout << "\n";
			break;
		}
	}
}


#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

#define ll long long

int N, K;
ll L[300001];
ll R[300001];

struct Left  { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };
struct Right { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };

bool operator<(const Left  &a, const Left  &b) { return L[a.i] != L[b.i] ? L[a.i] < L[b.i] : a.i < b.i; }
bool operator<(const Right &a, const Right &b) { return R[a.i] != R[b.i] ? R[a.i] < R[b.i] : a.i < b.i; }

int main() {
	cin.tie(0); cout.tie(0);

	cin >> N >> K;
	set<Left> lefts;
	for(int i = 0; i < N; i++) {
		cin >> L[i] >> R[i];
		lefts.insert(Left{i});
	}
	set<Right> rights;
	set<Right>::iterator kth;
	ll best = 0;
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(*kth < r) ++kth;
		ll ans = kth->r() - l.l() + 1;
		if(ans > best) {
			best = ans;
		}
	}
	cout << best << "\n";
	if(best == 0) {
		for(int i = 1; i <= K; i++) {
			if(i > 1) cout << " ";
			cout << i;
		}
		cout << endl;
		return 0;
	}
	rights.clear();
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(*kth < r) ++kth;
		ll ans = kth->r() - l.l() + 1;
		if(ans == best) {
			auto r = rights.end(); --r;
			for(int i = 0; i < K; i++) {
				if(i > 0) cout << " ";
				cout << r->i + 1;
				--r;
			}
			cout << "\n";
			break;
		}
	}
}


#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

#define ll long long

int N, K;
ll L[300001];
ll R[300001];

struct Left  { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };
struct Right { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };

bool operator<(const Left  &a, const Left  &b) { return L[a.i] != L[b.i] ? L[a.i] < L[b.i] : a.i < b.i; }
bool operator<(const Right &a, const Right &b) { return R[a.i] != R[b.i] ? R[a.i] < R[b.i] : a.i < b.i; }

int main() {
	cin.tie(0); cout.tie(0);

	cin >> N >> K;
	set<Left> lefts;
	for(int i = 0; i < N; i++) {
		cin >> L[i] >> R[i];
		lefts.insert(Left{i});
	}
	set<Right> rights;
	set<Right>::iterator kth;
	ll best = 0;
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans > best) {
			best = ans;
		}
	}
	cout << best << "\n";
	if(best == 0) {
		for(int i = 1; i <= K; i++) {
			if(i > 1) cout << " ";
			cout << i;
		}
		cout << endl;
		return 0;
	}
	rights.clear();
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans == best) {
			int i = 0;
			for(auto r : rights) {
				if(i > 0) cout << " ";
				cout << r.i + 1;
				if(++i == K) {
					break;
				}
			}
			cout << "\n";
			break;
		}
	}
}


#include <iostream>
#include <algorithm>
#include <set>
using namespace std;

#define ll long long

int N, K;
ll L[30000];
ll R[30000];

struct Left  { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };
struct Right { int i; ll l() const { return L[i]; } ll r() const { return R[i]; } };

bool operator<(const Left  &a, const Left  &b) { return L[a.i] != L[b.i] ? L[a.i] < L[b.i] : a.i < b.i; }
bool operator<(const Right &a, const Right &b) { return R[a.i] != R[b.i] ? R[a.i] < R[b.i] : a.i < b.i; }

int main() {
	cin.tie(0); cout.tie(0);

	cin >> N >> K;
	set<Left> lefts;
	for(int i = 0; i < N; i++) {
		cin >> L[i] >> R[i];
		lefts.insert(Left{i});
	}
	set<Right> rights;
	set<Right>::iterator kth;
	ll best = 0;
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans > best) {
			best = ans;
		}
	}
	cout << best << "\n";
	if(best == 0) {
		for(int i = 1; i <= K; i++) {
			if(i > 1) cout << " ";
			cout << i;
		}
		cout << endl;
		return 0;
	}
	rights.clear();
	for(auto l : lefts) {
		while(!rights.empty() && rights.begin()->r() < l.l()) {
			rights.erase(rights.begin());
		}
		Right r{l.i};
		rights.insert(r);
		if(rights.size() < K) continue;
		if(rights.size() == K) kth = rights.end(), --kth;
		else if(r < *kth) --kth;
		ll ans = rights.begin()->r() - l.l() + 1;
		if(ans == best) {
			int i = 0;
			for(auto r : rights) {
				if(i > 0) cout << " ";
				cout << r.i + 1;
				if(++i == K) {
					break;
				}
			}
			cout << "\n";
			break;
		}
	}
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii> c;
set<int> ans;
ll n, k;

bool check(int len){
//    cerr << len << "\n";

    if(len == 0) return true;
    map<ll, vector<pii>> e;
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e[c[i].F].eb(mp(i, 1));
        e[c[i].S - len + 2].eb(mp(i, 0));
    }

    set<int> now;
    for(auto& i : e){
//        cerr << i.F << "  ";
//        printv(i.S, cerr);
        for(auto j : i.S){
            if(j.S == 1) now.insert(j.F);
            else now.erase(j.F);
        }
        if(now.size() >= k){
            ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;

    while(l < r){
        ll mid = (l + r + 1) / 2;
        assert(mid <= 2000000001);
        if(check(mid)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream &operator<<(ostream &o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii > c;
set<int> ans;
ll n, k;

vector<pair<int, pii>> e;

bool check(int len, bool t){
//    cerr << len << "\n";
    if(len == 0) return true;
    e.clear();
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e.eb(mp(c[i].F, mp(i, 1)));
        e.eb(mp(c[i].S - len + 2, mp(i, 0)));
    }
    lsort(e);

    set<int> now;
    int cnt = 0;
    for(auto &i : e){
        if(i.S.S == 1){
            if(t) now.insert(i.S.F);
            cnt++;
        }
        else{
            if(t) now.erase(i.S.F);
            cnt--;
        }
        if(cnt >= k){
            if(t) ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;

    while(l < r){
        ll mid = (l + r + 1) / 2;
        if(check(mid, false)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    check(l, true);

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream &operator<<(ostream &o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii > c;
set<int> ans;
ll n, k;

vector<pair<int, pii>> e;

bool check(int len, bool t){
//    cerr << "test " << len << "\n";
    if(len == 0) return true;
    e.clear();
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e.eb(mp(c[i].F, mp(1, i)));
        e.eb(mp(c[i].S - len + 2, mp(0, i)));
    }
    lsort(e);

    set<int> now;
    int cnt = 0;
    for(auto &i : e){
//        cerr << i << "\n";
        if(i.S.F == 1){
            if(t) now.insert(i.S.S);
            cnt++;
        }
        else{
            if(t) now.erase(i.S.S);
            cnt--;
        }
        if(cnt >= k){
            if(t) ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;

    while(l < r){
        ll mid = (l + r + 1) / 2;
        if(check(mid, false)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    check(l, true);

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii> c;
set<int> ans;
ll n, k;

bool check(int len, bool t){
//    cerr << len << "\n";

    if(len == 0) return true;
    vector<pair<int, pii>> e;
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e.eb(mp(c[i].F, mp(i, 1)));
        e.eb(mp(c[i].S - len + 2, mp(i, 0)));
    }
    lsort(e);

    set<int> now;
    for(auto& i : e){
        if(i.S.S == 1) now.insert(i.S.F);
        else now.erase(i.S.F);
        if(now.size() >= k){
            if(t) ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;

    while(l < r){
        ll mid = (l + r + 1) / 2;
        if(check(mid, false)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    check(l, true);

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii> c;
set<int> ans;
ll n, k;

bool check(int len){
//    cerr << len << "\n";

    if(len == 0) return true;
    vector<pair<int, pii>> e;
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e.eb(mp(c[i].F, mp(i, 1)));
        e.eb(mp(c[i].S - len + 2, mp(i, 0)));
    }
    lsort(e);

    set<int> now;
    for(auto& i : e){
        if(i.S.S == 1) now.insert(i.S.F);
        else now.erase(i.S.F);
        if(now.size() >= k){
            ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;

    while(l < r){
        ll mid = (l + r + 1) / 2;
        if(check(mid)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii> c;
set<int> ans;
int n, k;

bool check(int len){
//    cerr << len << "\n";

    if(len == 0) return true;
    map<int, vector<pii>> e;
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e[c[i].F].eb(mp(i, 1));
        e[c[i].S - len + 2].eb(mp(i, 0));
    }

    set<int> now;
    for(auto& i : e){
//        cerr << i.F << "  ";
//        printv(i.S, cerr);
        for(auto j : i.S){
            if(j.S == 1) now.insert(j.F);
            else now.erase(j.F);
        }
        if(now.size() >= k){
            ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;

    while(l < r){
        int mid = (l + r + 1) / 2;
        if(check(mid)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


//#define NDEBUG

#include <bits/stdc++.h>
#include <bits/extc++.h>

#define StarBurstStream ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define iter(a) a.begin(), a.end()
#define riter(a) a.rbegin(), a.rend()
#define lsort(a) sort(iter(a))
#define gsort(a) sort(riter(a))
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define pf(a) push_front(a)
#define pob pop_back()
#define pof pop_front()
#define F first
#define S second
#define printv(a, b) {bool pvaspace=false; \
for(auto pva : a){ \
    if(pvaspace) b << " "; pvaspace=true;\
    b << pva;\
}\
b << "\n";}
#define pii pair<int, int>
#define pll pair<ll, ll>
#define tiii tuple<int, int, int>
#define mt make_tuple
#define gt(t, i) get<i>(t)
#define iceil(a, b) ((a) / (b) + !!((a) % (b)))

//#define TEST

typedef long long ll;
typedef unsigned long long ull;

using namespace std;
using namespace __gnu_pbds;

const ll MOD = 1000000007;
const ll MAX = 2147483647;

template<typename A, typename B>
ostream& operator<<(ostream& o, pair<A, B> p){
    return o << '(' << p.F << ',' << p.S << ')';
}

vector<pii> c;
set<int> ans;
ll n, k;

bool check(int len){
//    cerr << len << "\n";

    if(len == 0) return true;
    map<ll, vector<pii>> e;
    for(int i = 0; i < n; i++){
        if(c[i].S - c[i].F + 1 < len) continue;
        e[c[i].F].eb(mp(i, 1));
        e[c[i].S - len + 2].eb(mp(i, 0));
    }

    set<int> now;
    for(auto& i : e){
//        cerr << i.F << "  ";
//        printv(i.S, cerr);
        for(auto j : i.S){
            if(j.S == 1) now.insert(j.F);
            else now.erase(j.F);
        }
        if(now.size() >= k){
            ans = now;
            return true;
        }
    }
    return false;
}

int main(){
    StarBurstStream

    cin >> n >> k;

    c.resize(n);
    for(int i = 0; i < n; i++) cin >> c[i].F >> c[i].S;
//    printv(c, cerr);

    ll l = 0, r = 2000000001;
    int tmp = 0;

    while(l < r){
        tmp++;
        assert(tmp <= 35);
        ll mid = (l + r + 1) / 2;
        assert(mid <= 2000000001);
        if(check(mid)) l = mid;
        else r = mid - 1;
    }

    if(l == 0){
        cout << "0\n";
        for(int i = 1; i <= k; i++) cout << i << " ";
        cout << "\n";
        return 0;
    }

    cout << l << "\n";
    int cnt = 0;
    for(int i : ans){
        cout << i + 1 << " ";
        cnt++;
        if(cnt == k) break;
    }
    cout << "\n";

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<int,int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-2;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
queue<tp> starts;
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se.fr == -1)
		{
			c++;
			//starts.insert(i.fr);
		}
		//SO(i.fr, i.se.se, i.se.fr, c, "-----------", st, ed);
		if(c >= k)
		{
			if(i.se.fr == -1)
			{
				//SO("ADDING",i.fr);
				starts.push(i.fr);
			}
			if(st==MNN)
				st=i.fr;
			ed=i.fr;
			//SO("Distance",ed, st, ABS(ed-st)+1);
			if(ed > MNN  and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			starts.pop();
			if(!starts.empty())
				st = starts.front();
			else
				st=MNN;

		}
		if(c < k)
		{
			st=MNN;
			ed=MNN;
		}
		//SO("end", i.fr, i.se.se, c);
	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<long long int,long long int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-10;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
queue<tp> starts;
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se.fr == -1)
			c++;
		if(c >= k)
		{
			if(i.se.fr == -1)
				starts.push(i.fr);
			if(st==MNN)
				st=i.fr;
			ed=i.fr;
			if(ed > MNN  and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			if(!starts.empty())
				starts.pop();
			if(!starts.empty())
				st = starts.front();
			else
				st=MNN;
		}
		if(c < k)
		{
			st=MNN;
			ed=MNN;
		}
	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<int,int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-2;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
queue<tp> starts;
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se.fr == -1)
		{
			c++;
			//starts.insert(i.fr);
		}
		//SO(i.fr, i.se.se, i.se.fr, c, "-----------", st, ed);
		if(c >= k)
		{
			if(i.se.fr == -1)
			{
				//SO("ADDING",i.fr);
				starts.push(i.fr);
			}
			if(st==MNN)
				st=i.fr;
			ed=i.fr;
			//SO("Distance",ed, st, ABS(ed-st)+1);
			if(ed > MNN  and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			try
			{
				starts.pop();
			}
			catch(...)
			{
			}
			if(!starts.empty())
				st = starts.front();
			else
				st=MNN;

		}
		if(c < k)
		{
			st=MNN;
			ed=MNN;
		}
		//SO("end", i.fr, i.se.se, c);
	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<int,int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp n, m,k, c = 0, ans=0, ST=-1, ED=-1, st=-1, ed=-1;
tp a[AS][2];
V( pi ) v;

int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], -1));
		v.pb(mp(a[i][1], 1));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se==-1)
			c++;
		//SO(i.fr, i.se, c);
		if(c>=k)
		{
			if(st==-1)
			{
				st=i.fr;
				ed=i.fr;
			}
			else
				ed=i.fr;
			//SO("Distance",ed, st);
			if(ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se==1)
			c--;
		if(c < k)
		{
			st=-1;
			ed=-1;
		}
		//SO("end", i.fr, i.se, c);

	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<int,int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp n, m,k, c = 0, ans=0, ST=-1, ED=-1, st=-1, ed=-1;
tp a[AS][2];
V( pi ) v;

int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], 1));
		v.pb(mp(a[i][1], -1));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se==1)
			c++;
		if(c>=k)
		{
			if(st==-1)
			{
				st=i.fr;
				ed=i.fr;
			}
			else
				ed=i.fr;
			if(ed-st+1 > ans)
			{
				ans = ed-st+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se==-1)
			c--;
		if(c < k)
		{
			st=-1;
			ed=-1;
		}
	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c > k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<long long int,long long int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-10;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
multiset<tp> starts;
void del(tp value)
{
	auto itr = starts.find(value);
	if(itr!=starts.end()){
	starts.erase(itr);
	}
}
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	//for(auto k : v)
	//	SO(k.fr, k.se.se, k.se.fr);
	for(auto i : v)
	{
		if(i.se.fr == -1)
			c++;
		if(c >= k)
		{
			if(i.se.fr == -1)
			{
				//SO("adding", i.fr);
				starts.insert(i.fr);
			}
			st = *starts.begin();
			ed = i.fr;
			//SO(i.fr, st, ed, "dist",  ABS(ed-st)+1, c);
			if(!starts.empty() and i.se.fr == 1 and ABS(ed-st)+1 > ans)
			{
				//SO("Here");
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			if(!starts.empty() and *starts.begin() >= i.se.se)
			{
				//SO("Erase", *starts.begin());
				del(*starts.begin());
			}
			else if(!starts.empty())
			{
				del(i.se.se);
			}
		}
		if(c < k)
			starts.clear();
		/*SO("Printing");
		for(auto l : starts)
			SO(l);
		SO("Done Printing");*/
	}
	SO(ans);//, ST, ED);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<long long int,long long int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-10;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
multiset<tp> starts;
void del(tp value)
{
	auto itr = starts.find(value);
	if(itr!=starts.end()){
	starts.erase(itr);
	}
}
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se.fr == -1)
			c++;
		if(c >= k)
		{
			if(i.se.fr == -1)
			{
			//	SO("adding", i.fr);
				starts.insert(i.fr);
			}
			st = *starts.begin();
			ed = i.fr;
			//SO(i.fr, st, ed, "dist",  ABS(ed-st)+1);
			if(!starts.empty() and i.se.fr == 1 and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			if(!starts.empty() and *starts.begin() >= i.se.se)
			{
				//SO("Erase", *starts.begin());
				del(*starts.begin());
			}
		}
		if(c < k)
			starts.clear();
		/*SO("Printing");
		for(auto l : starts)
			SO(l);
		SO("Done Printing");*/
	}
	SO(ans);//, ST, ED);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<long long int,long long int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-10;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
queue<tp> starts;
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se.fr == -1)
			c++;
		//SO(i.fr, i.se.se, i.se.fr, c, "-----------", st, ed);
		if(c >= k)
		{
			if(i.se.fr == -1)
			{
				//SO("ADDING",i.fr);
				starts.push(i.fr);
			}
			if(st==MNN)
				st=i.fr;
			ed=i.fr;
			//SO("Distance",ed, st, ABS(ed-st)+1);
			if(ed > MNN  and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			tp temp = starts.front();
			if(!starts.empty())
				starts.pop();
			if(temp >= st)
			{
				if(!starts.empty())
				{
					st = starts.front();
				}
				else
				{
					st=MNN;
					ed = MNN;
				}
			}
		}
		if(c < k)
		{
			st=MNN;
			ed=MNN;
		}
		//SO("end", i.fr, i.se.se, c, "-----test------", st, ed);
	}
	SO(ans);//, ST, ED);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<int,int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp n, m,k, c = 0, ans=0, ST=-1, ED=-1, st=-1, ed=-1;
tp a[AS][2];
V( pi ) v;

int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], -1));
		v.pb(mp(a[i][1], 1));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se==-1)
			c++;
		//SO(i.fr, i.se, c);
		if(c>=k)
		{
			if(st==-1)
			{
				st=i.fr;
				ed=i.fr;
			}
			else
				ed=i.fr;
			//SO("Distance",ed, st);
			if(ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se==1)
			c--;
		if(c < k)
		{
			st=-1;
			ed=-1;
		}
		//SO("end", i.fr, i.se, c);

	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c > k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<int,int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-2;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
queue<tp> starts;
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	SO(i.fr,i.se.fr,i.se.se);
	for(auto i : v)
	{
		if(i.se.fr == -1)
		{
			c++;
			//starts.insert(i.fr);
		}
		SO(i.fr, i.se.se, i.se.fr, c, "-----------", st, ed);
		if(c >= k)
		{
			if(i.se.fr == -1)
			{
				//SO("ADDING",i.fr);
				starts.push(i.fr);
			}
			if(st==MNN)
				st=i.fr;
			ed=i.fr;
			//SO("Distance",ed, st, ABS(ed-st)+1);
			if(ed > MNN  and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			starts.pop();
			if(!starts.empty())
				st = starts.front();
			else
				st=MNN;

		}
		if(c < k)
		{
			st=MNN;
			ed=MNN;
		}
		//SO("end", i.fr, i.se.se, c);
	}
	SO(ans);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long int
#define il long int
#define ill long long int
#define ld long double
#define pi pair<long long int,long long int>
#define V(x) vector<x>
#define pb(x) push_back(x)
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend());
#define mp(x, y) make_pair(x, y)
#define SIZE(x) int(x.size())
#define F(i,a,n) for(long int i=(a); i<(n); ++i)
#define FD(i,a,n) for(long int i=(a);i>=(n);--i)
#define S(x) scanf("%d",&x)
#define P(x) printf("%d\n",x)
#define BINSTR(num) bitset<64>((num)).to_string();
#define SI cin>>
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define tr(...) cout<<__FUNCTION__<<' '<<__LINE__<<" = ";trace(#__VA_ARGS__, __VA_ARGS__)
void SO(){cout << endl;}
template<typename S, typename ... Strings>
void SO(S x, const Strings&... rest){cout<<x<<' ';SO(rest...);}
template<typename T>
void trace(const char* name, T&& arg1){cout<<name<<" : "<<arg1<<endl;}
template<typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args){
const char* comma = strchr(names + 1, ',');cout.write(names, comma-names)<<" : "<<arg1<<" | ";trace(comma+1,args...);}
#define foreach(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define ALL(c) c.begin(), c.end()
#define PRESENT(container, x) container.find(x) != container.end()
#define VPRESENT(container, element) (find(ALL(container),element) != container.end())
#define fr first
#define se second
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
/*
#define cin fin
#define cout fout
ifstream fin("input.txt");
ofstream fout("output.txt");
*/
#define inf 2e9;
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000; //  (10**5)
const int v9 = 1000000000; //  (10**9)
const int v6 = 1000000; //  (10**6)
//----------------------------------------------------------------------------------------------------------------------------------------------------------------------
//USE THIS TO DEFINE TYPE EVERYWHERE
#define tp long long int

inline tp ABS(tp a) { if ( a < 0 ) return (-a); return a; }
inline tp min(tp a,tp b,tp c){return min(a,min(b,c));}
inline tp max(tp a,tp b,tp c){return max(a,max(b,c));}
//inline tp powmod(tp x,tp n, tp _mod){tp res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
//inline tp gcd(tp a,tp b){tp t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
//inline tp lcm(tp a,tp b){return (a*b)/(gcd(a,b));}
//inline int bitCount(unsigned int i) { return __builtin_popcount(i); }
inline void AI(tp x[], tp n){for(tp i=0; i<(n); ++i)SI(x[i]);}
inline void VI(vector<tp> &arr, tp n){for(tp i=0; i<(n); ++i){tp x;SI(x);arr.pb(x);};}
//CODE STARTS HERE-----------------------------------------------------------------------------------------------------------------------------------------------

const int AS = 4000001;

tp MNN = (-1*v9 )-10;
tp n, m,k, c = 0, ans=0, ST=MNN, ED=MNN, st=MNN, ed=MNN;
tp a[AS][2];
vector< pair< tp, pi > > v;
multiset<tp> starts;
int main()
{
	FASTER;
	DI(n,k);
	F(i,0,n)
	{
		DI(a[i][0], a[i][1]);
		v.pb(mp(a[i][0], mp(-1, a[i][1])));
		v.pb(mp(a[i][1], mp(1, a[i][0])));
	}
	SORT(v);
	for(auto i : v)
	{
		if(i.se.fr == -1)
			c++;
		if(c >= k)
		{
			if(i.se.fr == -1)
				starts.insert(i.fr);
			st = *starts.begin();
			ed = i.fr;
			if(i.se.fr == 1 and ABS(ed-st)+1 > ans)
			{
				ans = ABS(ed-st)+1;
				ST=st;
				ED = ed;
			}
		}
		if(i.se.fr == 1)
		{
			c--;
			try
			{
				if(*starts.begin() > i.se.se)
					starts.erase(*starts.begin());
			}
			catch(...){}
		}
		if(c < k)
			starts.clear();
	}
	SO(ans);//, ST, ED);
	if(ans == 0)
	{
		F(i,1,1+k)
			cout<<i<<" ";
		return 0;
	}
	c=0;
	F(i,0,n)
	{
		if(a[i][0]<=ST and a[i][1]>=ED)
		{
			cout<<i+1<<" ";
			c++;
		}
		if(c >= k)
			return 0;
	}

	return 0;
}


    #include<bits/stdc++.h>
    using namespace std;

    #define LOCAL 0

    #define length(a) (sizeof(a)/sizeof(a[0]))
    #define print(v,i,x) for(int j=i;j<=x;j++){cout<<v[j]<<" ";}cout<<endl;
    #define pb push_back
    #define mp make_pair
    #define lli long long int
    #define ulli unsigned long long int
    #define all(x) x.begin(),x.end()
    #define f first
    #define s second

    #define si(x) scanf("%d",&x);
    #define sli(x) scanf("%ld",&x);
    #define slli(x) scanf("%lld",&x);
    #define si2(x,y) {si(x);si(y);}
    #define si3(x,y,z) {si(x);si(y);si(z);}
    #define slli2(x,y) {slli(x);slli(y);}
    #define slli3(x,y,z) {slli(x);slli(y);slli(z);}

    #define pi(x) printf("%d",x);
    #define pi2(x,y) printf("%d %d",x,y);
    #define pi3(x,y,z) printf("%d %d %d",x,y,z);
    #define pli(x) printf("%ld",x);
    #define plli(x) printf("%lld",x);
    #define plli2(x,y) printf("%lld %lld",x,y);
    #define plli3(x,y,z) printf("%lld %lld %lld",x,y,z);
    #define pn printf("\n");
    #define ps printf(" ");
    #define pc(c) printf("%c",c);

    #define FOR(n) for(int i=0;i<n;i++)
    #define FORi(x,n) for(int i=x;i<=n;i++)
    #define FORj(x,n) for(int j=x;j<=n;j++)
    #define FORk(x,n) for(int k=x;k<=n;k++)
    #define ROFi(x,n) for(int i=x;i>=n;i--)
    #define ROFj(x,n) for(int j=x;j>=n;j--)
    #define ROFk(x,n) for(int k=x;k>=n;k--)

    #define debug(x) cout << "  - " << #x << ": " << x << endl;
    #define debugs(x, y) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
    #define debugss(x, y, z) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << "         " << #z << ": " << z <<  endl;
    #define fastIO 	std::ios::sync_with_stdio(false);cin.tie(NULL);

    typedef vector<int> vi;
    typedef vector<long> vli;
    typedef vector<long long> vlli;
    typedef vector<string> vstr;

    typedef pair<int,int> prii;
    typedef pair<int,lli> prilli;
    typedef pair<lli,int> prllii;
    typedef pair<lli,lli> prllilli;

    template <class T>T max3(T a,T b,T c){return max2(max2(a,b),c);}
    template <class T>T min3(T a,T b,T c){return min2(min2(a,b),c);}
    template <class T>T max4(T a,T b,T c,T d){return max2(max2(a,b),max2(c,d));}
    template <class T>T min4(T a,T b,T c,T d){return min2(min2(a,b),max2(c,d));}

    const lli mod = 1000000007ll;
    const lli MOD = 1000000009ll;
    const lli INF = LLONG_MAX/10;
    const int inf = INT_MAX/2;

    lli count_bit(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
    lli check_bit(lli _mask,lli _i){lli x=1;return (_mask&(x<<_i))==0?0:1;}
    lli set_bit(lli _mask,lli _i){lli x=1;_mask=_mask|(x<<_i);return _mask;}
    lli powermod(lli _a,lli _b,lli _m=mod){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
    lli power(lli _a,lli _b){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
    lli add(lli a,lli b,lli m=mod){lli x=a+b;while(x>=m)x-=m;return x;}
    lli sub(lli a,lli b,lli m=mod){lli x=a-b;while(x<0)x+=m;return x;}
    lli mul(lli a,lli b,lli m=mod){lli x=a*b;x%=m;return x;}
    lli gcd(lli a,lli b){ if(a<b) {a=a^b;b=a^b;a=a^b;} if(b==0)return a; lli t; while(b){t=b; b=a%b; a=t;}return a;}
    lli lcm(lli a,lli b){ return (a*b)/gcd(a,b); }

     vector<string> _split(const string& s, char c) {
        vector<string> v;
        stringstream ss(s);
        string x;
        while (getline(ss, x, c))
            v.emplace_back(x);
        return v;
    }

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

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

    /*
    bool prime[100010];
    void sieve(){
        fill(prime,prime+100010,true);
        prime[0]=prime[1]=false;

        for(lli i=2;i<100010;i++){
            if(prime[i]){
                for(lli j=i*i;j<100010;j+=i)
                {prime[j]=false;}
            }
        }
    }
*/
     prii operator +(const prii& l , const prii& r){
         prii ret;
         ret.f=l.f+r.f;
         ret.s=l.s+r.s;
         return ret;
     }

    struct cmp{
        bool operator()(pair<prii,int> const & l,pair<prii,int> const & r) {
            return (l.f.f!=r.f.f)?(l.f.f<r.f.f):(l.f.s<r.f.s);
        }
    }myobject;

    int n,k,l,r,x,y;
    vector<pair<prii,int>> v;
    lli ans=0;
    set<pair<prii,int>> id;

    int main(){
        if(LOCAL){
            freopen("C:\\Users\\Smit Patel\\Desktop\\Questions\\This week\\input6.txt","r",stdin);
            freopen("C:\\Users\\Smit Patel\\Desktop\\Questions\\This week\\output6.txt","w",stdout);
        }

        v.pb(mp(mp(INT_MIN,INT_MIN),0));

        si2(n,k);
        FORi(1,n){
            si2(x,y);
            v.pb(mp(mp(x,y),i));
        }

        sort(all(v),myobject);

        set<pair<prii,int>> en,st;

        FORi(1,n){
            if(en.size()==k){
                lli a=(en.begin())->f.f;
                lli b=(st.rbegin())->f.f;
           //     debugs(b,a);
                if(a-b+1>ans){
                    ans=a-b+1;
                    id=st;
                }
            }

            int l=v[i].f.f,r=v[i].f.s,idx=v[i].s;
            while(st.size()>0 && en.begin()->f.f<l){
                auto p=*en.begin();
         //       debugs(i,p.s);
                en.erase(en.begin());
                st.erase(mp(mp(p.f.s,p.f.f),p.s));
            }

            st.insert(mp(mp(l,r),idx));
            en.insert(mp(mp(r,l),idx));

            if(en.size()==k){
                lli a=(en.begin())->f.f;
                lli b=(st.rbegin())->f.f;
                if(a-b+1>ans){
                    ans=a-b+1;
                    id=st;
                }
            }
        }

        if(ans==0){
            pi(ans);pn;
            FORi(1,k){pi(i);ps;}
        }
        else{
            pi(ans);pn;
            for(auto p:id){pi(p.s);ps;}
        }

        return 0;
    }


    #include<bits/stdc++.h>
    using namespace std;

    static int LOCAL=0;

    #define F0(a) memset(a,0,sizeof(a));
    #define print(v,i,x) for(int j=i;j<=x;j++){cout<<v[j]<<" ";}cout<<endl;
    #define pb push_back
    #define mp make_pair
    #define lli long long int
    #define ulli unsigned long long int
    #define all(x) x.begin(),x.end()
    #define sz(x) ((int)x.size())
    #define f first
    #define s second

    #define si(x) scanf("%d",&x)
    #define slli(x) scanf("%lld",&x)
    #define si2(x,y) scanf("%d %d",&x,&y)
    #define si3(x,y,z) scanf("%d %d %d",&x,&y,&z)
    #define slli2(x,y) scanf("%lld %lld",&x,&y)
    #define slli3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)

    #define pi(x) printf("%d",x)
    #define pi2(x,y) printf("%d %d",x,y)
    #define pi3(x,y,z) printf("%d %d %d",x,y,z)
    #define plli(x) printf("%lld",x)
    #define plli2(x,y) printf("%lld %lld",x,y)
    #define plli3(x,y,z) printf("%lld %lld %lld",x,y,z)
    #define pn printf("\n")
    #define ps printf(" ")
    #define pc(c) printf("%c",c)

    #define FOR(i,x,n) for(int i=x;i<=n;i++)
    #define ROF(i,x,n) for(int i=x;i>=n;i--)
    #define fr(i,x,n) for(int i=x;i<n;i++)

    #define debug(x) cout << "  - " << #x << ": " << x << endl;
    #define debugs(x, y) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
    #define debugss(x, y, z) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << "         " << #z << ": " << z <<  endl;
    #define fastIO  std::ios::sync_with_stdio(false);cin.tie(NULL);
    #define cut cout<<"------------------------------------------\n";
    #define cut1 cout<<"******************************************\n";

    typedef vector<int> vi;
    typedef vector<lli> vlli;
    typedef vector<pair<int,int>> vii;

    typedef pair<int,int> prii;
    typedef pair<int,lli> prilli;
    typedef pair<lli,int> prllii;
    typedef pair<lli,lli> prllilli;

    const lli mod = 1000000007ll;
    const lli MOD = 1000000009ll;
    const lli INF = LLONG_MAX/10;
    const int inf = INT_MAX/10;

    lli powermod(lli _a,lli _b,lli _m=mod){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
    lli power(lli _a,lli _b){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
    lli add(lli a,lli b,lli m=mod){lli x=a+b;while(x>=m)x-=m;return x;}
    lli sub(lli a,lli b,lli m=mod){lli x=a-b;while(x<0)x+=m;return x;}
    lli mul(lli a,lli b,lli m=mod){return ((a%m)*(b%m))%m;}
    lli gcd(lli a,lli b){while(a&&b)a>b?a%=b:b%=a;return a+b;}
    lli lcm(lli a,lli b){return (max(a,b)/gcd(a,b))*min(a,b);}

    struct pair_hash {
        std::size_t operator () (const std::pair<int,int> &p) const {
            auto h1 = std::hash<lli>{}(p.first);
            auto h2 = std::hash<lli>{}(p.second);
            return add(h1,mul(h2,h1,MOD));
        }
    };

    struct cmp{
        bool operator()(prii const & l,prii const & r){
            return l.f<r.f;
        }
    }myobject;

    int n,k;
    multiset<pair<prllilli,int>> s,rs;
    vector<pair<prllilli,int>> v;

    int main(){

       si2(n,k);

       lli ans=0,x,y;

       FOR(i,1,n){
            slli2(x,y);
            v.pb({{x,y},i});
       }

       sort(all(v));

       FOR(j,0,n-1){
            x=v[j].f.f;
            y=v[j].f.s;
            int i=v[j].s;
            while(sz(s)>=k){
                auto p=*rs.begin();
                rs.erase(rs.begin());
                s.erase(s.find({{p.f.s,p.f.f},p.s}));
            }
            s.insert({{x,y},i});
            rs.insert({{y,x},i});
            if(sz(s)==k){ans=max(ans,rs.begin()->f.f-s.rbegin()->f.f+1);}
       }

       if(ans==0){
            cout<<ans<<endl;
            FOR(i,1,k)pi(i),ps;
            return 0;
       }

       s.clear();
       rs.clear();
       FOR(j,0,n-1){
            x=v[j].f.f;
            y=v[j].f.s;
            int i=v[j].s;
            while(sz(s)>=k){
                auto p=*rs.begin();
                rs.erase(rs.begin());
                s.erase(s.find({{p.f.s,p.f.f},p.s}));
            }
            s.insert({{x,y},i});
            rs.insert({{y,x},i});
            if(sz(s)==k && rs.begin()->f.f-s.rbegin()->f.f+1 == ans){
                plli(ans);pn;
                for(auto p:s)pi(p.s),ps;
                return 0;
            }
       }

       cout<<ans;

        return 0;
    }


    #include<bits/stdc++.h>
	#include<bits/stdc++.h>
	#include<bits/stdc++.h>
	using namespace std;

	#define length(a) (sizeof(a)/sizeof(a[0]))
	#define print(v,i,x) for(int j=i;j<=x;j++){cout<<v[j]<<" ";}cout<<endl;
	#define pb push_back
	#define mp make_pair
	#define lli long long int
	#define ulli unsigned long long int
	#define all(x) x.begin(),x.end()
	#define f first
	#define s second

	#define si(x) scanf("%d",&x);
	#define sli(x) scanf("%ld",&x);
	#define slli(x) scanf("%lld",&x);
	#define slu(x) scanf("%lu",&x);
	#define sllu(x) scanf("%llu",&x);
	#define si2(x,y) si(x);si(y);
	#define si3(x,y,z) si(x);si(y);si(z);
	#define slli2(x,y) slli(x);slli(y);
	#define slli3(x,y,z) slli(x);slli(y);slli(z);

	#define pi(x) printf("%d",x);
	#define pli(x) printf("%ld",x);
	#define plli(x) printf("%lld",x);
	#define plu(x) printf("%lu",x);
	#define pllu(x) printf("llu",x);
	#define pn printf("\n");
	#define ps printf(" ");
	#define pc(c) printf("%c",c);

	#define FOR(n) for(int i=0;i<n;i++)
	#define FORi(x,n) for(int i=x;i<=n;i++)
	#define FORj(x,n) for(int j=x;j<=n;j++)
	#define FORk(x,n) for(int k=x;k<=n;k++)
	#define ROFi(x,n) for(int i=x;i>=n;i--)
	#define ROFj(x,n) for(int j=x;j>=n;j--)
	#define ROFk(x,n) for(int k=x;k>=n;k--)

	#define debug(x) cout << "  - " << #x << ": " << x << endl;
	#define debugs(x, y) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
	#define fastIO 	std::ios::sync_with_stdio(false);cin.tie(NULL);

	typedef vector<int> vi;
	typedef vector<long> vli;
	typedef vector<long long> vlli;
	typedef vector<string> vstr;

	typedef pair<int,int> prii;
	typedef pair<long,int> prlii;
	typedef pair<int,long> prili;
	typedef pair<int,lli> prilli;
	typedef pair<lli,int> prllii;
	typedef pair<long,lli> prlilli;
	typedef pair<lli,long> prllili;
	typedef pair<lli,lli> prllilli;
	typedef pair<long,long> prlili;

	template <class T>T max2(T a,T b){return a<b?b:a;}
	template <class T>T min2(T a,T b){return a<b?a:b;}
	template <class T>T max3(T a,T b,T c){return max2(max2(a,b),c);}
	template <class T>T min3(T a,T b,T c){return min2(min2(a,b),c);}
	template <class T>T max4(T a,T b,T c,T d){return max2(max2(a,b),max2(c,d));}
	template <class T>T min4(T a,T b,T c,T d){return min2(min2(a,b),max2(c,d));}

	const lli mod = 1000000007ll;
	const lli MOD = 1000000009ll;

	lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
	lli bit(lli _mask,lli _i){lli x=1;return (_mask&(x<<_i))==0?0:1;}
	lli powermod(lli _a,lli _b,lli _m=mod){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
	lli power(lli _a,lli _b){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
	lli add(lli a,lli b,lli m=mod){lli x=a+b;while(x>=m)x-=m;return x;}
	lli sub(lli a,lli b,lli m=mod){lli x=a-b;while(x<0)x+=m;return x;}
	lli mul(lli a,lli b,lli m=mod){lli x=a*b;x%=m;return x;}
	lli gcd(lli a,lli b){ if(a<b) {a=a^b;b=a^b;a=a^b;} if(b==0)return a; lli t; while(b){t=b; b=a%b; a=t;}return a;}
	lli lcm(lli a,lli b){ return (a*b)/gcd(a,b); }

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

	/*
	vector<string> _split(const string& s, char c) {
		vector<string> v;
		stringstream ss(s);
		string x;
		while (getline(ss, x, c))
			v.emplace_back(x);
		return v;
	}
	*/
	 prii operator +(const prii& l , const prii& r){
		 prii ret;
		 ret.f=l.f+r.f;
		 ret.s=l.s+r.s;
		 return ret;
	 }

	struct cmp{
		bool operator()(pair<prllilli,int>  const & l,pair<prllilli,int>  const & r) {
			if(l.f.s!=r.f.s)
			return l.f.s<r.f.s;
			else
			return l.f.f<r.f.f;
		}
	}myobject;

	struct cmp1{
		bool operator()(pair<prllilli,int>  const & l,pair<prllilli,int>  const & r) {
			if(l.f.f!=r.f.f)
			return l.f.f<r.f.f;
			else
			return l.f.s>r.f.s;
		}
	}myobject1;

	int n,k;
	vector<pair<prllilli,int>> c,v;
    lli x,y,ans=0;
    vi f;
    set<pair<prllilli,int>,cmp> s;
    multiset<lli> st;

    void check(){
        s.clear();
        st.clear();

        FOR(v.size()){

 //          cout<<"-----------------------\n";
 //           debugs(i,s.size());
   //         for(auto p:s)
   //         cout<<p.f.f<<" "<<p.f.s<<"  "<<p.s<<endl;

            if(s.size()==k){
                lli l=*(--st.end());
                lli r=s.begin()->f.s;
      //           debugs(l,r);
                if(r-l+1>=ans){
      //             debug(m);
                    f.clear();
                    int cnt=0;
                    for(auto p:s)
                    {f.pb(p.s);}
                    ans=max(ans,r-l+1);

                }

                lli x=s.begin()->f.f;
                st.erase(st.find(x));
                s.erase(s.begin());

            }

            while(s.size()>0 && s.begin()->f.s < v[i].f.f){
                lli x=s.begin()->f.f;
                st.erase(st.find(x));
                s.erase(s.begin());
            }

            s.insert(mp(mp(v[i].f.f,v[i].f.s),v[i].s));
            st.insert(v[i].f.f);

        }

    }

	int main(){

        si(n);si(k);
        lli mn=LLONG_MIN,mx=LLONG_MAX;
        FOR(n){
            slli(x);slli(y);
            mn=min(mn,x);
            mx=max(mx,y);
            c.pb(mp(mp(x,y),i+1));
        }

        c.pb(mp(mp(LLONG_MAX/2,LLONG_MAX/2),n+1));
        v=c;

        sort(all(v),myobject1);

        lli l=1,r=200000010;
       /*
        while(r>=l){
            lli mid=l+(r-l)/2;

            if(check(mid)){
                ans=mid;
                l=mid+1;

            }
            else
            {r=mid-1;}

        }*/
        check();
        plli(ans);pn;
    //    debug(f.size());
        if(f.size()>0){
            sort(all(f));
            for(auto p:f)
            {pi(p);ps;}
        }
        else{
            FORi(1,k)
            {pi(i);ps;}
        }

		return 0;

	}


    #include<bits/stdc++.h>
    using namespace std;

    #define LOCAL 0

    #define length(a) (sizeof(a)/sizeof(a[0]))
    #define print(v,i,x) for(int j=i;j<=x;j++){cout<<v[j]<<" ";}cout<<endl;
    #define pb push_back
    #define mp make_pair
    #define lli long long int
    #define ulli unsigned long long int
    #define all(x) x.begin(),x.end()
    #define f first
    #define s second

    #define si(x) scanf("%d",&x);
    #define sli(x) scanf("%ld",&x);
    #define slli(x) scanf("%lld",&x);
    #define si2(x,y) {si(x);si(y);}
    #define si3(x,y,z) {si(x);si(y);si(z);}
    #define slli2(x,y) {slli(x);slli(y);}
    #define slli3(x,y,z) {slli(x);slli(y);slli(z);}

    #define pi(x) printf("%d",x);
    #define pi2(x,y) printf("%d %d",x,y);
    #define pi3(x,y,z) printf("%d %d %d",x,y,z);
    #define pli(x) printf("%ld",x);
    #define plli(x) printf("%lld",x);
    #define plli2(x,y) printf("%lld %lld",x,y);
    #define plli3(x,y,z) printf("%lld %lld %lld",x,y,z);
    #define pn printf("\n");
    #define ps printf(" ");
    #define pc(c) printf("%c",c);

    #define FOR(n) for(int i=0;i<n;i++)
    #define FORi(x,n) for(int i=x;i<=n;i++)
    #define FORj(x,n) for(int j=x;j<=n;j++)
    #define FORk(x,n) for(int k=x;k<=n;k++)
    #define ROFi(x,n) for(int i=x;i>=n;i--)
    #define ROFj(x,n) for(int j=x;j>=n;j--)
    #define ROFk(x,n) for(int k=x;k>=n;k--)

    #define debug(x) cout << "  - " << #x << ": " << x << endl;
    #define debugs(x, y) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
    #define debugss(x, y, z) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << "         " << #z << ": " << z <<  endl;
    #define fastIO 	std::ios::sync_with_stdio(false);cin.tie(NULL);

    typedef vector<int> vi;
    typedef vector<long> vli;
    typedef vector<long long> vlli;
    typedef vector<string> vstr;

    typedef pair<int,int> prii;
    typedef pair<int,lli> prilli;
    typedef pair<lli,int> prllii;
    typedef pair<lli,lli> prllilli;

    template <class T>T max3(T a,T b,T c){return max2(max2(a,b),c);}
    template <class T>T min3(T a,T b,T c){return min2(min2(a,b),c);}
    template <class T>T max4(T a,T b,T c,T d){return max2(max2(a,b),max2(c,d));}
    template <class T>T min4(T a,T b,T c,T d){return min2(min2(a,b),max2(c,d));}

    const lli mod = 1000000007ll;
    const lli MOD = 1000000009ll;
    const lli INF = LLONG_MAX/10;
    const int inf = INT_MAX/2;

    lli count_bit(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
    lli check_bit(lli _mask,lli _i){lli x=1;return (_mask&(x<<_i))==0?0:1;}
    lli set_bit(lli _mask,lli _i){lli x=1;_mask=_mask|(x<<_i);return _mask;}
    lli powermod(lli _a,lli _b,lli _m=mod){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
    lli power(lli _a,lli _b){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
    lli add(lli a,lli b,lli m=mod){lli x=a+b;while(x>=m)x-=m;return x;}
    lli sub(lli a,lli b,lli m=mod){lli x=a-b;while(x<0)x+=m;return x;}
    lli mul(lli a,lli b,lli m=mod){lli x=a*b;x%=m;return x;}
    lli gcd(lli a,lli b){ if(a<b) {a=a^b;b=a^b;a=a^b;} if(b==0)return a; lli t; while(b){t=b; b=a%b; a=t;}return a;}
    lli lcm(lli a,lli b){ return (a*b)/gcd(a,b); }

     vector<string> _split(const string& s, char c) {
        vector<string> v;
        stringstream ss(s);
        string x;
        while (getline(ss, x, c))
            v.emplace_back(x);
        return v;
    }

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

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

    /*
    bool prime[100010];
    void sieve(){
        fill(prime,prime+100010,true);
        prime[0]=prime[1]=false;

        for(lli i=2;i<100010;i++){
            if(prime[i]){
                for(lli j=i*i;j<100010;j+=i)
                {prime[j]=false;}
            }
        }
    }
*/
     prii operator +(const prii& l , const prii& r){
         prii ret;
         ret.f=l.f+r.f;
         ret.s=l.s+r.s;
         return ret;
     }

    struct cmp{
        bool operator()(pair<prii,int> const & l,pair<prii,int> const & r) {
            return (l.f.f!=r.f.f)?(l.f.f<r.f.f):(l.f.s<r.f.s);
        }
    }myobject;

    int n,k,l,r,x,y;
    vector<pair<prii,int>> v;
    lli ans=0;
    set<int> id,tmp;

    int main(){
        if(LOCAL){
            freopen("C:\\Users\\Smit Patel\\Desktop\\Questions\\This week\\input6.txt","r",stdin);
            freopen("C:\\Users\\Smit Patel\\Desktop\\Questions\\This week\\output6.txt","w",stdout);
        }

        v.pb(mp(mp(INT_MIN,INT_MIN),0));

        si2(n,k);
        FORi(1,n){
            si2(x,y);
            v.pb(mp(mp(x,y),i));
        }

        sort(all(v),myobject);

        set<pair<prii,int>> en,st;

        FORi(1,k){
            int l=v[i].f.f,r=v[i].f.s,idx=v[i].s;
            st.insert(mp(mp(l,r),idx));
            en.insert(mp(mp(r,l),idx));
            id.insert(idx);
        }

        if(en.size()==k){
                lli a=(en.begin())->f.f;
                lli b=(st.rbegin())->f.f;
                if(a-b+1>ans){
                    ans=a-b+1;
                    tmp=id;
                }
            }

        FORi(k+1,n){
            int l=v[i].f.f,r=v[i].f.s,idx=v[i].s;
            if(st.size()>0 && en.begin()->f.f<r){
                auto p=*en.begin();
                en.erase(en.begin());
                id.erase(p.s);
                st.erase(mp(mp(p.f.s,p.f.f),p.s));
                st.insert(mp(mp(l,r),idx));
                en.insert(mp(mp(r,l),idx));
                id.insert(idx);
            }

            if(en.size()==k){
                lli a=(en.begin())->f.f;
                lli b=(st.rbegin())->f.f;
                if(a-b+1>ans){
                    ans=a-b+1;
                    tmp=id;
                }
            }
        }

        if(ans==0){
            pi(ans);pn;
            FORi(1,k){pi(i);ps;}
        }
        else{
            pi(ans);pn;
            for(auto p:tmp){pi(p);ps;}
        }

        return 0;
    }


   #include<bits/stdc++.h>
	#include<bits/stdc++.h>
	#include<bits/stdc++.h>
	using namespace std;

	#define length(a) (sizeof(a)/sizeof(a[0]))
	#define print(v,i,x) for(int j=i;j<=x;j++){cout<<v[j]<<" ";}cout<<endl;
	#define pb push_back
	#define mp make_pair
	#define lli long long int
	#define ulli unsigned long long int
	#define all(x) x.begin(),x.end()
	#define f first
	#define s second

	#define si(x) scanf("%d",&x);
	#define sli(x) scanf("%ld",&x);
	#define slli(x) scanf("%lld",&x);
	#define slu(x) scanf("%lu",&x);
	#define sllu(x) scanf("%llu",&x);
	#define si2(x,y) si(x);si(y);
	#define si3(x,y,z) si(x);si(y);si(z);
	#define slli2(x,y) slli(x);slli(y);
	#define slli3(x,y,z) slli(x);slli(y);slli(z);

	#define pi(x) printf("%d",x);
	#define pli(x) printf("%ld",x);
	#define plli(x) printf("%lld",x);
	#define plu(x) printf("%lu",x);
	#define pllu(x) printf("llu",x);
	#define pn printf("\n");
	#define ps printf(" ");
	#define pc(c) printf("%c",c);

	#define FOR(n) for(int i=0;i<n;i++)
	#define FORi(x,n) for(int i=x;i<=n;i++)
	#define FORj(x,n) for(int j=x;j<=n;j++)
	#define FORk(x,n) for(int k=x;k<=n;k++)
	#define ROFi(x,n) for(int i=x;i>=n;i--)
	#define ROFj(x,n) for(int j=x;j>=n;j--)
	#define ROFk(x,n) for(int k=x;k>=n;k--)

	#define debug(x) cout << "  - " << #x << ": " << x << endl;
	#define debugs(x, y) cout << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
	#define fastIO 	std::ios::sync_with_stdio(false);cin.tie(NULL);

	typedef vector<int> vi;
	typedef vector<long> vli;
	typedef vector<long long> vlli;
	typedef vector<string> vstr;

	typedef pair<int,int> prii;
	typedef pair<long,int> prlii;
	typedef pair<int,long> prili;
	typedef pair<int,lli> prilli;
	typedef pair<lli,int> prllii;
	typedef pair<long,lli> prlilli;
	typedef pair<lli,long> prllili;
	typedef pair<lli,lli> prllilli;
	typedef pair<long,long> prlili;

	template <class T>T max2(T a,T b){return a<b?b:a;}
	template <class T>T min2(T a,T b){return a<b?a:b;}
	template <class T>T max3(T a,T b,T c){return max2(max2(a,b),c);}
	template <class T>T min3(T a,T b,T c){return min2(min2(a,b),c);}
	template <class T>T max4(T a,T b,T c,T d){return max2(max2(a,b),max2(c,d));}
	template <class T>T min4(T a,T b,T c,T d){return min2(min2(a,b),max2(c,d));}

	const lli mod = 1000000007ll;
	const lli MOD = 1000000009ll;

	lli bit_count(lli _x){lli _ret=0;while(_x){if(_x%2==1)_ret++;_x/=2;}return _ret;}
	lli bit(lli _mask,lli _i){lli x=1;return (_mask&(x<<_i))==0?0:1;}
	lli powermod(lli _a,lli _b,lli _m=mod){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
	lli power(lli _a,lli _b){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a);_b/=2;_a=(_a*_a);}return _r;}
	lli add(lli a,lli b,lli m=mod){lli x=a+b;while(x>=m)x-=m;return x;}
	lli sub(lli a,lli b,lli m=mod){lli x=a-b;while(x<0)x+=m;return x;}
	lli mul(lli a,lli b,lli m=mod){lli x=a*b;x%=m;return x;}
	lli gcd(lli a,lli b){ if(a<b) {a=a^b;b=a^b;a=a^b;} if(b==0)return a; lli t; while(b){t=b; b=a%b; a=t;}return a;}
	lli lcm(lli a,lli b){ return (a*b)/gcd(a,b); }

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

	/*
	vector<string> _split(const string& s, char c) {
		vector<string> v;
		stringstream ss(s);
		string x;
		while (getline(ss, x, c))
			v.emplace_back(x);
		return v;
	}
	*/
	 prii operator +(const prii& l , const prii& r){
		 prii ret;
		 ret.f=l.f+r.f;
		 ret.s=l.s+r.s;
		 return ret;
	 }

	struct cmp{
		bool operator()(pair<prllilli,int>  const & l,pair<prllilli,int>  const & r) {
			if(l.f.s!=r.f.s)
			return l.f.s<r.f.s;
			else
			return l.f.f<r.f.f;
		}
	}myobject;

	int n,k;
	vector<pair<prllilli,int>> c,v;
    lli x,y,ans=0;
    vi f;
    multiset<pair<prllilli,int>,cmp> s;
    multiset<lli> st;

    void check(){
        s.clear();
        st.clear();

        FOR(v.size()){

            if(s.size()==k){
                lli l=*(--st.end());
                lli r=s.begin()->f.s;
                if(r-l+1>=ans){
                    f.clear();
                    int cnt=0;
                    for(auto p:s)
                    {f.pb(p.s);}
                    ans=max(ans,r-l+1);
                }

             /*   lli x=s.begin()->f.f;
                st.erase(st.find(x));
                s.erase(s.begin());
                */
            }

            while(s.size()>0 && s.begin()->f.s < v[i].f.s){
                lli x=s.begin()->f.f;
                st.erase(st.find(x));
                s.erase(s.begin());
            }

            if(s.size()<k){
                s.insert(v[i]);
            st.insert(v[i].f.f);

            }

        }

    }

	int main(){

        si(n);si(k);
        lli mn=LLONG_MIN,mx=LLONG_MAX;
        FOR(n){
            slli(x);slli(y);
            mn=min(mn,x);
            mx=max(mx,y);
            c.pb(mp(mp(x,y),i+1));
        }

        c.pb(mp(mp(LLONG_MAX/2,LLONG_MAX/2),n+1));
        v=c;

        sort(all(v));

        lli l=1,r=200000010;

        check();
        plli(ans);pn;

        if(f.size()>0){
            sort(all(f));
            for(auto p:f)
            {pi(p);ps;}
        }
        else{
            FORi(1,k)
            {pi(i);ps;}
        }

		return 0;

	}