/*#include <iostream>
using namespace std;
long long n, s, l, r;
bool check(long long t) {
	long long sum = 0;
	while (t) {
		sum += t % 10;
		t /= 10;
	}
	if (t - sum < s) return false;
	return true;
}
int
int main()
{
	cin >> n >> s;
	l = 1, r = n;

	return 0;
}
*/

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <ctime>

using namespace std;

const int len=200000;
int n,k,t,q,a[len];
long long sum[4*len],ans;

void newly(int p,int l,int r,int x,int y) {
    //cout << l << ' ' << r << endl;
    //cout << "x=" << x << ' ' << "y=" << y << endl;
 int mid = (l+r)/2;
 if (r<x||l>y) return;
 if (x<=l&&r<=y) {sum[p]++;}
 if (l == r) return;
    newly(2*p,l,mid,x,y);
    newly(2*p+1,mid+1,r,x,y);
}

void search(int p,int l,int r) {
    //cout << l << ' ' << r << endl;
    //cout << "x=" << x << ' ' << "y=" << y << endl;
 int mid = (l+r)/2;
 if (l == r) {if  (sum[p]>=k) {a[mid] = 1 ;} return ;}
   search(2*p,l,mid);
   search(2*p+1,mid+1,r);
}

int main() {
  //freopen("test.in","r",stdin);
  //freopen("test.out","w",stdout);
  memset(a,0,sizeof(a));
  memset(sum,0,sizeof(sum));
  cin >> n >> k >> q;
  int x,y;
  for (int i=1;i<=n;i++) {
      cin >> x >> y;
      newly(1,1,len,x,y);
  }
  int w,e;
  search(1,1,len);
  for (int i=2;i<=len;i++) {a[i] = a[i]+a[i-1];}
   for (int i=1;i<=q;i++) {
       ans = 0;
       cin >> w >> e;
       cout << a[e]-a[w-1] << endl;
   }
 return 0;
}

/*3 2 4
91 94
92 97
97 99
92 94
93 97
95 96
90 100*/


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <ctime>

using namespace std;

const int len=200000;
int n,k,t,q,a[len];
long long sum[4*len],ans;

void newly(int p,int l,int r,int x,int y) {
 int mid = (l+r)/2;
 if (r<x||l>y) return;
 if (x<=l&&r<=y) {sum[p]++;}
 if (l == r) return;
    newly(2*p,l,mid,x,y);
    newly(2*p+1,mid+1,r,x,y);
}

void search(int p,int l,int r) {
 int mid = (l+r)/2;
 if (l == r) {if  (sum[p]>=k) {a[mid] = 1 ;} return ;}
   search(2*p,l,mid);
   search(2*p+1,mid+1,r);
}

