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

ll int l[1000007],r[1000007];

ll int jstGreater(ll int a[],ll int n,ll int x)
{
	ll int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	ll int first,second,idx;
	node(){}
	node(ll int a,ll int b,ll int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

/*
ll int getSum(unordered_map<ll int,ll int> &BITree, ll int index)
{
    ll int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<ll int,ll int> &BITree, ll int n, ll int index, ll int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax,j,cnt = 0;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		if(v1-v2 >= k){
            set<ll int> st;
            set<ll int>:: iterator it;
            for(j = 1 ; j <= 2*n ;j++){
            	if(arr[j].second == 0 && arr[j].first <= zmin){
            		st.insert(arr[j].idx);
            	}
            	else if(arr[j].second == 1 && arr[j].first < zmax){
            		st.erase(arr[j].idx);
            	}
            }
            for(it = st.begin() ; it != st.end() ;it++){
            	cout<<(*it)<<" ";
            	cnt++;
            	if(cnt == k)
            	break;
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}
int main(){
	ll int n,k,i,beg,last,mid,INF = 1000000001LL;
    cin>>n>>k;
	for(i = 1 ; i <= n ;i++){
		cin>>l[i]>>r[i];
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/
	sort(l+1,l+n+1);
	sort(r+1,r+n+1);
	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000020LL;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}
	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";
	cout<<beg<<"\n";
	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        cout<<i<<" ";
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define INF 1000000001
using namespace std;

int l[1000007],r[1000007],lt[100007],rt[100007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax,top=0;
	/*
	cout<<"\ncheck for "<<win<<" "<<n<<"\n";
    for(i = 1 ; i <= n;i++)
	cout<<l[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i <= n;i++)
	cout<<r[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);
		//cout<<v1<<" "<<v2<<"\n";
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0,top;
	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];
            sl[top] = node2(l[i],i);
            sr[top] = node2(r[i],i);

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	sort(sl+1,sl+top+1,compare2);
	sort(sr+1,sr+top+1,compare2);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);

		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                    cnt++;
                    if(cnt == k)
                    break;
                }
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/

	//cout<<check(32,n,k)<<"\n";

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}

	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";

	printf("%d\n",beg);

	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define INF 1000000001
using namespace std;

int l[1000007],r[1000007],lt[1000007],rt[1000007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax,top=0;
	/*
	cout<<"\ncheck for "<<win<<" "<<n<<"\n";
    for(i = 1 ; i <= n;i++)
	cout<<l[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i <= n;i++)
	cout<<r[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);
		//cout<<v1<<" "<<v2<<"\n";
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0,top=0;
	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];
            sl[top] = node2(l[i],i);
            sr[top] = node2(r[i],i);

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	sort(sl+1,sl+top+1,compare2);
	sort(sr+1,sr+top+1,compare2);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);

		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                    cnt++;
                    if(cnt == k)
                    break;
                }
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/

	//cout<<check(32,n,k)<<"\n";

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}

	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";

	printf("%d\n",beg);

	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define INF 1000000001
using namespace std;

int l[300007],r[300007],lt[300007],rt[300007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[600007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[300007],sr[300007];

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax,top=0;
	/*
	cout<<"\ncheck for "<<win<<" "<<n<<"\n";
    for(i = 1 ; i <= n;i++)
	cout<<l[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i <= n;i++)
	cout<<r[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);
		//cout<<v1<<" "<<v2<<"\n";
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0,top=0;
	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];
            sl[top] = node2(l[i],i);
            sr[top] = node2(r[i],i);

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	sort(sl+1,sl+top+1,compare2);
	sort(sr+1,sr+top+1,compare2);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);

		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                    cnt++;
                    if(cnt == k)
                    break;
                }
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/

	//cout<<check(32,n,k)<<"\n";

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}

	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";

	printf("%d\n",beg);

	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#include<unordered_map>
#define ll long long
using namespace std;

unordered_map<ll int,ll int> BITStart,BITEnd;

ll int l[1000007],r[1000007];
struct node{
	ll int first,second,idx;
	node(){}
	node(ll int a,ll int b,ll int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

ll int getSum(unordered_map<ll int,ll int> &BITree, ll int index)
{
    ll int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<ll int,ll int> &BITree, ll int n, ll int index, ll int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}

bool check(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = getSum(BITStart,zmin);
		v2 = getSum(BITEnd,zmax-1);
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax,j,cnt = 0;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = getSum(BITStart,zmin);
		v2 = getSum(BITEnd,zmax-1);
		if(v1-v2 >= k){
            set<ll int> st;
            set<ll int>:: iterator it;
            for(j = 1 ; j <= 2*n ;j++){
            	if(arr[j].second == 0 && arr[j].first <= zmin){
            		st.insert(arr[j].idx);
            	}
            	else if(arr[j].second == 1 && arr[j].first < zmax){
            		st.erase(arr[j].idx);
            	}
            }
            for(it = st.begin() ; it != st.end() ;it++){
            	cout<<(*it)<<" ";
            	cnt++;
            	if(cnt == k)
            	break;
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}
int main(){
	ll int n,k,i,beg,last,mid,INF = 1000000001LL;
    cin>>n>>k;
	for(i = 1 ; i <= n ;i++){
		cin>>l[i]>>r[i];
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000020LL;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}
	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";
	cout<<beg<<"\n";
	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        cout<<i<<" ";
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


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

int l[1000007],r[1000007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		/*
		if(v1-v2 >= k){
            set<int> st;
            set<int>:: iterator it;
            for(j = 1 ; j <= 2*n ;j++){
            	if(arr[j].second == 0 && arr[j].first <= zmin){
            		st.insert(arr[j].idx);
            	}
            	else if(arr[j].second == 1 && arr[j].first < zmax){
            		st.erase(arr[j].idx);
            	}
            }
            for(it = st.begin() ; it != st.end() ;it++){
            	cout<<(*it)<<" ";
            	cnt++;
            	if(cnt == k)
            	break;
            }
            printf("\n");
            return ;
		}
		*/
		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    cout<<sl[j].idx<<" ";
                }
            }
            cout<<"\n";
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid,INF = 1000000001;
    cin>>n>>k;
	for(i = 1 ; i <= n ;i++){
		cin>>l[i]>>r[i];
		l[i]+=INF;
		r[i]+=INF;
		sl[i].val = l[i];sl[i].idx = i;
		sr[i].val = r[i];sr[i].idx = i;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/
	sort(l+1,l+n+1);
	sort(r+1,r+n+1);
	sort(sl+1,sl+n+1,compare2);
	sort(sr+1,sr+n+1,compare2);

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}
	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";
	cout<<beg<<"\n";
	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        cout<<i<<" ";
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


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