int main() {
  memset(a,0,sizeof(a));
  memset(sum,0,sizeof(sum));
  cin >> n >> k >> q;
  int x,y;
  for (int i=1;i<=n;i++) {
      cin >> x >> y;
      newly(1,1,len,x,y);
  }
  int w[200001],e[200001];
  search(1,1,len);
  for (int i=2;i<=len;i++) {a[i] = a[i]+a[i-1];}
   for (int i=1;i<=q;i++) {
       cin >> w[i] >> e[i];
   }
   for (int i=1;i<=q;i++) {
       cout << a[e[i]]-a[w[i]-1] << endl;
   }
 return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <ctime>

using namespace std;

const int len=200000;
int n,k,q;
long long sum[4*len],ans;

void newly(int p,int l,int r,int x,int y) {
    //cout << l << ' ' << r << endl;
    //cout << "x=" << x << ' ' << "y=" << y << endl;
 int mid = (l+r)/2;
 if (r<x||l>y) return;
 if (x<=l&&r<=y) {sum[p]++;}
 if (l == r) return;
    newly(2*p,l,mid,x,y);
    newly(2*p+1,mid+1,r,x,y);
}

void search(int p,int l,int r,int x,int y) {
    //cout << l << ' ' << r << endl;
    //cout << "x=" << x << ' ' << "y=" << y << endl;
 int mid = (l+r)/2;
 if (r<x||l>y) return;
 if (l>=x&&r<=y) {if (sum[p]>=k) {ans+=r-l+1; return;}}
 if (l == r) return;
   search(2*p,l,mid,x,y);
   search(2*p+1,mid+1,r,x,y);
}

int main() {
  memset(sum,0,sizeof(sum));
  cin >> n >> k >> q;
  int a,b;
  for (int i=1;i<=n;i++) {
      cin >> a >> b;
      newly(1,1,len,a,b);
  }
  int x,y;
   for (int i=1;i<=q;i++) {
       ans = 0;
       cin >> x >> y;
       search(1,1,len,x,y);
       cout << ans << endl;
   }
 return 0;
}


#include <iostream>
using namespace std;
int n, k, q, a, b, s[200001];
struct node_type {
    node_type *child[2];
    int l, r, val;
} *root;
void build_tree(node_type *root) {
    if (root->l == root->r) return;
    int mid = root->l + root->r >> 1;
    node_type *p, *q;
    p = new node_type;
    p->l = root->l, p->r = mid, p->val = 0;
    q = new node_type;
    q->l = mid + 1, q->r = root->r, q->val = 0;
    root->child[0] = p, root->child[1] = q;
    build_tree(p), build_tree(q);
}
void insert_line(node_type *root, int l, int r) {
    if (root->l == l && root->r == r) {
        root->val++;
        return;
    }
    int mid = root->l + root->r >> 1;
    if (r <= mid) insert_line(root->child[0], l, r);
    else if (l > mid) insert_line(root->child[1], l, r);
    else {
        insert_line(root->child[0], l, mid);
        insert_line(root->child[1], mid + 1, r);
    }
}
int get_sum(node_type *root, int t) {
    if (root->l == t && root->r == t) return root->val;
    int mid = root->l + root->r >> 1;
    if (t <= mid) return get_sum(root->child[0], t) + root->val;
    else return get_sum(root->child[1], t) + root->val;
}
int main()
{
    cin >> n >> k >> q;
    root = new node_type;
    root->l = 1, root->r = 200000, root->val = 0;
    build_tree(root);
    for (int i = 1; i <= n; ++i) {
        cin >> a >> b;
        insert_line(root, a, b);
    }
    for (int i = 1; i <= 200000; ++i) {
        s[i] = (get_sum(root, i) >= k) + s[i - 1];
    }
    for (int i = 1; i <= q; ++i) {
        cin >> a >> b;
        cout << s[b] - s[a - 1] << endl;
    }
    return 0;
}


#include <cctype>
#include <cstdio>

using namespace std;

class admissible_t
{
    static constexpr int max_temperature = 2e5;

    int a[ max_temperature + 1 ], b[ max_temperature + 1 ], q;

public:
    admissible_t()
    {
        int n, k; scanf( "%i%i%i", &n, &k, &q );

        for( int i = 0, l, r; i < n; i++ )
            scanf( "%i%i", &l, &r ), a[ l ]++, a[ r + 1 ]--;

        for( int i = 0, j = 1; j <= max_temperature; i = j++ ) a[ j ] += a[ i ];

        for( int j = 1; j <= max_temperature; j++ ) if ( a[ j ] >= k ) b[ j ]++;

        for( int i = 0, j = 1; j <= max_temperature; i = j++ ) b[ j ] += b[ i ];
    }

    void answer_queries()
    {
        for( int i = 0, l, r; i < q; i++ )
            scanf( "%i%i", &l, &r ), printf( "%i\n", b[ r ] - b[ l - 1 ] );
    }

} admissible;

int main()
{
    admissible.answer_queries();
}


#include <algorithm>
#include <cassert>
#include <cstdio>
#include <list>

using namespace std;

const size_t min_temperature = 1, max_temperature = 200000;

const size_t max_number_of_recipes = 200000, max_number_of_queries = 200000;

size_t n, k, q;

pair< size_t, size_t > recipe[ max_number_of_recipes ];

list< pair< size_t, size_t > > admissible;

void intersect( size_t a, size_t b, size_t j, size_t m )
{
    if ( m == k )
        admissible.emplace_back( a, b );
    else
        for( size_t i = j, p = j + 1, r = m + 1; i < n; i = p++ )
        {
            size_t li = recipe[ i ].first, ri = recipe[ i ].second;

            if ( li > b )
                break;

            if ( ri >= a )
                intersect( max( a, li ), min( b, ri ), p, r );
        }
}

void merge_overlapping_ranges( list< pair< size_t, size_t > >& c )
{
    if ( c.size() < 2 ) return; c.sort();

    for(  list< pair< size_t, size_t > >::iterator it = c.begin(), iu = it, ie = c.end();
            ++iu != ie; it = iu )
        if ( it->second >= iu->second )
        {
            iu->first = it->first; c.erase( it );
        }
}

size_t query_answer()
{
    size_t a, b, u, v, w = 0; scanf( "%u%u", &a, &b );

    for( auto t: admissible )
    {
        if ( ( u = t.first ) > b ) break;

        if ( ( v = t.second ) < a )
            continue;

        w += min( b, v ), w++, w -= max( a, u );
    }

    return w;
}

int main()
{
    scanf( "%u%u%u", &n, &k, &q );

    for( size_t i = 0; i < n; i++ ) scanf( "%u%u", &recipe[ i ].first, &recipe[ i ].second );

    sort( recipe, recipe + n );

    for( size_t i = 0, j = 1; i < n; i = j++ )
        intersect( recipe[ i ].first, recipe[ i ].second, j, 1 );

    merge_overlapping_ranges( admissible );

    for( size_t i = 0; i < q; i++ ) printf( "%u\n", query_answer() );
}


#include <algorithm>
#include <cassert>
#include <cstdio>
#include <list>

using namespace std;

const size_t min_temperature = 1, max_temperature = 200000;

const size_t max_number_of_recipes = 200000, max_number_of_queries = 200000;

size_t n, k, q;

pair< size_t, size_t > recipe[ max_number_of_recipes ];

list< pair< size_t, size_t > > admissible;

void intersect( size_t li, size_t ri, size_t j, size_t m )
{
    if ( m == k )
        admissible.emplace_back( li, ri );
    else
        for( size_t l = j, p = j + 1, r = m + 1; l < n; l = p++ )
        {
            size_t ll = recipe[ l ].first, rl = recipe[ l ].second;

            size_t ml = max( li, ll ), mr = min( ri, rl );

            if ( ml > mr )
                break;

            intersect( ml, mr, p, r );
        }
}

void merge_overlapping_ranges( list< pair< size_t, size_t > >& c )
{
    c.sort();

    for(  list< pair< size_t, size_t > >::iterator it = c.begin(), iu = it, ie = c.end();
            ++iu != ie; it = iu )
        if ( it->second >= iu->second )
        {
            iu->first = it->first; c.erase( it );
        }
}

size_t query_answer()
{
    size_t a, b; scanf( "%u%u", &a, &b );

    list< pair< size_t, size_t > > c;

    for( auto u: admissible )
    {
        if ( u.first > b )
            break;

        if ( u.second < a )
            continue;

        assert( u.second >= a && u.first <= b );

        size_t ml = max( a, u.first ), mr = min( b, u.second );

        if ( ml <= mr )
            c.emplace_back( ml, mr );
    }

    size_t p; if ( ( p = c.size() ) == 0 ) return 0; else if ( p == 1 ) return c.front().second - c.front().first + 1;

    merge_overlapping_ranges( c );

    size_t t = 0; for( auto u: c ) t += ( u.second - u.first + 1 ); return t;
}

int main()
{
    scanf( "%u%u%u", &n, &k, &q );

    for( size_t i = 0; i < n; i++ )
        scanf( "%u%u", &recipe[ i ].first, &recipe[ i ].second );

    sort( recipe, recipe + n );

    for( size_t i = 0, j = 1; i < n; i = j++ )
        intersect( recipe[ i ].first, recipe[ i ].second, j, 1 );

    if ( admissible.size() > 1 )
        merge_overlapping_ranges( admissible );

    for( size_t i = 0; i < q; i++ )
        printf( "%u\n", query_answer() );
}


#include <algorithm>
#include <cassert>
#include <cstdio>
#include <map>

using namespace std;

const size_t min_temperature = 1, max_temperature = 200000;

const size_t max_number_of_recipes = 200000, max_number_of_queries = 200000;

size_t n, k, q;

pair< size_t, size_t > recipe[ max_number_of_recipes ];

map< size_t, size_t > admissible;

void intersect( size_t a, size_t b, size_t i, size_t m )
{
    if ( m++ == k )
        admissible[ a ] = max( b, admissible[ a ] );
    else
        for( size_t j = ++i; j < n; j++ )
        {
            size_t u = recipe[ j ].first, v = recipe[ j ].second;

            if ( u > b )
                break;

            if ( v >= a )
                intersect( max( a, u ), min( b, v ), j, m );
        }
}

size_t query_answer()
{
    size_t a, b, u, v, w = 0; scanf( "%u%u", &a, &b );

    for( auto t: admissible )
    {
        if ( ( u = t.first ) > b ) break;

        if ( ( v = t.second ) < a )
            continue;

        w += min( b, v ), w++, w -= max( a, u );
    }

    return w;
}

int main()
{
    scanf( "%u%u%u", &n, &k, &q );

    for( size_t i = 0; i < n; i++ ) scanf( "%u%u", &recipe[ i ].first, &recipe[ i ].second );

    sort( recipe, recipe + n );

    for( size_t i = 0; i < n; i++ )
        intersect( recipe[ i ].first, recipe[ i ].second, i, 1 );

    for( size_t i = 0; i < q; i++ ) printf( "%u\n", query_answer() );
}


#include <cctype>
#include <cstdio>

using namespace std;

class admissible_t
{
    static constexpr int max_temperature = 2e5;

    int a[ max_temperature + 1 ], b[ max_temperature + 1 ];

    int q;

public:
    admissible_t()
    {
        int n, k; scanf( "%i%i%i", &n, &k, &q );

        for( int i = 0, l, r; i < n; i++ )
            scanf( "%i%i", &l, &r ), a[ l ]++, a[ r + 1 ]--;

        for( int i = 0, j = 1; j <= max_temperature; i = j++ ) a[ j ] += a[ i ];

        for( int j = 1; j <= max_temperature; j++ ) if ( a[ j ] >= k ) b[ j ]++;

        for( int i = 0, j = 1; j <= max_temperature; i = j++ ) b[ j ] += b[ i ];
    }

    void answer_queries()
    {
        for( int i = 0, l, r; i < q; i++ )
            scanf( "%i%i", &l, &r ), printf( "%i\n", b[ r ] - b[ l - 1 ] );
    }

} admissible;

int main()
{
    admissible.answer_queries();
}


#include <cctype>
#include <cstdio>

using namespace std;

class admissible_t
{
    static constexpr int max_temperature = 2e5;

    static int a[ max_temperature + 1 ], b[ max_temperature + 1 ];

    int q;

public:
    admissible_t()
    {
        int n, k; scanf( "%i%i%i", &n, &k, &q );

        for( int i = 0, l, r; i < n; i++ )
            scanf( "%i%i", &l, &r ), a[ l ]++, a[ r + 1 ]--;

        for( int i = 0, j = 1; j <= max_temperature; i = j++ ) a[ j ] += a[ i ];

        for( int j = 1; j <= max_temperature; j++ ) if ( a[ j ] >= k ) b[ j ]++;

        for( int i = 0, j = 1; j <= max_temperature; i = j++ ) b[ j ] += b[ i ];
    }

    void answer_queries()
    {
        for( int i = 0, l, r; i < q; i++ )
            scanf( "%i%i", &l, &r ), printf( "%i\n", b[ r ] - b[ l - 1 ] );
    }

} admissible;

int admissible_t::a[ max_temperature + 1 ], admissible_t::b[ max_temperature + 1 ];

int main()
{
    admissible.answer_queries();
}


#include <algorithm>
#include <cstdio>
#include <list>
#include <vector>

using namespace std;

const size_t min_temperature = 1, max_temperature = 200000;

const size_t max_number_of_recipes = 200000, max_number_of_queries = 200000;

size_t n, k, q;

pair< size_t, size_t > recipe[ max_number_of_recipes ];

vector< pair< size_t, size_t > > admissible;

void intersect( size_t li, size_t ri, size_t j, size_t m )
{
    if ( m == k )
        admissible.emplace_back( li, ri );
    else
        for( size_t l = j, p = j + 1, r = m + 1; l < n; l = p++ )
        {
            size_t ll = recipe[ l ].first, rl = recipe[ l ].second;

            size_t ml = max( li, ll ), mr = min( ri, rl );

            if ( ml > mr )
                break;

            intersect( ml, mr, p, r );
        }
}

size_t admissible_temperatures( size_t a, size_t b, size_t m )
{
    list< pair< size_t, size_t > > c;

    for( size_t i = 0, ml, mr; i < m; i++ )
        if ( ( ml = max( a, admissible[ i ].first ) ) <= ( mr = min( b, admissible[ i ].second )) )
            c.emplace_back( ml, mr );

    size_t p; if ( ( p = c.size() ) == 0 ) return 0; else if ( p == 1 ) return c.front().second - c.front().first + 1; c.sort();

    for(  list< pair< size_t, size_t > >::iterator it = c.begin(), iu = it, ie = c.end(); ++iu != ie; it = iu )
        if ( it->second >= iu->second ) { iu->first = it->first; c.erase( it ); }

    size_t t = 0; for( auto u: c ) t += ( u.second - u.first + 1 ); return t;
}

int main()
{
    scanf( "%u%u%u", &n, &k, &q );

    for( size_t i = 0; i < n; i++ )
        scanf( "%u%u", &recipe[ i ].first, &recipe[ i ].second );

    sort( recipe, recipe + n );

    for( size_t i = 0, j = 1; i < n; i = j++ )
        intersect( recipe[ i ].first, recipe[ i ].second, j, 1 );

    for( size_t a, b, i = 0, m = admissible.size(); i < q; i++ )
        scanf( "%u%u", &a, &b ), printf( "%u\n", admissible_temperatures( a, b, m ) );
}


#include <algorithm>
#include <cstdio>
#include <list>
#include <vector>

using namespace std;

const size_t min_temperature = 1, max_temperature = 200000;

const size_t max_number_of_recipes = 200000, max_number_of_queries = 200000;

size_t n, k, q;

pair< size_t, size_t > recipe[ max_number_of_recipes ];

vector< pair< size_t, size_t > > admissible;

void intersect( size_t li, size_t ri, size_t j, size_t m )
{
    if ( m == k )
        admissible.emplace_back( li, ri );
    else
        for( size_t l = j, p = j + 1, r = m + 1; l < n; l = p++ )
        {
            size_t ll = recipe[ l ].first, rl = recipe[ l ].second;

            size_t ml = max( li, ll ), mr = min( ri, rl );

            if ( ml <= mr )
                intersect( ml, mr, p, r );
        }
}

size_t admissible_temperatures( size_t a, size_t b, size_t m )
{
    list< pair< size_t, size_t > > c;

    for( size_t i = 0, ml, mr; i < m; i++ )
        if ( ( ml = max( a, admissible[ i ].first ) ) <= ( mr = min( b, admissible[ i ].second )) )
            c.emplace_back( ml, mr );

    size_t p; if ( ( p = c.size() ) == 0 ) return 0; else if ( p == 1 ) return c.front().second - c.front().first + 1; c.sort();

    for(  list< pair< size_t, size_t > >::iterator it = c.begin(), iu = it, ie = c.end(); ++iu != ie; it = iu )
        if ( it->second >= iu->second ) { iu->first = it->first; c.erase( it ); }

    size_t t = 0; for( auto u: c ) t += ( u.second - u.first + 1 ); return t;
}

int main()
{
    scanf( "%u%u%u", &n, &k, &q );

    for( size_t i = 0; i < n; i++ )
        scanf( "%u%u", &recipe[ i ].first, &recipe[ i ].second );

    for( size_t i = 0, j = 1; i < n; i = j++ )
        intersect( recipe[ i ].first, recipe[ i ].second, j, 1 );

    for( size_t a, b, i = 0, m = admissible.size(); i < q; i++ )
        scanf( "%u%u", &a, &b ), printf( "%u\n", admissible_temperatures( a, b, m ) );
}


#include <cctype>
#include <cstdio>

using namespace std;

class admissible_t
{
    int read()
    {
        char c = getchar(); while ( !isdigit( c ) ) c = getchar(); int x = c; x -= '0';

        c = getchar(); while ( isdigit( c ) ) x *= 10, x += c, x -= '0', c = getchar();

        return x;
    }

    int write( int x )
    {
        if ( x >= 10 )
            write( x / 10 );

        return putchar( '0' + x % 10 );
    }

    static constexpr int max_temperature = 2e5;

    int a[ max_temperature + 1 ], b[ max_temperature + 1 ];

    int i, j, l, r, n, k, q;

public:
    admissible_t() : n( read() ), k( read() ), q( read() )
    {
        for( i = 0; i < n; i++ ) a[ read() ]++, a[ read() + 1 ]--;

        for( i = 0, j = 1; j <= max_temperature; i = j++ ) a[ j ] += a[ i ];

        for( j = 1; j <= max_temperature; j++ ) if ( a[ j ] >= k ) b[ j ]++;

        for( i = 0, j = 1; j <= max_temperature; i = j++ ) b[ j ] += b[ i ];
    }

    void answer_queries()
    {
        for( i = 0; i < q; i++, putchar('\n') )
            l = read(), r = read(), write( b[ r ] - b[ l - 1 ] );
    }

} admissible;

int main()
{
    admissible.answer_queries();
}


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

int main()
{
    ios_base::sync_with_stdio(false);

     ll li,ri,d,n,mini,maxi,k,q,i,j,len=0,f=0,ans=0;
     ll c[200005]={0};

    cin>>n>>d>>q;

    cin>>li>>ri;
    mini=li;
    maxi=ri;
    c[li]++;
    c[ri+1]--;

    for(i=0;i<n-1;i++)
    {
        cin>>li>>ri;
        mini=min(mini,li);

        maxi=max(maxi,ri);

        c[li]++;
        c[ri+1]--;

    }

    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=mini;k<=maxi+1;k++)
    {

        if(c[k]>=d)
        {
            c[k]=1;
        }
        else
        {
            c[k]=0;
        }

    }
/*sdfgsgsgsgs*/
    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=0;k<q;k++)
    {
        cin>>li>>ri;

        ans=c[ri]-c[li-1];
        cout<<ans<<endl;

    }

}


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

int main()
{
    ios_base::sync_with_stdio(false);

     ll li,ri,d,n,mini,maxi,k,q,i,j,len=0,f=0,ans=0;
     ll c[200005]={0};

    cin>>n>>d>>q;

    cin>>li>>ri;
    mini=li;
    maxi=ri;
    c[li]++;
    c[ri+1]--;

    for(i=0;i<n-1;i++)
    {
        cin>>li>>ri;
        mini=min(mini,li);

        maxi=max(maxi,ri);

        c[li]++;
        c[ri+1]--;

    }

    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=0;k<q;k++)
    {
        cin>>li>>ri;
        ans=0;
        for(i=li;i<=ri;i++)
        {
            if(c[i]>=d)
            {
          //      cout<<" i: "<<i<<" "<<c[i]<<endl;
                ans++;
            }
        }
         cout<<ans;
    }


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

int main()
{
    ios_base::sync_with_stdio(false);

     ll li,ri,d,n,mini,maxi,k,q,i,j,len=0,f=0,ans=0;
     ll c[200005]={0};

    cin>>n>>d>>q;

    cin>>li>>ri;
    mini=li;
    maxi=ri;
    c[li]++;
    c[ri+1]--;

    for(i=0;i<n-1;i++)
    {
        cin>>li>>ri;
        mini=min(mini,li);

        maxi=max(maxi,ri);

        c[li]++;
        c[ri+1]--;

    }

    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=mini;k<=maxi+1;k++)
    {

        if(c[k]>=d)
        {
            c[k]=1;
        }
        else
        {
            c[k]=0;
        }

    }

    for(k=0;k<=200005;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=0;k<q;k++)
    {
        cin>>li>>ri;

        ans=c[ri]-c[li-1];
        cout<<ans<<endl;

    }

}


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

int main()
{
    ios_base::sync_with_stdio(false);

     ll li,ri,d,n,mini,maxi,k,q,i,j,len=0,f=0,ans=0;
     ll c[200005]={0};

    cin>>n>>d>>q;

    cin>>li>>ri;
    mini=li;
    maxi=ri;
    c[li]++;
    c[ri+1]--;

    for(i=0;i<n-1;i++)
    {
        cin>>li>>ri;
        mini=min(mini,li);

        maxi=max(maxi,ri);

        c[li]++;
        c[ri+1]--;

    }

    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=mini;k<=maxi+1;k++)
    {

        if(c[k]>=d)
        {
            c[k]=1;
        }
        else
        {
            c[k]=0;
        }

    }

    for(k=0;k<=20000;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=0;k<q;k++)
    {
        cin>>li>>ri;

        ans=c[ri]-c[li-1];
        cout<<ans<<endl;

    }

}


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

int main()
{
    ios_base::sync_with_stdio(false);

     ll li,ri,d,n,mini,maxi,k,q,i,j,len=0,f=0,ans=0;
     ll c[200005]={0};

    cin>>n>>d>>q;

    cin>>li>>ri;
    mini=li;
    maxi=ri;
    c[li]++;
    c[ri+1]--;

    for(i=0;i<n-1;i++)
    {
        cin>>li>>ri;
        mini=min(mini,li);

        maxi=max(maxi,ri);

        c[li]++;
        c[ri+1]--;

    }

    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=0;k<q;k++)
    {
        cin>>li>>ri;
        ans=0;
        for(i=li;i<=ri;i++)
        {
            if(c[i]>=d)
            {

                ans++;
            }
        }
         cout<<ans<<endl;
    }

return 0;

}


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