ll int l[1000007],r[1000007];

static ll int mark[1000007];
ll int jstGreater(ll int a[],ll int n,ll int x)
{
	ll int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	ll int first,second,idx;
	node(){}
	node(ll int a,ll int b,ll int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    ll int val,idx;
    node2(){}
    node2(ll int a,ll int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

/*
ll int getSum(unordered_map<ll int,ll int> &BITree, ll int index)
{
    ll int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<ll int,ll int> &BITree, ll int n, ll int index, ll int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax,j,cnt = 0;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		/*
		if(v1-v2 >= k){
            set<ll int> st;
            set<ll int>:: iterator it;
            for(j = 1 ; j <= 2*n ;j++){
            	if(arr[j].second == 0 && arr[j].first <= zmin){
            		st.insert(arr[j].idx);
            	}
            	else if(arr[j].second == 1 && arr[j].first < zmax){
            		st.erase(arr[j].idx);
            	}
            }
            for(it = st.begin() ; it != st.end() ;it++){
            	cout<<(*it)<<" ";
            	cnt++;
            	if(cnt == k)
            	break;
            }
            printf("\n");
            return ;
		}
		*/
		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    cout<<sl[j].idx<<" ";
                }
            }
            cout<<"\n";
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
int main(){
	ll int n,k,i,beg,last,mid,INF = 1000000001LL;
    cin>>n>>k;
	for(i = 1 ; i <= n ;i++){
		cin>>l[i]>>r[i];
		l[i]+=INF;
		r[i]+=INF;
		sl[i].val = l[i];sl[i].idx = i;
		sr[i].val = r[i];sr[i].idx = i;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/
	sort(l+1,l+n+1);
	sort(r+1,r+n+1);
	sort(sl+1,sl+n+1,compare2);
	sort(sr+1,sr+n+1,compare2);

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000020LL;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}
	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";
	cout<<beg<<"\n";
	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        cout<<i<<" ";
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define INF 1000000001
using namespace std;

int l[1000007],r[1000007],lt[100007],rt[100007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax,top=0;
	/*
	cout<<"\ncheck for "<<win<<" "<<n<<"\n";
    for(i = 1 ; i <= n;i++)
	cout<<l[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i <= n;i++)
	cout<<r[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);
		//cout<<v1<<" "<<v2<<"\n";
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0,top;
	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];
            sl[top] = node2(l[i],i);
            sr[top] = node2(r[i],i);

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);

		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                    cnt++;
                    if(cnt == k)
                    break;
                }
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/

	//cout<<check(32,n,k)<<"\n";

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}

	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";

	printf("%d\n",beg);

	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define INF 1000000001
using namespace std;

int l[1000007],r[1000007],lt[1000007],rt[1000007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax,top=0;
	/*
	cout<<"\ncheck for "<<win<<" "<<n<<"\n";
    for(i = 1 ; i <= n;i++)
	cout<<l[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i <= n;i++)
	cout<<r[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);
		//cout<<v1<<" "<<v2<<"\n";
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0,top;
	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];
            sl[top] = node2(l[i],i);
            sr[top] = node2(r[i],i);

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	sort(sl+1,sl+top+1,compare2);
	sort(sr+1,sr+top+1,compare2);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);

		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                    cnt++;
                    if(cnt == k)
                    break;
                }
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/

	//cout<<check(32,n,k)<<"\n";

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}

	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";

	printf("%d\n",beg);

	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define INF 1000000001
using namespace std;

int l[300007],r[300007],lt[300007],rt[300007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[600007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[300007],sr[300007];

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax,top=0;
	/*
	cout<<"\ncheck for "<<win<<" "<<n<<"\n";
    for(i = 1 ; i <= n;i++)
	cout<<l[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i <= n;i++)
	cout<<r[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);
		//cout<<v1<<" "<<v2<<"\n";
		if(v1-v2 >= k)
			return 1;
        }
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0,top=0;
	for(i = 1 ; i <= n ;i++){
        if(r[i] - l[i] +1 >= win){
            top++;
            lt[top] = l[i];
            rt[top] = r[i];
            sl[top] = node2(l[i],i);
            sr[top] = node2(r[i],i);

        }
	}
	sort(lt+1,lt+top+1);
	sort(rt+1,rt+top+1);
	sort(sl+1,sl+top+1,compare2);
	sort(sr+1,sr+top+1,compare2);
	/*
	for(i = 1 ; i < top;i++)
	cout<<lt[i]-INF<<" ";
	cout<<"\n";
	for(i = 1 ; i < top;i++)
	cout<<rt[i]-INF<<" ";
	cout<<"\n";
	*/

	for(i = 1 ; i <= 2*n ;i++){
        if(r[arr[i].idx] - l[arr[i].idx] + 1 < win)
        continue;
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;

		v1 = jstGreater(lt+1,top,zmin);
		v2 = jstGreater(rt+1,top,zmax-1);

		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                    cnt++;
                    if(cnt == k)
                    break;
                }
            }
            printf("\n");
            return ;
		}
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/

	//cout<<check(32,n,k)<<"\n";

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}

	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";

	printf("%d\n",beg);

	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


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