int main()
{
    ios_base::sync_with_stdio(false);

     ll li,ri,d,n,mini,maxi,k,q,i,j,len=0,f=0,ans=0;
     ll c[200005]={0};

    cin>>n>>d>>q;

    cin>>li>>ri;
    mini=li;
    maxi=ri;
    c[li]++;
    c[ri+1]--;

    for(i=0;i<n-1;i++)
    {
        cin>>li>>ri;
        mini=min(mini,li);

        maxi=max(maxi,ri);

        c[li]++;
        c[ri+1]--;

    }

    for(k=mini;k<=maxi+1;k++)
    {
        c[k]=c[k]+c[k-1];
    }

    for(k=0;k<q;k++)
    {
        cin>>li>>ri;
        ans=0;
        for(i=li;i<=ri;i++)
        {
            if(c[i]>=d)
            {
          //      cout<<" i: "<<i<<" "<<c[i]<<endl;
                ans++;
            }
        }
         cout<<ans<<endl;
    }


#include <iostream>
using namespace std;

#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))

int n, k, q, i;
int arr[200001];

int main(){
    std::ios::sync_with_stdio(false);
    cin>>n>>k>>q;
    for(i=0; i<n; i++){
        int x, y;
        cin>>x>>y;
        arr[x]++;
        arr[y+1]--;
    }
    int yes = 0;
    for(i=0; i<200001; i++){
        yes += arr[i];
        if(yes >= k)
            arr[i] = 1;
        else
            arr[i] = 0;
    }
    for(i=1; i<200001; i++)
        arr[i]+=arr[i-1];
    for(i=0; i<q; i++){
        int x, y;
        cin>>x>>y;
        cout<<(arr[y] - arr[x-1])<<"\n";
    }
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define N 200000

int main(){
	std::ios::sync_with_stdio(false);
	int n, k, q;
	cin>>n>>k>>q;
	int arr[N+1] = {0}, i, x, y;
	for(i=0; i<n; i++){
		cin>>x>>y;
		arr[x]++;
		arr[y+1]--;
	}
	int yes = 0;
	for(i=0; i<=N; i++){
		yes += arr[i];
		if(arr[i] >= k){
			arr[i] = 1;
		}
		else{
			arr[i] = 0;
		}
	}
	for(i=1; i<N; i++){
		arr[i] +=arr[i-1];
	}
	for(i=0; i<q; i++){
		cin>>x>>y;
		cout<<(arr[y] - arr[x-1])<<"\n";
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define N 200000

int main(){
	std::ios::sync_with_stdio(false);
	int n, k, q;
	cin>>n>>k>>q;
	int arr[N+1], i, x, y;
	for(i=0; i<n; i++){
		cin>>x>>y;
		arr[x]++;
		arr[y+1]--;
	}
	int yes = 0;
	for(i=1; i<=N; i++){
		arr[i] += arr[i-1];
		if(arr[i-1] >= k){
			arr[i-1] = 1;
		}
		else{
			arr[i-1] = 0;
		}
	}
	for(i=1; i<N; i++){
		arr[i] +=arr[i-1];
	}
	for(i=0; i<q; i++){
		cin>>x>>y;
		cout<<(arr[y] - arr[x-1])<<"\n";
	}
	return 0;
}


#include <iostream>
using namespace std;

#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))

int n, k, q;
int arr[200001];

int main(){
    std::ios::sync_with_stdio(false);
    cin>>n>>k>>q;
    for(i=0; i<n; i++){
        int x, y;
        cin>>x>>y;
        arr[x]++;
        arr[y+1]--;
    }
    int yes = 0;
    for(i=0; i<200001; i++){
        yes += a[i];
        if(yes >= k)
            arr[i] = 1;
        else
            arr[i] = 0;
    }
    for(i=1; i<200001; i++)
        arr[i]+=arr[i-1];
    for(i=0; i<q; i++){
        int x, y;
        cin>>x>>y;
        cout<<(arr[y] - arr[x-1])<<"\n";
    }
}


#include <iostream>
using namespace std;

int main(){
    std::ios::sync_with_stdio(false);
    int n, k, q, i, x, y, yes = 0;
    int arr[200001] = {0};
    cin>>n>>k>>q;
    for(i=0; i<n; i++){
        int x, y;
        cin>>x>>y;
        arr[x]++;
        arr[y+1]--;
    }
    for(i=0; i<200001; i++){
        yes += arr[i];
        if(yes >= k)
            arr[i] = 1;
        else
            arr[i] = 0;
    }
    for(i=1; i<200001; i++)
        arr[i]+=arr[i-1];
    for(i=0; i<q; i++){
        int x, y;
        cin>>x>>y;
        cout<<(arr[y] - arr[x-1])<<"\n";
    }
}


#include <iostream>
using namespace std;

#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))

int main(){
    std::ios::sync_with_stdio(false);
    int n, k, q, i, x, y;
    int arr[200001];
    cin>>n>>k>>q;
    for(i=0; i<n; i++){
        cin>>x>>y;
        arr[x]++;
        arr[y+1]--;
    }
    int yes = 0;
    for(i=0; i<200001; i++){
        yes += a[i];
        if(yes >= k)
            arr[i] = 1;
        else
            arr[i] = 0;
    }
    for(i=1; i<200001; i++)
        arr[i]+=arr[i-1];
    for(i=0; i<q; i++){
        int x, y;
        cin>>x>>y;
        cout<<(arr[y] - arr[x-1])<<"\n";
    }
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define N 200000

int main(){
	std::ios::sync_with_stdio(false);
	int n, k, q;
	cin>>n>>k>>q;
	int arr[N] = {0}, i, x, y;
	for(i=0; i<n; i++){
		cin>>x>>y;
		arr[x]++;
		arr[y+1]--;
	}
	int yes = 0;
	for(i=0; i<N; i++){
		yes += arr[i];
		if(yes >= k){
			arr[i] = 1;
		}
		else{
			arr[i] = 0;
		}
	}
	for(i=1; i<N; i++){
		arr[i] +=arr[i-1];
	}
	for(i=0; i<q; i++){
		cin>>x>>y;
		cout<<(arr[y] - arr[x-1])<<"\n";
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define N 200000

int main(){
	std::ios::sync_with_stdio(false);
	int n, k, q;
	cin>>n>>k>>q;
	int arr[N+1] = {0}, i, x, y;
	for(i=0; i<n; i++){
		cin>>x>>y;
		arr[x]++;
		arr[y+1]--;
	}
	int yes = 0;
	for(i=0; i<=N; i++){
		yes += arr[i];
		if(yes >= k){
			arr[i] = 1;
		}
		else{
			arr[i] = 0;
		}
	}
	for(i=1; i<N; i++){
		arr[i] +=arr[i-1];
	}
	for(i=0; i<q; i++){
		cin>>x>>y;
		cout<<(arr[y] - arr[x-1])<<"\n";
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200002];
int main()
{
	int n,k,q,t1,t2;
	vector<int>v;
	vector<int>v2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(t1);
		v2.push_back(t2);
	}
	sort(v.begin(), v.end());
	sort(v2.begin(), v2.end());
	int open = 0,s=0,e=0;
	for (int i = *(v.begin()); i < 200002; ++i)
	{
		while (s<n&&i == v[s])
		{
			++open;
			++s;
		}
		while (e<n&&i > v2[e])
		{
			--open;
			++e;
		}
		if (open == 0&&s<n)
		{
			i = v[s] < v2[e]?v[s]-1:v[e]-1 ;
		}
		else if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200002];
int main()
{
	int n,k,q,t1,t2;
	vector<int>v;
	vector<int>v2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(t1);
		v2.push_back(t2);
	}
	sort(v.begin(), v.end());
	sort(v2.begin(), v2.end());
	int open = 0,s=0,e=0;
	for (int i = *(v.begin()); i < 200002; ++i)
	{
		while (s<n&&i == v[s])
		{
			++open;
			++s;
		}
		while (e<n&&i > v2[e])
		{
			--open;
			++e;
		}
		if (open == 0&&s<n)
		{
			i = v[s];
		}
		if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200002];
int main()
{
	int n,k,q,t1,t2;
	vector<int>v;
	vector<int>v2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(t1);
		v2.push_back(t2);
	}
	sort(v.begin(), v.end());
	sort(v2.begin(), v2.end());
	int open = 0,s=0,e=0;
	for (int i = *(v.begin()); i < 200002; ++i)
	{
		while (s<n&&i == v[s])
		{
			++open;
			++s;
		}
		while (e<n&&i > v2[e])
		{
			--open;
			++e;
		}
		if (open == 0&&s<n)
		{
			i = v[s] - 1;
		}
		{
		if (open >= k)
			rec[i] = rec[i - 1] + 1;

		else
			rec[i] = rec[i - 1];

		}
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200002];
int main()
{
	int n,k,q,t1,t2;
	vector<int>v;
	vector<int>v2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(t1);
		v2.push_back(t2);
	}
	sort(v.begin(), v.end());
	sort(v2.begin(), v2.end());
	int open = 0,s=0,e=0;
	for (int i = *(v.begin()); i < 200002; ++i)
	{
		while (s<n&&i == v[s])
		{
			++open;
			++s;
		}
		while (e<n&&i > v2[e])
		{
			--open;
			++e;
		}
	/*	if (open == 0&&s<n)
		{
			i = v[s]-1;
		}
		else*/ if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
bool ad[200001];
int rec[200001];
int main()
{
	int n,k,q,t1,t2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		for (int x = t1; x <= t2; ++x)
		{
			++rec[x];
			if (rec[x] >= k)
				ad[x] = 1;
		}
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		int num=0;
		for (int x = t1; x <= t2; ++x)
		{
			if (ad[x])
				++num;
		}
		printf("%d\n", num);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200002];
int main()
{
	int n,k,q,t1,t2;
	vector<int>v;
	vector<int>v2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(t1);
		v2.push_back(t2);
	}
	sort(v.begin(), v.end());
	sort(v2.begin(), v2.end());
	int open = 0,s=0,e=0;
	for (int i = *(v.begin()); i < 200002; ++i)
	{
		while (s<n&&i == v[s])
		{
			++open;
			++s;
		}
		while (e<n&&i > v2[e])
		{
			--open;
			++e;
		}
		if (open == 0&&s<n)
		{
			i = v[s]-1;
		}
		else if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200001];
int main()
{
	int n,k,q,t1,t2;
	vector<int>v;
	vector<int>v2;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(t1);
		v2.push_back(t2);
	}
	sort(v.begin(), v.end());
	sort(v2.begin(), v2.end());
	int open = 0,s=0,e=0;
	for (int i = *(v.begin()); i < 200001; ++i)
	{
		while (s<n&&i == v[s])
		{
			++open;
			++s;
		}
		while (e<n&&i > v2[e])
		{
			--open;
			++e;
		}
		if (open == 0&&s<n)
		{
			i = v[s];
		}
		if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200001];
int main()
{
	int n,k,q,t1,t2;
	vector<vector<int>>v;
	vector<int>vt;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		for (int x = t1; x <= t2; ++x)
		{
			++rec[x];
		}
	}
	for (int i = 0; i < 200001; ++i)
	{
		if (rec[i] >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1] ;
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200001];
int main()
{
	int n,k,q,t1,t2;
	vector<pair<int,int>>v;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(make_pair(t1, t2));
	}
	sort(v.begin(), v.end());
	int open = 0,s=0,e=0;
	for (int i = (*(v.begin())).first; i < 200001; ++i)
	{

		while (s<n&&i == v[s].first)
		{
			++open;
			++s;
		}
		while (e<n&&i > v[e].second)
		{
			--open;
			++e;
		}
		if (open == 0&&s<n)
		{
			i = v[s].first;
		}
		if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200001];
int main()
{
	int n,k,q,t1,t2;
	vector<pair<int,int>>v;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(make_pair(t1, t2));
	}
	sort(v.begin(), v.end());
	int open = 0,s=0,e=0;
	for (int i = 1; i < 200001; ++i)
	{
		while (s<n&&i == v[s].first)
		{
			++open;
			++s;
		}
		while (e<n&&i > v[e].second)
		{
			--open;
			++e;
		}
		if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<sstream>
using namespace std;
int rec[200001];
int main()
{
	int n,k,q,t1,t2;
	vector<pair<int,int>>v;
	scanf("%d %d %d", &n, &k, &q);
	for (int i = 0; i < n; ++i)
	{
		scanf("%d %d", &t1, &t2);
		v.push_back(make_pair(t1, t2));
	}
	sort(v.begin(), v.end());
	int open = 0,s=0,e=0;
	for (int i = 1; i < 200001; ++i)
	{
		while (s<=n&&i == v[s].first)
		{
			++open;
			++s;
		}
		while (e<=n&&i > v[e].second)
		{
			--open;
			++e;
		}
		if (open >= k)
			rec[i] = rec[i - 1] + 1;
		else
			rec[i] = rec[i - 1];
	}
	for (int i = 0; i < q; ++i)
	{
		scanf("%d %d", &t1, &t2);
		printf("%d\n", rec[t2]-rec[t1-1]);
	}
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){

   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
scanf("%d %d",&a,&b);
 int sum=0 ;
 for(int i=0;i<v.size();i++){
   if(v[i]>=a&&v[i]<=b)sum++ ;
 }

 cout<<sum<<endl ;
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;

int main(){
   // cin.tie(0) ;
    //cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;
  //cout<<x[i]<<endl ;
 }

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 for(int i=a;i<=b;i++){
    if(x[i]>=k)sum++ ;
 }
 cout<<sum<<endl ;
}

}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 int pos1 =0 ;
 int pos2=0 ;
 for(int i=0;i<v.size();i++){
    if(v[i]==a){
        pos1 =i ;
        break ;
    }
    if(v[i]>a){
        pos1=i ;
        break ;
    }}
    for(int i=v.size()-1;i>=0;i--){
    if(v[i]==b){
        pos2 =i ;
        break ;
    }
    if(v[i]<b){
        pos2=i ;
        break ;
    }
 }
 cout<<pos2-pos1+1<<endl ;
 }
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;
  //cout<<x[i]<<endl ;
 }

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 for(int i=a;i<=b;i++){
    if(x[i]>=k)sum++ ;
 }
 cout<<sum<<endl ;
}

}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 int pos1 =0 ;
 int pos2=0 ;
 for(int i=0;i<v.size();i++){
    if(v[i]>=a){
        pos1=i ;
        break ;
    }}
    for(int i=v.size()-1;i>=0;i--){
    if(v[i]<=b){
        pos2=i ;
        break ;
    }
 }
 if(pos1==0&&pos2==0||pos1==0){
    cout<<0<<endl ;
    continue ;
 }
 cout<<pos2-pos1+1<<endl ;
 }
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 int pos1 =0 ;
 int pos2=0 ;
 for(int i=0;i<v.size();i++){
    if(v[i]>=a){
        pos1=i ;
        break ;
    }}
    for(int i=v.size()-1;i>=0;i--){
    if(v[i]<=b){
        pos2=i ;
        break ;
    }
 }
 cout<<pos2-pos1+1<<endl ;
 }
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
scanf("%d %d",&a,&b);
 int sum=0 ;
 for(int i=0;i<v.size();i++){
   if(v[i]>=a&&v[i]<=b)sum++ ;
 }

 cout<<sum<<endl ;
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}}


#include<bits/stdc++.h>
using namespace std  ;
int n  ,k , q ;
int x[1000000] ;
int sum[1000000];
int main(){
	#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
	#endif
	cin.tie(0) ;
	cin.sync_with_stdio(0) ;
	cin>>n>>k>>q ;
	for(int i=0;i<n;++i){
		int a ,b;
		cin>>a>>b;
		x[a]++ ; x[b+1]-- ;
	}
	for(int i=1;i<sizeof(x)/sizeof(x[0]);++i){
	x[i]+=x[i-1] ;
	}
	for(int i=1;i<sizeof(x)/sizeof(x[0]);++i){
		if(x[i]>=k)sum[i]=sum[i-1]+1 ; else sum[i]= sum[i-1] ;
	}

	for(int  i=0;i<q;++i){
		int a,b  ;
		cin>>a>>b;
		 cout<<sum[b]-sum[a-1] <<"\n" ;
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 int pos1 =0 ;
 int pos2=0 ;
 for(int i=0;i<v.size();i++){
    if(v[i]>=a){
        pos1=i ;
        break ;
    }}
    for(int i=v.size()-1;i>=0;i--){
    if(v[i]<=b){
        pos2=i ;
        break ;
    }
 }
 if(pos1==0&&pos2==0||pos2==0){
    cout<<0<<endl ;
    continue ;
 }
 cout<<pos2-pos1+1<<endl ;
 }
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 int pos1 =0 ;
 int pos2=0 ;
 for(int i=0;i<v.size();i++){
    if(v[i]>=a){
        pos1=i ;
        break ;
    }}
    for(int i=v.size()-1;i>=0;i--){
    if(v[i]<=b){
        pos2=i ;
        break ;
    }
 }
 cout<<pos2-pos1+1<<endl ;
 }
 for(int i=0;i<v.size();i++){
    cout<<v[i] <<endl;
 }
}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 for(int i=0;i<v.size();i++){
   if(v[i]>=a&&v[i]<=b)sum++ ;
 }

 cout<<sum<<endl ;
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}}


#include<bits/stdc++.h>
using namespace std;
int x[200000+9]  ;
vector <int>v;

int main(){
    cin.tie(0) ;
    cin.sync_with_stdio(0) ;
   int n ,k,q ;
    cin>>n>>k>>q;
 for(int i=0;i<n; i++){
    int a ,b ;
    cin>>a>>b;
    x[a]+=1 ;
    x[b+1]-=1 ;
 }
 for(int i=1;i<200000+9;i++){
        x[i]+=x[i-1] ;

 }
for(int i =0;i<200000+9;i++){
    if(x[i]>=k)v.push_back(i) ;
}
sort(v.begin(),v.end()) ;

for(int i=0;i<q;i++){
 int a, b ;
 cin>>a>>b ;
 int sum=0 ;
 int pos1 =0 ;
 int pos2=0 ;
 for(int i=0;i<v.size();i++){
    if(v[i]>=a){
        pos1=i ;
        break ;
    }}
    for(int i=v.size()-1;i>=0;i--){
    if(v[i]<=b){
        pos2=i ;
        break ;
    }
 }
 if(pos1==0&&pos2==0){
    cout<<0<<endl ;
    continue ;
 }
 cout<<pos2-pos1+1<<endl ;
 }
// for(int i=0;i<v.size();i++){
//    cout<<v[i] <<endl;
// }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr first
#define sc second
const int maxn = 60010 ;
pair<double,double> a[maxn] = {} ;
int n = 0 ;

bool check(double t)
{
    double l = a[1].fr-a[1].sc*t , r = a[1].fr + a[1].sc*t ;
    for(int i = 1 ;i<=n ;i++)
    {
        l = max(l,a[i].fr - a[i].sc*t) ;
        r = min(r , a[i].fr + a[i].sc*t) ;
    }

    return l<=r ;
}

double bin()
{
    double l = 0 , r = a[n].fr ;

    while(abs(r-l)>pow(10,-9))
    {
        double m = (r+l)/2 ;

        //cout<<l<<" "<<r<<endl ;
        if(!check(m)) l = m ;
        else r = m ;
    }

    return r ;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("input.txt","r", stdin);
    //freopen("output.txt","w",stdout);

    cin>>n ;

    for(int i = 1 ;i<=n ;i++) cin>>a[i].fr ;

    for(int i = 1;i<=n ;i++) cin>>a[i].sc ;

    printf("%.9f\n",bin()) ;
}


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

const int N = 6e5 + 23;

array<int, N> x, v;

const double eps = 1e-7;

inline double myround(double x) {
    return round(x * 1e7) / 1e7;
}

double chk(double p, int n) {
    double ans = 0;
    for (int i = 0; i < n; ++i) {
        double cur = fabs((double)x[i] - p) / v[i];
        ans = max(ans, cur);
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> x[i];
    for (int i = 0; i < n; ++i) cin >> v[i];

    double le = 1, r = 1e9;
    while (myround(le) + eps < myround(r)) {
        double m = myround((le + r) / 2);
        if (chk(m, n) > chk(m + eps, n)) le = m + eps;
        else r = m;
    }

    auto ans = min(chk(le, n), chk(r, n));

    cout << setprecision(9) << fixed << ans << '\n';
}


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

const int N = 6e5 + 23;

array<int, N> x, v;

bool chk(double p, int n) {
    double up = DBL_MAX, dwn = DBL_MIN;
    for (int i = 0; i < n; ++i) {
        up = min(up, x[i] + v[i]*p);
        dwn = max(dwn, x[i] - v[i]*p);
    }
    return dwn <= up;
}

int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> x[i];
    for (int i = 0; i < n; ++i) cin >> v[i];

    double le = 0, r = 1e9;
    for (int i = 0; i < 60; ++i) {
        double m = (le + r) / 2;
        if (chk(m, n)) r = m;
        else le = m;
    }

    cout << setprecision(9) << fixed << le << '\n';
}


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

const int N = 6e5 + 23;

array<int, N> x, v;

const double eps = 1e-6;

inline double myround(double x) {
    return round(x * 1e6) / 1e6;
}

double chk(double p, int n) {
    double ans = 0;
    for (int i = 0; i < n; ++i) {
        double cur = fabs((double)x[i] - p) / v[i];
        ans = max(ans, cur);
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> x[i];
    for (int i = 0; i < n; ++i) cin >> v[i];

    double le = 1, r = 1e9;
    while (myround(le) + eps < myround(r)) {
        double m = myround((le + r) / 2);
        if (chk(m, n) > chk(m + eps, n)) le = m + eps;
        else r = m;
    }

    auto ans = min(chk(le, n), chk(r, n));

    cout << setprecision(9) << fixed << ans << '\n';
}


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

const int N = 6e5 + 23;

array<int, N> x, v;

const double eps = 1e-9;

inline double myround(double x) {
    return round(x * 1e9) / 1e9;
}

double chk(double p, int n) {
    double ans = 0;
    for (int i = 0; i < n; ++i) {
        double cur = fabs((double)x[i] - p) / v[i];
        ans = max(ans, cur);
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> x[i];
    for (int i = 0; i < n; ++i) cin >> v[i];

    double le = 1, r = 1e9;
    while (myround(le) + eps < myround(r)) {
        double m = myround((le + r) / 2);
        if (chk(m, n) > chk(m + eps, n)) le = m + eps;
        else r = m;
    }

    auto ans = min(chk(le, n), chk(r, n));

    cout << setprecision(9) << fixed << ans << '\n';
}


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

const int N = 6e5 + 23;
const double eps = 1e-7;

array<int, N> x, v;

bool chk(double p, int n) {
    double up = DBL_MAX, dwn = DBL_MIN;
    for (int i = 0; i < n; ++i) {
        up = min(up, x[i] + v[i]*p);
        dwn = max(dwn, x[i] - v[i]*p);
    }
    return dwn <= up;
}

int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> x[i];
    for (int i = 0; i < n; ++i) cin >> v[i];

    double le = 0, r = 1e9;
    for (int i = 0; i < 100; ++i) {
        double m = (le + r) / 2;
        if (chk(m, n)) r = m;
        else le = m + eps;
    }

    cout << setprecision(9) << fixed << le << '\n';
}


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

const int N = 6e5 + 23;
const double eps = 1e-7;

array<int, N> x, v;

bool chk(double p, int n) {
    double up = DBL_MAX, dwn = DBL_MIN;
    for (int i = 0; i < n; ++i) {
        up = min(up, x[i] + v[i]*p);
        dwn = max(dwn, x[i] - v[i]*p);
    }
    return dwn <= up;
}

int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> x[i];
    for (int i = 0; i < n; ++i) cin >> v[i];

    double le = 0, r = 1e9;
    for (int i = 0; i < 60; ++i) {
        double m = (le + r) / 2;
        if (chk(m, n)) r = m;
        else le = m + eps;
    }

    cout << setprecision(9) << fixed << le << '\n';
}


// youngjinp20
// 2019 11

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

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
typedef vector<vi> vvi;

int main() {
	int n;
	int x[60000];
	int v[60000];
	cin >> n;
	for (int i=0; i<n; i++) cin >> x[i];
	for (int i=0; i<n; i++) cin >> v[i];

	double cur = 1e9/2;
	double change = 1e9/2;
	double best = 0;
	for (int i=0; i<n; i++) {
		best += abs((x[i] - cur) / v[i]);
	}

	while (change > 1e-10) {
		double loc, time;

		loc = cur + change;
		time = 0;
		for (int i=0; i<n; i++) {
			time = max(abs((x[i] - loc) / v[i]), time);
		}
		if (time < best) {
			best = time;
			cur = loc;
		}

		loc = cur - change;
		time = 0;
		for (int i=0; i<n; i++) {
			time = max(abs((x[i] - loc) / v[i]), time);
		}
		if (time < best) {
			best = time;
			cur = loc;
		}

		change /= 2;
	}

	cout << best;

	return 0;
}


// youngjinp20
// 2019 11

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

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
typedef vector<vi> vvi;

int main() {
	int n;
	int x[60000];
	int v[60000];
	cin >> n;
	for (int i=0; i<n; i++) cin >> x[i];
	for (int i=0; i<n; i++) cin >> v[i];

	double cur = 1e9/2;
	double change = 1e9/2;
	double best = 0;
	for (int i=0; i<n; i++) {
		best += abs((x[i] - cur) / v[i]);
	}

	while (change > 1e-7) {
		double loc, time;

		loc = cur + change;
		time = 0;
		for (int i=0; i<n; i++) {
			time = max(abs((x[i] - loc) / v[i]), time);
		}
		if (time < best) {
			best = time;
			cur = loc;
		}

		loc = cur - change;
		time = 0;
		for (int i=0; i<n; i++) {
			time = max(abs((x[i] - loc) / v[i]), time);
		}
		if (time < best) {
			best = time;
			cur = loc;
		}

		change /= 2;
	}

	cout << best;

	return 0;
}


// youngjinp20
// 2019 11

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

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi> vii;
typedef vector<vi> vvi;

int main() {
	int n;
	int x[60000];
	int v[60000];
	cin >> n;
	for (int i=0; i<n; i++) cin >> x[i];
	for (int i=0; i<n; i++) cin >> v[i];

	double cur = 1e9/2;
	double change = 1e9/2;
	double best = 0;
	for (int i=0; i<n; i++) {
		best += abs((x[i] - cur) / v[i]);
	}

	while (change > 1e-10) {
		double loc, time;

		loc = cur + change;
		time = 0;
		for (int i=0; i<n; i++) {
			time = max(abs((x[i] - loc) / v[i]), time);
		}
		if (time < best) {
			best = time;
			cur = loc;
		}

		loc = cur - change;
		time = 0;
		for (int i=0; i<n; i++) {
			time = max(abs((x[i] - loc) / v[i]), time);
		}
		if (time < best) {
			best = time;
			cur = loc;
		}

		change /= 2;
	}

	printf("%lf", best);

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.000000001)
    {mini=1000000000000000.0;
maxi=0.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
{
    maxi=max(a[i]-mid*b[i],maxi);
    mini=min(a[i]+mid*b[i],mini);
}

    if(mini>=maxi)
    {

        r=mid;
    }
    else
    l=mid;

    }
    mid=l;
     mini=1000000000000000.0;
maxi=0.0;

        for(i=0;i<n;i++)
{
    maxi=max(a[i]-mid*b[i],maxi);
    mini=min(a[i]+mid*b[i],mini);
}
    if(mini>=maxi)
    cout<<r;
    else
    cout<<l;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.0000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.0000001;
    }
    else
    l=mid+0.00000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.0000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {

        r=mid;
    }
    else
    l=mid;

    }
     for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    if(i==n)
    cout<<l;
    else
    cout<<r;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;
    while(l<r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini<c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    if(i==n)
    {
        ans=mid;
        r=mid;
    }
    else
    l=mid;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.000000001;
    }
    else
    l=mid+0.000000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini,maxi;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;
    while(l<r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini<c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*t)
        break;
    }
    if(i==n)
    {
        ans=mid;
        r=mid;
    }
    else
    l=mid;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.000000001)
    {mini=1000000000000000.0;
maxi=0.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
{
    maxi=max(a[i]-mid*b[i],maxi);
    mini=min(a[i]+mid*b[i],mini);
}

    if(mini>=maxi)
    {

        r=mid;
    }
    else
    l=mid;

    }
    mid=l;
     mini=1000000000000000.0;