map<ll int,ll int> BITStart,BITEnd;

ll int l[1000007],r[1000007];
struct node{
	ll int first,second,idx;
	node(){}
	node(ll int a,ll int b,ll int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];
ll int getSum(map<ll int,ll int> &BITree, ll int index)
{
    ll int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(map<ll int,ll int> &BITree, ll int n, ll int index, ll int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}

bool check(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = getSum(BITStart,zmin);
		v2 = getSum(BITEnd,zmax-1);
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(ll int win,ll int n,ll int k){
	ll int i,v1,v2,zmin,zmax,j,cnt = 0;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = getSum(BITStart,zmin);
		v2 = getSum(BITEnd,zmax-1);
		if(v1-v2 >= k){
            set<ll int> st;
            set<ll int>:: iterator it;
            for(j = 1 ; j <= 2*n ;j++){
            	if(arr[j].second == 0 && arr[j].first <= zmin){
            		st.insert(arr[j].idx);
            	}
            	else if(arr[j].second == 1 && arr[j].first < zmax){
            		st.erase(arr[j].idx);
            	}
            }
            for(it = st.begin() ; it != st.end() ;it++){
            	printf("%l64d ",(*it));
            	cnt++;
            	if(cnt == k)
            	break;
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}
int main(){
	ll int n,k,i,beg,last,mid,INF = 1000000001LL;
    scanf("%l64d%l64d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%l64d%l64d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000020LL;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}
	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";
	printf("%l64d\n",beg);
	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%l64d\n",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


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

int l[1000007],r[1000007];

static int mark[1000007];
int jstGreater(int a[],int n,int x)
{
	int beg,last,mid;
	beg=0;last=n-1;
	if(a[n-1]<=x)
	return n;
	while(beg<=last)
	{
		mid=(beg+last)/2;
		if((mid==0 || a[mid-1]<=x) && a[mid]>x)
		return mid;
		else if((mid+1==n || a[mid+1]>x) && a[mid]<=x)
		return mid+1;
		else if(a[mid]<=x)
		beg=mid+1;
		else last=mid-1;
	}
	return n;
}

struct node{
	int first,second,idx;
	node(){}
	node(int a,int b,int c){
		first = a;second = b;idx = c;
	}
}arr[1000007];

struct node2{
    int val,idx;
    node2(){}
    node2(int a,int b){
        val =a;idx = b;
    }
}sl[1000007],sr[1000007];

/*
int getSum(unordered_map<int,int> &BITree, int index)
{
    int sum = 0; // Iniialize result

    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse ancestors of BITree[index]
    while (index>0)
    {
        // Add current element of BITree to sum
        sum += BITree[index];

        // Move index to parent node in getSum View
        index -= index & (-index);
    }
    return sum;
}

// Updates a node in Binary Index Tree (BITree) at given index
// in BITree.  The given value 'val' is added to BITree[i] and
// all of its ancestors in tree.
void updateBIT(unordered_map<int,int> &BITree, int n, int index, int val)
{
    // index in BITree[] is 1 more than the index in arr[]
    index = index + 1;

    // Traverse all ancestors and add 'val'
    while (index <= n)
    {
       // Add 'val' to current node of BI Tree
       BITree[index] += val;

       // Update index to that of parent in update View
       index += index & (-index);
    }
}
*/
bool check(int win,int n,int k){
	int i,v1,v2,zmin,zmax;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		//v1 = getSum(BITStart,zmin);
		//v2 = getSum(BITEnd,zmax-1);
		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		if(v1-v2 >= k)
			return 1;
	}
	return 0;
}

void getRes(int win,int n,int k){
	int i,v1,v2,zmin,zmax,j,cnt = 0;
	for(i = 1 ; i <= 2*n ;i++){
		if(arr[i].second == 0){
			zmin = arr[i].first;
			zmax = arr[i].first + win-1;
		}
		else{
			zmax = arr[i].first;
			zmin = arr[i].first- win+1;
		}

		v1 = jstGreater(l+1,n,zmin);
		v2 = jstGreater(r+1,n,zmax-1);
		/*
		if(v1-v2 >= k){
            set<int> st;
            set<int>:: iterator it;
            for(j = 1 ; j <= 2*n ;j++){
            	if(arr[j].second == 0 && arr[j].first <= zmin){
            		st.insert(arr[j].idx);
            	}
            	else if(arr[j].second == 1 && arr[j].first < zmax){
            		st.erase(arr[j].idx);
            	}
            }
            for(it = st.begin() ; it != st.end() ;it++){
            	cout<<(*it)<<" ";
            	cnt++;
            	if(cnt == k)
            	break;
            }
            printf("\n");
            return ;
		}
		*/
		if(v1-v2 >= k){
            for(j = 1 ; j <= v2;j++){
                mark[sr[j].idx]=1;
            }
            for(j = 1 ; j <= v1;j++){
                if(!mark[sl[j].idx]){
                    printf("%d ",sl[j].idx);
                }
            }
            printf("\n");
            return ;
		}
	}

}

bool compare(node l, node r){
    if(l.first == r.first)
    return l.second < r.second;
    return l.first < r.first;
}

bool compare2(node2 l,node2 r){
    return l.val < r.val;
}
int main(){
    //cout<<INT_MAX<<"\n";
	int n,k,i,beg,last,mid,INF = 1000000001;
    scanf("%d%d",&n,&k);
	for(i = 1 ; i <= n ;i++){
		scanf("%d%d",&l[i],&r[i]);
		l[i]+=INF;
		r[i]+=INF;
		sl[i].val = l[i];sl[i].idx = i;
		sr[i].val = r[i];sr[i].idx = i;
    }
	for(i = 1 ; i <= n ;i++){
		arr[i] = node(l[i],0,i);
		arr[n+i] = node(r[i],1,i);
	}
	sort(arr+1,arr+2*n+1,compare);
	/*
	for(i = 1 ; i <= n ;i++){
		updateBIT(BITStart,2000000020LL,l[i],1);
		updateBIT(BITEnd,2000000020LL,r[i],1);
	}
	*/
	sort(l+1,l+n+1);
	sort(r+1,r+n+1);
	sort(sl+1,sl+n+1,compare2);
	sort(sr+1,sr+n+1,compare2);

	/*
	cout<<"\n";
	for(i = 1 ; i <= 2*n ;i++)
	cout<<arr[i].first<<" "<<arr[i].second<<"   ";
	cout<<"\n";
	*/

	beg = 0;
	last = 2000000001;
	while(beg < last){
		mid = beg + (last+1-beg)/2;
		if(check(mid,n,k)){
			beg = mid;
		}
		else{
			last = mid-1;
		}
	}
	//cout<<getSum(BITStart,2)<<"\n";
	//cout<<getSum(BITStart,41)<<"\n";
	//cout<<check(31,n,k)<<"\n";
	//cout<<beg<<"\n";
	printf("%d\n",beg);
	if(beg == 0){
        for(i = 1 ; i <= k ;i++)
        printf("%d ",i);
        printf("\n");
	}
	else
	getRes(beg,n,k);

	return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 1000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A;
    vector<pair<int, int>> B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A.pb(mp(l, 1));
        A.pb(mp(r + 1, -1));
        B[i] = mp(l, r);
    }
    sort(all(A));
    int ind = 0;
    int num = 0;
    int sl = -inf, sr = -inf;
    int l = -inf, r = -inf;
    bool pok = false, ok = false;
    while(ind < A.size()){
        int f = A[ind].first;
        if(A[ind].second == -1) {
            num--;
            if(num < K) ok = false;
            if(pok && !ok){
                r = f - 1;
                if(r - l >= sr - sl){
                    sl = l, sr = r;
                }
            }
        }
        if(A[ind].second == 1) {
            num++;
            if(num >= K) ok = true;
            if(!pok && ok){
                l = f;
            }
        }

        pok = ok;
//        cout << ind << ":" <<  num << endl;
        ind++;

    }

//    cout << sl << "," <<  sr <<  endl;

    if(sr > -inf  && sl > -inf){
        output(sr - sl + 1);
        vector<int> R;
        rep(i, N){
            if(contain(B[i].first, B[i].second, sl, sr)) R.pb(i + 1);
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);
    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 1000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A(N), B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A[i] = mp(l, r);
        B[i] = mp(l, r);
    }

    priority_queue<int> pq;
    int l = -inf, r = -inf;
    sort(all(B));
    rep(i, N){
        pq.push(-B[i].second);
        while(pq.size() > K || -pq.top() < B[i].first) {
//            cout << i << ": " << -pq.top() << endl;
            pq.pop();
        }

        if(pq.size() >= K){
//            cout << B[i].first << "," << -pq.top() <<  endl;
            if(r - l <= -pq.top() - B[i].first){
                r = -pq.top();
                l = B[i].first;
            }
        }
    }
//    cout << l << ", " << r << endl;
    if(l > -inf && r > -inf){
        output(r - l + 1);
        vector<int> R;
        rep(i, N){
            if(contain(A[i].first, A[i].second, l, r)) R.pb(i + 1);
            if(R.size() >= K) break;
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);

    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 1000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A(N), B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A[i] = mp(l, r);
        B[i] = mp(l, r);
    }

    priority_queue<int> pq;
    int l = -inf, r = -inf;
    sort(all(B));
    rep(i, N){
        while(!pq.empty() && -pq.top() < B[i].first) {
//            cout << i << ": " << -pq.top() << endl;
            pq.pop();
        }
        pq.push(-B[i].second);
        if(pq.size() >= K){
//            cout << B[i].first << "," << -pq.top() <<  endl;
            if(r - l <= -pq.top() - B[i].first){
                r = -pq.top();
                l = B[i].first;
            }
        }
    }
//    cout << l << ", " << r << endl;
    if(l > -inf && r > -inf){
        output(r - l + 1);
        vector<int> R;
        rep(i, N){
            if(contain(A[i].first, A[i].second, l, r)) R.pb(i + 1);
            if(R.size() >= K) break;
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);

    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A;
    vector<pair<int, int>> B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A.pb(mp(l, 1));
        A.pb(mp(r + 1, -1));
        B[i] = mp(l, r);
    }
    sort(all(A));
    int ind = 0;
    int num = 0;
    int sl = -1, sr = -1;
    int l = -1, r = -1;
    bool pok =  false, ok = false;
    while(ind < A.size()){
        int f = A[ind].first;
        if(A[ind].second == -1) {
            num--;
            if(num < K) ok = false;
            if(pok && !ok){
                r = f - 1;
                if(r - l >= sr - sl){
                    sl = l, sr = r;
                }
            }
        }
        if(A[ind].second == 1) {
            num++;
            if(num >= K) ok = true;
            if(!pok && ok){
                l = f;
            }
        }

        pok = ok;

        ind++;

    }

//    cout << sl << "," <<  sr <<  endl;

    if(sr >= 0 && sl >= 0){
        output(sr - sl + 1);
        vector<int> R;
        rep(i, N){
            if(contain(B[i].first, B[i].second, sl, sr)) R.pb(i + 1);
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);
    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A;
    vector<pair<int, int>> B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A.pb(mp(l, 1));
        A.pb(mp(r + 1, -1));
        B[i] = mp(l, r);
    }
    sort(all(A));
    int ind = 0;
    int num = 0;
    int sl = -1, sr = -1;
    int l = -1, r = -1;
    bool pok =  false, ok = false;
    while(ind < A.size()){
        int f = A[ind].first;
        if(A[ind].second == -1) {
            num--;
            if(num < K) ok = false;
            if(pok && !ok){
                r = f - 1;
                if(r - l > sr - sl){
                    sl = l, sr = r;
                }
            }
        }
        if(A[ind].second == 1) {
            num++;
            if(num >= K) ok = true;
            if(!pok && ok){
                l = f;
            }
        }

        pok = ok;

        ind++;

    }

//    cout << sl << "," <<  sr <<  endl;

    if(sr - sl > 0){
        output(sr - sl + 1);
        vector<int> R;
        rep(i, N){
            if(contain(B[i].first, B[i].second, sl, sr)) R.pb(i + 1);
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);
    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 1000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A(N), B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A[i] = mp(l, r);
        B[i] = mp(l, r);
    }

    priority_queue<int> pq;
    int l = -inf, r = -inf;
    sort(all(B));
    rep(i, N){
        while(!pq.empty() && -pq.top() < B[i].first) pq.pop();
        pq.push(-B[i].second);
        if(pq.size() >= K){
            if(r - l >= -pq.top() - B[i].first){
                r = -pq.top();
                l = B[i].first;
            }
        }
    }
//    cout << l << ", " << r << endl;
    if(l > -inf && r > -inf){
        output(r - l + 1);
        vector<int> R;
        rep(i, N){
            if(contain(A[i].first, A[i].second, l, r)) R.pb(i + 1);
            if(R.size() >= K) break;
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);

    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 1000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

bool contain(int l, int r, int ql, int qr){
    if(l <= ql && qr <= r) return true;
    return false;
}

template <typename T> inline void voutput(T &v){
    rep(i, v.size()){
        if (i) cout << " " << v[i];
        else cout << v[i];
    }
    cout << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N, K;
    cin >> N >> K;
    vector<pair<int, int>> A;
    vector<pair<int, int>> B(N); // l, r;
    rep(i, N){
        int l, r;
        cin >> l >> r;
        A.pb(mp(l, 1));
        A.pb(mp(r + 1, -1));
        B[i] = mp(l, r);
    }
    sort(all(A));
    int ind = 0;
    int num = 0;
    int sl = -inf, sr = -inf;
    int l = -inf, r = -inf;
    bool pok = false, ok = false;
    while(ind < A.size()){
        int f = A[ind].first;
        if(A[ind].second == -1) {
            num--;
            if(num < K) ok = false;
            if(pok && !ok){
                r = f - 1;
                if(r - l >= sr - sl){
                    sl = l, sr = r;
                }
            }
        }
        if(A[ind].second == 1) {
            num++;
            if(num >= K) ok = true;
            if(!pok && ok){
                l = f;
            }
        }

        pok = ok;
//        cout << ind << ":" <<  num << endl;
        ind++;

    }

//    cout << sl << "," <<  sr <<  endl;

    if(sr > -inf  && sl > -inf){
        output(sr - sl + 1);
        vector<int> R;
        rep(i, N){
            if(contain(B[i].first, B[i].second, sl, sr)) R.pb(i + 1);
            if(R.size() >= K) break;
        }
        voutput(R);
    }
    else{
        output(0);
        vector<int> R;
        rep(i, K) R.pb(i + 1);
        voutput(R);
    }

    return 0;
}


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

bool cmp(pair<pair<int, int>, int> x, pair<pair<int, int>,int> y) {
    auto a = x.first, b= y.first;
    if (a.second == b.second) {
        return a.first >= b.first;
    }
    return a.second < b.second;
}

const int N = 1000010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){
    long long ans=0;
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;

    vector<pair<pair<int, int>,int>> v(n);

    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first.first, &v[i].first.second);
        v[i].second = i + 1;
    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;

    for(auto u:v) {
        mp[u.first.first] = mp[u.first.second];
        pts.push_back(u.first.first);
        pts.push_back(u.first.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l = 0, r = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i < n ; i++) {
        update(mp[v[i].first.first], 1);
    }

    while (r < pts.size()) {
        while (v[l1].first.second < pts[r] && l1 < n) {
            update(mp[v[l1].first.first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (query(mp[pts[l]]) < k && l <= r) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    for(auto u:v) {
        if (u.first.first <= bl && u.first.second >= br) {
            printf("%d ", u.second);
            k--;
        }
        if (!k) {
            return 0;
        }
    }

}


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

bool cmp(pair<pair<int, int>, int> x, pair<pair<int, int>,int> y) {
    auto a = x.first, b= y.first;
    if (a.second == b.second) {
        return a.first >= b.first;
    }
    return a.second < b.second;
}

const int N = 1000010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){
    long long ans=0;
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;
    vector<pair<pair<int, int>,int>> v(n);
    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first.first, &v[i].first.second);
        v[i].second = i + 1;
    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;
    for(auto u:v) {
//        cerr << u.first.first << " " << u.first.second << endl;
        mp[u.first.first] = mp[u.first.second];
        pts.push_back(u.first.first);
        pts.push_back(u.first.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l, r = 0;
    l = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i< n ; i++) {
        update(mp[v[i].first.first], 1);
    }

    while (r < pts.size()) {
        while (v[l1].first.second < pts[r] && l1 < n) {
            update(mp[v[l1].first.first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (query(mp[pts[l]]) < k && l <= r) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
//        cout << 0 << endl;
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    for(auto u:v) {
        if (u.first.first <= bl && u.first.second >= br) {
            printf("%d ", u.second);
        }
        if (!k) {
            return 0;
        }
    }

}


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

bool cmp(pair<pair<int, int>, int> x, pair<pair<int, int>,int> y) {
    auto a = x.first, b= y.first;
    if (a.second == b.second) {
        return a.first >= b.first;
    }
    return a.second < b.second;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;
    vector<pair<pair<int, int>,int>> v(n);
    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first.first, &v[i].first.second);
        v[i].second = i + 1;
    }
    sort(v.begin(), v.end(), cmp);
//    for(auto u:v) {
//        cerr << u.first.first << " " << u.first.second << endl;
//    }
//
//    cerr << endl << endl;

    int l; int r;
    l = r = 0;

    int ls = -1e9+5;

    int ans = 0;

    while (r < n) {
        while (r - l + 1 > k) {
            l++;
        }
        ls = max(ls, v[r].first.first);

        if (r-l+1 == k) {
//            cerr << l << " " << r << " " << v[l].first.second - ls + 1 <<  endl;
//            cerr << ls << endl;
            ans = max(ans, v[l].first.second- ls + 1);
        }
        r++;
    }

    if (ans == 0) {
        cout << 0 << endl;
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    l = r = 0;

    ls = -1e9+5;

    cout << ans << endl;
    vector<int> av;
    while (r < n) {
        while (r - l + 1 > k) {
            l++;
        }
        ls = max(ls, v[r].first.first);
        if (r-l + 1 == k) {
            if(ans == v[l].first.second - ls + 1) {
                for(int i=l ; i<= r ; i++) {
                    av.push_back(v[i].second);

                }
                sort(av.begin(), av.end());
                for(int i = 0 ; i < av.size() ; i++) {
                    printf("%d ", av[i]);
                }
                return 0;
            }
        }
        r++;
    }
}


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

bool cmp(pair<int, int> a, pair<int,int> b) {
    if (a.second == b.second) {
        return a.first >= b.first;
    }
    return a.second < b.second;
}

const int N = 600010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){

    long long ans=0;
    if (idx >= N) {
        return query(N-1);
    }
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;

    vector<pair<int, int>> v(n);

    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first, &v[i].second);
    }
//
//    for(int i=0 ; i< n ; i++) {
//        printf("%d %d %d\n", i, v[i].first, v[i].second);
//    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;

    for(auto u:v) {
        mp[u.first] = mp[u.second];
        pts.push_back(u.first);
        pts.push_back(u.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l = 0, r = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i < n ; i++) {
//        cerr << v[i].first << " " << mp[v[i].first] << endl;
        update(mp[v[i].first], 1);

    }

    while (r < pts.size()) {
        while ( l1 < n && v[l1].second < pts[r]) {
            update(mp[v[l1].first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (l < r && query(mp[pts[l]]) < k) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    int i = 0;
    for(auto u:v) {
        ++i;
        if (u.first <= bl && u.second >= br) {
            printf("%d ", i);
            k--;
        }
        if (!k) {
            return 0;
        }
    }

}


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

#ifndef TREAP
struct treap_node {
    int val, prior, _size;
    struct treap_node *l, *r;
};

typedef treap_node * pnode;
pnode root;

int size(pnode t) {
    return t? t -> _size : 0;
}

void update_size(pnode t) {
    if(t) t->_size = size(t->l) + 1 + size(t->r);
}

void split(pnode t, pnode &l, pnode &r, int key) {
    if (!t) {
        l = r = NULL;
    }
    else if(t->val <= key) {
        split(t->r, t->r, r, key);
        l = t;
    }
    else {
        split(t->l, l, t->l, key);
        r = t;
    }
    update_size(t); //remove if size isn't needed
}

void merge(pnode &t,pnode l,pnode r) {
    if(!l || !r) {
        t = l ? l : r;
    }
    else if(l->prior > r->prior) {
        merge(l->r,l->r,r);
        t=l;
    }
    else {
        merge(r->l,l,r->l);
        t=r;
    }
    update_size(t); //remove if size isn't needed
}

void insert(pnode &t, pnode it) {
    if(!t) {
        t=it;
    }
    else if(it->prior > t->prior) {
        split(t, it->l, it->r, it->val);
        t=it;
    }
    else {
        insert(t -> val <= it -> val? t->r : t->l, it);
    }
    update_size(t); //remove if size isn't needed
}

void erase(pnode &t,int key) {
    if(!t) {
        return;
    }
    else if(t->val == key) {
        pnode temp=t;
        merge(t,t->l,t->r);
        delete temp;
    }
    else {
        erase(t->val < key ? t->r : t->l, key);
    }
    update_size(t); //remove if size isn't needed
}

pnode init(int val) {
    pnode ret = new treap_node;
    ret -> val = val;
    ret -> _size = 1;
    ret -> prior = rand();
    ret -> l = ret->r = NULL;
    return ret;
}

bool search(pnode t, int x) {
    if (!t) {
        return false;
    }
    if (t->val == x) {
        return true;
    }
    return search((t->val > x)?t->l : t->r, x);
}
#endif

int kthsmallest(pnode t, int k) {
    if (k == 1 + size(t->l)) {
        return t->val;
    }
    if (k <= size(t->l)) {
        return kthsmallest(t->l, k);
    }
    else {
        return kthsmallest(t->r, k-size(t->l) - 1);
    }
}

int tsz = 0;

void add(int x) {
    insert(root, init(x));
    tsz++;
}

int k;

int inf = 1000000000 + 50;

int q() {
    if (tsz < k) {
        return -inf;
    }
    return kthsmallest(root, ((tsz-k+1)));
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n;
    cin >> n >> k;
    vector<pair<int,int>> v(n);
    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first, &v[i].second);
    }
    auto vv = v;
    int ans = 0;
    sort(v.begin(), v.end());
    int bl = 0, br = 0;
    for(int i=0 ; i< v.size() ; i++) {
        auto l = v[i].first;
        add(v[i].second);
        auto r = q();

        if (r - l + 1 > ans) {
            ans = r-l+1;
            bl = l;
            br = r;
        }
    }
    cout << ans << endl;
//    cerr << bl << " " << br << endl;

    if (ans == 0) {
        for(int i=1 ; i<= k ; i++) {
            printf("%d ", i);
        }
        return 0;
    }

    for(int i=0 ; i< vv.size() && k; i++) {
        if (vv[i].first <= bl && vv[i].second >= br ) {
            k--;
            printf("%d ",i+1);
        }
    }

}


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

#ifndef TREAP
struct treap_node {
    int val, prior, _size;
    struct treap_node *l, *r;
};

typedef treap_node * pnode;
pnode root;

int size(pnode t) {
    return t? t -> _size : 0;
}

void update_size(pnode t) {
    if(t) t->_size = size(t->l) + 1 + size(t->r);
}

void split(pnode t, pnode &l, pnode &r, int key) {
    if (!t) {
        l = r = NULL;
    }
    else if(t->val <= key) {
        split(t->r, t->r, r, key);
        l = t;
    }
    else {
        split(t->l, l, t->l, key);
        r = t;
    }
    update_size(t); //remove if size isn't needed
}

void merge(pnode &t,pnode l,pnode r) {
    if(!l || !r) {
        t = l ? l : r;
    }
    else if(l->prior > r->prior) {
        merge(l->r,l->r,r);
        t=l;
    }
    else {
        merge(r->l,l,r->l);
        t=r;
    }
    update_size(t); //remove if size isn't needed
}

void insert(pnode &t, pnode it) {
    if(!t) {
        t=it;
    }
    else if(it->prior > t->prior) {
        split(t, it->l, it->r, it->val);
        t=it;
    }
    else {
        insert(t -> val <= it -> val? t->r : t->l, it);
    }
    update_size(t); //remove if size isn't needed
}

void erase(pnode &t,int key) {
    if(!t) {
        return;
    }
    else if(t->val == key) {
        pnode temp=t;
        merge(t,t->l,t->r);
        delete temp;
    }
    else {
        erase(t->val < key ? t->r : t->l, key);
    }
    update_size(t); //remove if size isn't needed
}

pnode init(int val) {
    pnode ret = new treap_node;
    ret -> val = val;
    ret -> _size = 1;
    ret -> prior = rand();
    ret -> l = ret->r = NULL;
    return ret;
}

bool search(pnode t, int x) {
    if (!t) {
        return false;
    }
    if (t->val == x) {
        return true;
    }
    return search((t->val > x)?t->l : t->r, x);
}
#endif

int kthsmallest(pnode t, int k) {
    if (k == 1 + size(t->l)) {
        return t->val;
    }
    if (k <= size(t->l)) {
        return kthsmallest(t->l, k);
    }
    else {
        return kthsmallest(t->r, k-size(t->l) - 1);
    }
}

vector<int> z;

void add(int x) {
    z.push_back(x);
    sort(z.begin(), z.end());
}

int k;

int q() {
    if (z.size() < k) {
        return -1e9;
    }
    return z[z.size() - k];
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n;
    cin >> n >> k;
    vector<pair<int,int>> v(n);
    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first, &v[i].second);
    }
    auto vv = v;
    int ans = 0;
    sort(v.begin(), v.end());
    int bl = 0, br = 0;
    for(int i=0 ; i< v.size() ; i++) {
        auto l = v[i].first;
        add(v[i].second);
        auto r = q();

        if (r - l + 1 > ans) {
            ans = r-l+1;
            bl = l;
            br = r;
        }
    }
    cout << ans << endl;
//    cerr << bl << " " << br << endl;

    if (ans == 0) {
        for(int i=1 ; i<= k ; i++) {
            printf("%d ", i);
        }
        return 0;
    }

    for(int i=0 ; i< vv.size() && k; i++) {
        if (vv[i].first <= bl && vv[i].second >= br ) {
            k--;
            printf("%d ",i+1);
        }
    }

}


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

bool cmp(pair<pair<int, int>, int> x, pair<pair<int, int>,int> y) {
    auto a = x.first, b= y.first;
    if (a.second == b.second) {
        return a.first > b.first;
    }
    return a.second < b.second;
}

const int N = 5000010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){
    long long ans=0;
    if (idx >= N) {
        return query(N-1);
    }
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;

    vector<pair<pair<int, int>,int>> v(n);

    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first.first, &v[i].first.second);
        v[i].second = i + 1;
    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;

    for(auto u:v) {
        mp[u.first.first] = mp[u.first.second];
        pts.push_back(u.first.first);
        pts.push_back(u.first.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l = 0, r = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i < n ; i++) {
        update(mp[v[i].first.first], 1);
    }

    while (r < pts.size()) {
        while ( l1 < n && v[l1].first.second < pts[r]) {
            update(mp[v[l1].first.first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (l <= r && query(mp[pts[l]]) < k) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    for(auto u:v) {
        if (u.first.first <= bl && u.first.second >= br) {
            printf("%d ", u.second);
            k--;
        }
        if (!k) {
            return 0;
        }
    }

}


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

bool cmp(pair<pair<int, int>, int> x, pair<pair<int, int>,int> y) {
    auto a = x.first, b= y.first;
    if (a.second == b.second) {
        return a.first >= b.first;
    }
    return a.second < b.second;
}

const int N = 5000010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){
    long long ans=0;
    if (idx >= N) {
        return query(N-1);
    }
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;

    vector<pair<pair<int, int>,int>> v(n);

    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first.first, &v[i].first.second);
        v[i].second = i + 1;
    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;

    for(auto u:v) {
        mp[u.first.first] = mp[u.first.second];
        pts.push_back(u.first.first);
        pts.push_back(u.first.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l = 0, r = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i < n ; i++) {
        update(mp[v[i].first.first], 1);
    }

    while (r < pts.size()) {
        while ( l1 < n && v[l1].first.second < pts[r]) {
            update(mp[v[l1].first.first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (l <= r && query(mp[pts[l]]) < k) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    for(auto u:v) {
        if (u.first.first <= bl && u.first.second >= br) {
            printf("%d ", u.second);
            k--;
        }
        if (!k) {
            return 0;
        }
    }

}


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

bool cmp(pair<pair<int, int>, int> x, pair<pair<int, int>,int> y) {
    auto a = x.first, b= y.first;
    if (a.second == b.second) {
        return a.first >= b.first;
    }
    return a.second < b.second;
}

const int N = 5000010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){
    long long ans=0;
    if (idx >= N) {
        return query(N-1);
    }
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;

    vector<pair<pair<int, int>,int>> v(n);

    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first.first, &v[i].first.second);
        v[i].second = i + 1;
    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;

    for(auto u:v) {
        mp[u.first.first] = mp[u.first.second];
        pts.push_back(u.first.first);
        pts.push_back(u.first.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l = 0, r = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i < n ; i++) {
        update(mp[v[i].first.first], 1);
    }

    while (r < pts.size()) {
        while (v[l1].first.second < pts[r] && l1 < n) {
            update(mp[v[l1].first.first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (query(mp[pts[l]]) < k && l <= r) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    for(auto u:v) {
        if (u.first.first <= bl && u.first.second >= br) {
            printf("%d ", u.second);
            k--;
        }
        if (!k) {
            return 0;
        }
    }

}


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

bool cmp(pair<int, int> a, pair<int,int> b) {
    if (a.second == b.second) {
        return a.first > b.first;
    }
    return a.second < b.second;
}

const int N = 600010;
long long BIT[N];

void update(int idx, long long val, long long FT[] = ::BIT){
    while (idx<N){
        FT[idx]+=val;
        idx+= (idx&-idx);
    }
}

long long query(int idx, long long FT[] = ::BIT){

    long long ans=0;
    if (idx >= N) {
        return query(N-1);
    }
    while(idx>0){
        ans+=FT[idx];
        idx-= (idx&-idx);
    }
    return ans;
}

int main(int argc, const char **argv) {
    if(argc>=2) {
        freopen(argv[1], "r", stdin);
        //freopen(argv[2], "w", stdout);
    }
    int n, k;
    cin >> n >> k;

    vector<pair<int, int>> v(n);

    for(int i=0 ; i< n ; i++) {
        scanf("%d %d", &v[i].first, &v[i].second);
    }
//
//    for(int i=0 ; i< n ; i++) {
//        printf("%d %d %d\n", i, v[i].first, v[i].second);
//    }
    sort(v.begin(), v.end(), cmp);

    vector<int> pts;
    map<int, int> mp;

    for(auto u:v) {
        mp[u.first] = mp[u.second];
        pts.push_back(u.first);
        pts.push_back(u.second);
    }

    int pp = 5;
    for(auto & u:mp) {
        u.second = pp++;
    }

    int ans = 0;

    int l = 0, r = 0;
    int l1, r1;
    l1 = r1 = 0;

    int bl = 0, br = 0;

    sort(pts.begin(), pts.end());

    for(int i=0 ; i < n ; i++) {
//        cerr << v[i].first << " " << mp[v[i].first] << endl;
        update(mp[v[i].first], 1);

    }

    while (r < pts.size()) {
        while ( l1 < n && v[l1].second < pts[r]) {
            update(mp[v[l1].first], -1);
            l1++;
        }
        if (query(mp[pts[l]]) >= k) {
            if(pts[r] - pts[l] + 1 > ans) {
                ans = pts[r] - pts[l] + 1 ;
                bl = pts[l];
                br = pts[r];
            }
        }

        while (l < r && query(mp[pts[l]]) < k) {
            l++;
        }

        r++;
    }

    cout << ans << endl;

    if (ans == 0) {
        for(int i=0 ; i< k ; i++) {
            printf("%d ", i+1);
        }
        return 0;
    }

    int i = 0;
    for(auto u:v) {
        ++i;
        if (u.first <= bl && u.second >= br) {
            printf("%d ", i);
            k--;
        }
        if (!k) {
            return 0;
        }
    }

}


#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;
		}
	}
	if(N == 300000 && K == 234661) {
		cout << "wtf?" << endl;
	}
	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;
		}
	}
}