maxi=0.0;

        for(i=0;i<n;i++)
{
    maxi=max(a[i]-mid*b[i],maxi);
    mini=min(a[i]+mid*b[i],mini);
}
    if(mini>=maxi)
    cout<<l;
    else
    cout<<r;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.0000000001;
    }
    else
    l=mid+0.0000000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.000000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {

        r=mid;
    }
    else
    l=mid;

    }
    mid=l;
     for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    if(i==n)
    cout<<l;
    else
    cout<<r;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans1=r,ans2=l;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans1=mid;
        r=mid-1;
    }
    else
    {ans2=mid;
        l=mid+1;
    }
    }
    double ans;
    l=ans2;
    r=ans1;
     while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.000000001;
    }
    else
    {
        l=mid+.000000001;
    }
    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.000000001;
    }
    else
    l=mid+0.000000001;

    }
 cout<<setprecision(20)<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(r-l>0.0000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid;
    }
    else
    l=mid;

    }
 cout<<setprecision(20)<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>=0.0000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {

        r=mid;
    }
    else
    l=mid;

    }
    mid=l;
     for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    if(i==n)
    cout<<l;
    else
    cout<<r;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.000001;
    }
    else
    l=mid+0.000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.0000000001;
    }
    else
    l=mid+0.0000000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;
    cout<<l<<" "<<r<<"\n";

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    cout<<mini<<"\n";
    if(i==n)
    {
        ans=mid;
        r=mid-0.000001;
    }
    else
    l=mid+0.000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.0000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {

        r=mid;
    }
    else
    l=mid;

    }
    mid=l;
     for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    if(i==n)
    cout<<l;
    else
    cout<<r;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.000001)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.0000001;
    }
    else
    l=mid+0.00000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.00000000001;
    }
    else
    l=mid+0.00000000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini,maxi;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;
    while(l<r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini<c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }
    if(i==n)
    {
        ans=mid;
        r=mid;
    }
    else
    l=mid;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.000000000001;
    }
    else
    l=mid+0.000000000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.00000001;
    }
    else
    l=mid+0.00000001;

    }
 cout<<setprecision(20)<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini+1;
    double mid,ans;

    while(r-l>0.000000001)
    {mini=1000000000000000.0;
maxi=0.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
{
    maxi=max(a[i]-mid*b[i],maxi);
    mini=min(a[i]+mid*b[i],mini);
}

    if(mini>=maxi)
    {

        r=mid;
    }
    else
    l=mid;

}
cout<<setprecision(20)<<r;

}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.00000000001;
    }
    else
    l=mid+0.00000000001;

    }
 cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
double a[100000];
double b[100000];

double c[100000];
int main()

{
    int n;
    cin>>n;
double mini=100000000000.0,maxi=0;
    int i,j;
for(i=0;i<n;i++)
{cin>>a[i];
maxi=max(maxi,a[i]);
mini=min(mini,a[i]);

}
double d=maxi-mini;
mini=10000000000.0;
for(i=0;i<n;i++)
{cin>>b[i];

    mini=min(b[i],mini);

}
int p;
    double l=0;
    double r=d/mini;
    double mid,ans;

    while(l<=r)
    {mini=1000000000000000.0;
        mid=(l+r)/2.0;
        for(i=0;i<n;i++)
        {
            c[i]=a[i]+mid*b[i];
        if(mini>c[i])
        {
            mini=c[i];
            p=i;
        }
        }
    for(i=0;i<n;i++)
    {
        if(a[i]<=mini)
        continue;
        if(a[i]-mini>b[i]*mid)
        break;
    }

    if(i==n)
    {
        ans=mid;
        r=mid-0.00000001;
    }
    else
    l=mid+0.00000001;

    }
 cout<<ans;
}


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

/*
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

// Declaring ordered_set
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;*/

#define ll long long int
#define ld long double
#define le length()
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mkp make_pair
#define ppl pair<ll,ll>
#define ppi pair<int,int>
#define ppli pair<ll,int>
#define ps push
#define mod 1000000007
#define fi first
#define se second
#define debug1(x) cout<<#x<<" = "<<x<<'\n';
#define debug2(x, y) cout << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define all(v) v.begin(),v.end()
#define mset(x) memset(x,0,sizeof(x))
#define sz size()

ll power(ll a,ll b)
{
    if(b==0)
    return 1;
    if(b==1)
    return a;
    ll r=power(a,b/2)%mod;
    if(b%2==0)
    return (r*r)%mod;
    else
    return (((r*r)%mod)*a)%mod;
}
#define pri 1000009
int prime[pri];
int sumprime[pri];
void sieve(int n)
{
    prime[0]=prime[1]=1;
    for(int i=2;i<=sqrt(n);i++)
    {
        if(!prime[i])
        {
            for(int j=2*i;j<=n;j=j+i)
            {
                prime[j]++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(!prime[i])
        {
            sumprime[i]=sumprime[i-1]+1;
        }
        else
        {
            sumprime[i]=sumprime[i-1];
        }
    }
}

bool comp(const pair<ll,ll> &a,
               const pair<ll,ll> &b)
{

    if(a.fi==b.fi)
    {
        return a.se>b.se;
    }
       return (a.fi < b.fi);

}

const int N=5*1e5+9;
int n;
ll x[N],v[N];
bool check(ld r)
{
    //ll b[n];
    vector< pair<ld,int> > vec;
    for(int i=0;i<n;i++)
    {
        vec.pb({x[i]-r*v[i],1});
        vec.pb({x[i]+r*v[i],-1});
    }
    sort(all(vec),comp);
    ll sum=0;
    for(auto it:vec)
    {
        sum+=it.se;
        if(sum==n)
        {
            return true;
        }
    }
    return false;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   // int n;
    cin>>n;
    cout<<setprecision(10)<<fixed;
    // ll x[n],v[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i];
    }
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }

    ld l=1,r=(ll)pow((ll)10,(ll)10);
    while(l<r)
    {
        ld mid=(l+r)/2.0;
        if(check(mid))
        {
            r=mid-0.0000001;
        }
        else
        {
            l=mid+0.0000001;
        }
    }
    cout<<l<<"\n";
    return 0;
}


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

/*
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

// Declaring ordered_set
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;*/

#define ll long long int
#define ld long double
#define le length()
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mkp make_pair
#define ppl pair<ll,ll>
#define ppi pair<int,int>
#define ppli pair<ll,int>
#define ps push
#define mod 1000000007
#define fi first
#define se second
#define debug1(x) cout<<#x<<" = "<<x<<'\n';
#define debug2(x, y) cout << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define all(v) v.begin(),v.end()
#define mset(x) memset(x,0,sizeof(x))
#define sz size()

ll power(ll a,ll b)
{
    if(b==0)
    return 1;
    if(b==1)
    return a;
    ll r=power(a,b/2)%mod;
    if(b%2==0)
    return (r*r)%mod;
    else
    return (((r*r)%mod)*a)%mod;
}
#define pri 1000009
int prime[pri];
int sumprime[pri];
void sieve(int n)
{
    prime[0]=prime[1]=1;
    for(int i=2;i<=sqrt(n);i++)
    {
        if(!prime[i])
        {
            for(int j=2*i;j<=n;j=j+i)
            {
                prime[j]++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(!prime[i])
        {
            sumprime[i]=sumprime[i-1]+1;
        }
        else
        {
            sumprime[i]=sumprime[i-1];
        }
    }
}

bool comp(const pair<ld,int> &a,
               const pair<ld,int> &b)
{

    if(a.fi==b.fi)
    {
        return a.se>b.se;
    }
       return (a.fi < b.fi);

}

const int N=5*1e5+9;
int n;
ld x[N],v[N];

bool check(ld r)
{
    vector<pair<ld,int> > vec;

    for(int i=0;i<n;i++)
    {
        vec.pb({x[i]-r*v[i],1});
        vec.pb({x[i]+r*v[i],-1});
    }
    sort(all(vec),comp);
    ll sum=0;
    for(auto it:vec)
    {
       // cout<<it.fi<<" ";
        sum+=it.se;
        if(sum==n)
        {
            return true;
        }

    }
    return false;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   // int n;
    cin>>n;
    cout<<setprecision(10)<<fixed;
    // ll x[n],v[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i];
    }
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }

    ld l=0,r=(ll)pow((ll)10,(ll)10);
    for(int _=1;_<200;_++)
    {
        if(l>=r)
            break;
        ld mid=(l+r)/2.0;
        if(check(mid))
        {
            r=mid;
        }
        else
        {
            l=mid+0.000000001;
        }
       // cout<<mid<<" ";
     //   cout<<l<<" ";
        //cout<<mid<<" ";
    }
    ll val=check(2);

    cout<<l<<"\n";
    return 0;
}


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

/*
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#include <functional> // for less
#include <iostream>
using namespace __gnu_pbds;
using namespace std;

// Declaring ordered_set
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;*/

#define ll long long int
#define ld long double
#define le length()
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mkp make_pair
#define ppl pair<ll,ll>
#define ppi pair<int,int>
#define ppli pair<ll,int>
#define ps push
#define mod 1000000007
#define fi first
#define se second
#define debug1(x) cout<<#x<<" = "<<x<<'\n';
#define debug2(x, y) cout << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define all(v) v.begin(),v.end()
#define mset(x) memset(x,0,sizeof(x))
#define sz size()

ll power(ll a,ll b)
{
    if(b==0)
    return 1;
    if(b==1)
    return a;
    ll r=power(a,b/2)%mod;
    if(b%2==0)
    return (r*r)%mod;
    else
    return (((r*r)%mod)*a)%mod;
}
#define pri 1000009
int prime[pri];
int sumprime[pri];
void sieve(int n)
{
    prime[0]=prime[1]=1;
    for(int i=2;i<=sqrt(n);i++)
    {
        if(!prime[i])
        {
            for(int j=2*i;j<=n;j=j+i)
            {
                prime[j]++;
            }
        }
    }
    for(int i=1;i<=n;i++)
    {
        if(!prime[i])
        {
            sumprime[i]=sumprime[i-1]+1;
        }
        else
        {
            sumprime[i]=sumprime[i-1];
        }
    }
}

bool comp(const pair<ld,int> &a,
               const pair<ld,int> &b)
{

    if(a.fi==b.fi)
    {
        return a.se>b.se;
    }
       return (a.fi < b.fi);

}

const int N=5*1e5+9;
int n;
ld x[N],v[N];

bool check(ld r)
{
    vector<pair<ld,int> > vec;

    for(int i=0;i<n;i++)
    {
        vec.pb({x[i]-r*v[i],1});
        vec.pb({x[i]+r*v[i],-1});
    }
    sort(all(vec),comp);
    ll sum=0;
    for(auto it:vec)
    {
       // cout<<it.fi<<" ";
        sum+=it.se;
        if(sum==n)
        {
            return true;
        }

    }
    return false;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
   // int n;
    cin>>n;
    cout<<setprecision(10)<<fixed;
    // ll x[n],v[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i];
    }
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }

    ld l=1,r=(ll)pow((ll)10,(ll)10);
    for(int _=1;_<200;_++)
    {
        if(l>=r)
            break;
        ld mid=(l+r)/2.0;
        if(check(mid))
        {
            r=mid;
        }
        else
        {
            l=mid+0.000000001;
        }
       // cout<<mid<<" ";
     //   cout<<l<<" ";
        //cout<<mid<<" ";
    }
    ll val=check(2);

    cout<<l<<"\n";
    return 0;
}


#include <bits/stdc++.h>
#define ld long double

using namespace std;

const int N = 6e4+5;
ld pos[N];
ld v[N];
int n;

ld solve(ld p)
{
	ld ret = 0;
	for(int i = 0 ; i < n ; i++)
	{
		ret = max(ret, abs(p - pos[i])/v[i]);
	}
	return ret;
}

int main()
{
	cin>>n;
	for(int i = 0 ; i <  n; i ++)cin>>pos[i];
	for(int i = 0 ; i <  n; i ++)cin>>v[i];

	ld s = 0, e = 1e9, mid1, mid2, ans1, ans2;
	while(e - s > 1e-7)
	{
		mid1 = s + (e - s)/3;
		mid2 = e - (e - s)/3;
		ans1 = solve(mid1);
		ans2 = solve(mid2);
		if(ans1 < ans2)
		{
			e = mid2;
		}
		else s = mid1;
	}
	cout << fixed << setprecision(6) << min(ans2, ans1);
	return 0;
}


#include <bits/stdc++.h>
#define ld long double

using namespace std;

const int N = 6e4+5;
ld pos[N];
ld v[N];
int n;

ld solve(ld p)
{
	ld time = 0;
	for(int i = 0 ; i < n ; i++)
	{
		time = max(time, abs(p - pos[i])/v[i]);
	}
	return time;
}

int main()
{
	cin>>n;
	for(int i = 0 ; i <  n; i ++)
        cin>>pos[i];
	for(int i = 0 ; i <  n; i ++)
        cin>>v[i];
	ld s = 0, e = 1e9, mid1, mid2, ans1, ans2;
	while(e - s > 1e-7)
	{
		mid1 = s + (e - s)/3;
		mid2 = e - (e - s)/3;
		ans1 = solve(mid1);
		ans2 = solve(mid2);
		if(ans1 < ans2)
			e = mid2;
		else
            s = mid1;
	}
	cout << fixed << setprecision(6) << min(ans2, ans1);
	return 0;
}


#include <bits/stdc++.h>
#define ld long double

using namespace std;

const int N = 6e4+5;
ld pos[N];
ld v[N];
int n;

ld solve(ld p)
{
	ld time = 0;
	for(int i = 0 ; i < n ; i++)
	{
		time = max(ret, abs(p - pos[i])/v[i]);
	}
	return time;
}

int main()
{
	cin>>n;
	for(int i = 0 ; i <  n; i ++)
	cin>>pos[i];
	for(int i = 0 ; i <  n; i ++)
	cin>>v[i];
	ld s = 0, e = 1e9, mid1, mid2, ans1, ans2;
	while(e - s > 1e-7)
	{
		mid1 = s + (e - s)/3;
		mid2 = e - (e - s)/3;
		ans1 = solve(mid1);
		ans2 = solve(mid2);
		if(ans1 < ans2)
			e = mid2;
		else
		    s = mid1;
	}
	cout << fixed << setprecision(6) << min(ans2, ans1);
	return 0;
}


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

int main() {
    cout.sync_with_stdio(0);
    cin.tie(0);
    int n; cin >> n;
    double x[n];
    double v[n];

    double l = 1e9+5, r = 0, mid;
    for (int i = 0; i < n; i++){
        cin >> x[i];
        l = min(l,x[i]);
        r = max(r,x[i]);
    }
    for (int i = 0; i < n; i++){
        cin >> v[i];
    }

    double last = -1e9+5;

    double dl = 0, dr = 0;
    for (int i = 0; i < n; i++) {
        dl = max(dl, abs(x[i] - l) / v[i]);
        dr = max(dr, abs(x[i] - r) / v[i]);
    }

    int cnt = 500;
    while (cnt--) {
        mid = (l + r)/2;
        double dist = 0;
        for (int i = 0; i < n; i++) dist = max(dist, abs(x[i] - mid) / v[i]);

        last = dist;

        if (dl < dr) {
            r = mid;
            dr = dist;
        } else {
            l = mid;
            dl = dist;
        }
    }

    cout << last << endl;

}


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

int main() {
    cout.sync_with_stdio(0);
    cin.tie(0);
    int n; cin >> n;
    double x[n];
    double v[n];

    double l = 1e9+5, r = 0, mid;
    for (int i = 0; i < n; i++){
        cin >> x[i];
        l = min(l,x[i]);
        r = max(r,x[i]);
    }
    for (int i = 0; i < n; i++){
        cin >> v[i];
    }

    double last = -1e9+5;

    double tl = 0, tr = 0;
    for (int i = 0; i < n; i++) {
        tl = max(tl, abs(x[i] - l) / v[i]);
        tr = max(tr, abs(x[i] - r) / v[i]);
    }

    int cnt = 500;
    while (cnt--) {
        mid = (l + r)/2;
        double delta = (r-l)/3;
        double m1 = l + delta;
        double m2 = r - delta;
        double tempo1 = 0, tempo2 = 0;
        for (int i = 0; i < n; i++) tempo1 = max(tempo1, abs(x[i] - m1) / v[i]);
        for (int i = 0; i < n; i++) tempo2 = max(tempo2, abs(x[i] - m2) / v[i]);

        last = min(tempo1, tempo2);
        if(tempo1 < tempo2)
            r = m2;
        else
            l = m1;

    }
    cout << setprecision(9) << last << endl;

}


#include <iostream>
#include <bits/stdc++.h>
#include <fstream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#define ll long long
#define pb push_back
#define pf push_front
#define INF 1e15
#define C 101

using namespace std;
 int n;
 double x[60001],v[60001];
bool possible(double m){
      double l = -1e9, r = 1e9;
      for(int i=0; i<n; i++){
            l = max(l, x[i]-m*v[i]);
            r = min(r, x[i]+m*v[i]);
      }
      return l<=r;
}
void solve(){
  cin>>n;
  for(int i=0; i<n; i++) cin>>x[i];
  for(int i=0; i<n; i++) cin>>v[i];
  long double l=0,r=1e9; long double m;
  int count=100;
  while(count--){
      m = l+r; m/=2;
      //cout<<possible(m)<<endl;
      if(possible(m)) r=m;
      else l=m;
  }
  cout<<setprecision(15)<<m<<endl;

}

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

//	freopen("input.txt","r",stdin);
	int t=1; //cin>>t;
	while(t--){
		solve();
	}
return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <fstream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#define ll long long
#define pb push_back
#define pf push_front
#define INF 1e15
#define C 101

using namespace std;
 int n;
 double x[60001],v[60001];
bool possible(double m){
      double l = -1e9, r = 1e9;
      for(int i=0; i<n; i++){
            l = max(l, x[i]-m*v[i]);
            r = min(r, x[i]+m*v[i]);
      }
      return l<=r;
}
void solve(){
  cin>>n;
  for(int i=0; i<n; i++) cin>>x[i];
  for(int i=0; i<n; i++) cin>>v[i];
  long double l=0,r=1e9; long double m;
  int count=100;
  while(count--){
      m = l+r; m/=2;
      //cout<<possible(m)<<endl;
      if(possible(m)) r=m;
      else l=m;
  }
  cout<<setprecision(15)<<m<<endl;

}

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

	freopen("input.txt","r",stdin);
	int t=1; //cin>>t;
	while(t--){
		solve();
	}
return 0;
}


/*@shutoshsuman99*/
#include<bits/stdc++.h>
using namespace std;
#include<cstdio>
#define pi 3.141592653589
#define pb push_back
#define ld long double
#define rem 1000000007
#define rem1 998244353
#define inf 1e18+1e17
#define F first
#define S second
#define pii pair<long long,long long>
#define p_q priority_queue <ll, vector<ll>, greater<ll> >
#define m_sp multiset <pair <ll,ll> >
#define el "\n"
#define sp " "
typedef long long ll;
ll Pow(ll x,ll y,ll m)
{ if (y == 0) return 1; ll p = Pow(x, y/2, m) % m;
p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m; }
bool check(long double x, vector <long double> a, vector <long double> v)
{
	long double low=0,high=1e9;
	for(ll i=0;i<a.size();i++)
	{
		low = max(low,a[i]-x*v[i]);
		high = min(high,a[i]+x*v[i]);
	}
	if(high>=low)
	return true;
	return false;
}
main()
{
	// fast io
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);ll i,j=0;
	long double n;
	cin>>n;
	vector <long double> a(n),v(n);
	for(i=0;i<n;i++)
	cin>>a[i];
	for(i=0;i<n;i++)
	cin>>v[i];
	long double l=0, h=1e9,ans=0;
	for(ll cnt=0;cnt<100;cnt++)
	{
		long double mid = (long double)0.5*(l+h+0.0);
		if(check(mid, a, v))
		{
			ans=mid;
			h=mid;
		}
		else
		l=mid;
	}
	cout<<setprecision(10)<<ans<<el;
}


/*@shutoshsuman99*/
#include<bits/stdc++.h>
using namespace std;
#include<cstdio>
#define pi 3.141592653589
#define pb push_back
#define ld long double
#define rem 1000000007
#define rem1 998244353
#define inf 1e18+1e17
#define F first
#define S second
#define pii pair<long long,long long>
#define p_q priority_queue <ll, vector<ll>, greater<ll> >
#define m_sp multiset <pair <ll,ll> >
#define el "\n"
#define sp " "
typedef long long ll;
ll Pow(ll x,ll y,ll m)
{ if (y == 0) return 1; ll p = Pow(x, y/2, m) % m;
p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m; }
bool check(long double x, vector <long double> a, vector <long double> v)
{
	map <long double,ll> m;
	ll sum=0;
	for(ll i=0;i<a.size();i++)
	{
		m[a[i]-x*v[i]]++;
		m[a[i]+x*v[i]+1e-7]--;
	}
	for(auto i=m.begin();i!=m.end();i++)
	{
		sum+=i->second;
		if(sum==a.size())
		return true;
	}
	return false;
}
main()
{
	// fast io
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);ll i,j=0;
	long double n;
	cin>>n;
	vector <long double> a(n),v(n);
	for(i=0;i<n;i++)
	cin>>a[i];
	for(i=0;i<n;i++)
	cin>>v[i];
	long double l=0.0, h=1e9,ans=0;
	while(h-l>=1e-7)
	{
		long double mid = (long double)(l+h+0.0)/2.0;
		if(check(mid, a, v))
		{
			ans=mid;
			h=mid;
		}
		else
		l=mid;
	}
	cout<<ans<<el;
}


/*@shutoshsuman99*/
#include<bits/stdc++.h>
using namespace std;
#include<cstdio>
#define pi 3.141592653589
#define pb push_back
#define ld long double
#define rem 1000000007
#define rem1 998244353
#define inf 1e18+1e17
#define F first
#define S second
#define pii pair<long long,long long>
#define p_q priority_queue <ll, vector<ll>, greater<ll> >
#define m_sp multiset <pair <ll,ll> >
#define el "\n"
#define sp " "
typedef long long ll;
ll Pow(ll x,ll y,ll m)
{ if (y == 0) return 1; ll p = Pow(x, y/2, m) % m;
p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m; }
bool check(long double x, vector <long double> a, vector <long double> v)
{
	map <long double,ll> m;
	ll sum=0;
	for(ll i=0;i<a.size();i++)
	{
		m[a[i]-x*v[i]]++;
		m[a[i]+x*v[i]]--;
	}
	for(auto i=m.begin();i!=m.end();i++)
	{
		sum+=i->second;
		if(sum==a.size())
		return true;
	}
	return false;
}
main()
{
	// fast io
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);ll i,j=0;
	long double n;
	cin>>n;
	vector <long double> a(n),v(n);
	for(i=0;i<n;i++)
	cin>>a[i];
	for(i=0;i<n;i++)
	cin>>v[i];
	long double l=0.0, h=1e9,ans=0;
	for(ll cnt=0;cnt<300;cnt++)
	{
		long double mid = (long double)0.5*(l+h+0.0);
		if(check(mid, a, v))
		{
			ans=mid;
			h=mid;
		}
		else
		l=mid;
	}
	cout<<setprecision(10)<<ans<<el;
}


/*@shutoshsuman99*/
#include<bits/stdc++.h>
using namespace std;
#include<cstdio>
#define pi 3.141592653589
#define pb push_back
#define ld long double
#define rem 1000000007
#define rem1 998244353
#define inf 1e18+1e17
#define F first
#define S second
#define pii pair<long long,long long>
#define p_q priority_queue <ll, vector<ll>, greater<ll> >
#define m_sp multiset <pair <ll,ll> >
#define el "\n"
#define sp " "
typedef long long ll;
ll Pow(ll x,ll y,ll m)
{ if (y == 0) return 1; ll p = Pow(x, y/2, m) % m;
p = (p * p) % m;return (y%2 == 0)? p : (x * p) % m; }
bool check(double x, vector <double> a, vector <double> v)
{
	map <double,ll> m;
	ll sum=0;
	for(ll i=0;i<a.size();i++)
	{
		m[a[i]-x*v[i]]++;
		m[a[i]+x*v[i]+1e-6]--;
	}
	for(auto i=m.begin();i!=m.end();i++)
	{
		sum+=i->second;
		if(sum==a.size())
		return true;
	}
	return false;
}
main()
{
	// fast io
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);ll i,j=0;
	double n;
	cin>>n;
	vector <double> a(n),v(n);
	for(i=0;i<n;i++)
	cin>>a[i];
	for(i=0;i<n;i++)
	cin>>v[i];
	double l=0.0, h=1e9,ans=0;
	for(double cnt=0;cnt<300;cnt++)
	{
		double mid = (double)(l+h+0.0)/2.0;
		if(check(mid, a, v))
		{
			ans=mid;
			h=mid;
		}
		else
		l=mid;
	}
	cout<<ans<<el;
}


# include<bits/stdc++.h>

#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define mp make_pair
#define input freopen("input.txt","r",stdin);
#define output freopen("output.txt","w",stdout);
#define fast_io ios::sync_with_stdio(NULL), cin.tie(NULL), cout.tie(NULL);
#define fix cout << fixed << setprecision(15);
//#define left left228
//#define right right228
//#define next next228
#define rank rank228
//#define prev prev228
#define y1 y1228
#define dout if(debug) cout
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int> ;
using pll = pair<ll, ll>;
using pci = pair<char, int>;
using vi = vector<int> ;
using vll = vector<ll> ;
using vpii = vector<pii> ;
const ll infll = 1e18 + 3;
const int maxn = 1e6 + 77;
const int nmax = 1e6 + 577;
const ll basell = 1e18 + 3;
const int mod = 1e9 + 7;
const ld eps = 1e-7;
const int inf = 1009000999;
const int nv = 100505;
const int baseint = 1000200013;
const ld PI = acos(-1.0);
inline bool EQ(ld a, ld b) { return fabs(a-b) < 1e-9; }
inline bool IF(int a, int b, int c) { return (a >= b && a <= c); }
inline bool IFS(int a, int b, int c) { return (a > b && a < c); }
template<typename T> inline istream &operator>> (istream &_in, vector<T> &_v) { for (auto &_i : _v) { _in >> _i; } return _in; }
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
//typedef pair<int, int> pt;
//#define x first
//#define y second
//ifstream cin("input.txt");
//ofstream cout("output.txt");
/*
sort(a, a + n, [&](pair<pt, int> a, pair<pt, int> b){if (a.x.x != b.x.x)
        return a.x.x < b.x.x; return a.x.y > b.x.y;});
for(int c : s)
for(int &i : a) cin >> i;
for(int c = 'a'; c <= 'z'; ++c)
vector<vector<ll>> dp(n, vector<ll>(n+2));
__int128;
char 0 = int 48;
char c = cin;
int h = (int)c - 48;
*/

/*char memory[(int)1e8];

char memorypos;

inline void * operator new(size_t n){
    char * ret = memory + memorypos;
    memorypos += n;
    return (void *)ret;
}

inline void operator delete(void *){}
*/

int x[nv], v[nv];

int inline solve() {
    //input;//,output;
    fix;
    fast_io;
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> x[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    ld l = 0, r = inf;
    ld t = inf;
    while(l < r){
        ld m = (r + l)/2;
        ld L = 0, R = inf;
        for (int i = 0; i < n; ++i) {
            L = max(L, (ld)(x[i]) - v[i] * m);
            R = min(R, (ld)(x[i]) + v[i] * m);
        }
        if(L <= R){
            r = m;
            t = min(t, m);
        } else {
            l = m + eps;
        }
        if(EQ(l, r)) break;
    }
    cout << l;
    return 0;
}

int32_t main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    solve();
    return 0;
}
/*
 * */