#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

long long solve(int N, int M, vector<int> A)
{
	A.push_back(0);
	A.push_back(N + 1);

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

	vector<int> B;
	for (int i = 1; i <= M + 1; ++i) {
		int D = A[i] - A[i - 1] - 1;
		if (D != 0) {
			B.push_back(D);
		}
	}

	if (B.empty()) {
		return 0;
	}

	long long k = *min_element(B.begin(), B.end());
	long long ans = 0;
	for (auto y : B) {
		ans += (y + k - 1) / k;
	}
	return ans;
}

int main()
{
	int N, M;
	cin >> N >> M;
	vector<int> A(M);
	for (auto& x : A) {
		cin >> x;
	}

	cout << solve(N, M, A) << endl;
}

// Template
#include "bits/stdc++.h"
#define rep_override(x, y, z, name, ...) name
#define rep2(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep3(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define rep(...) rep_override(__VA_ARGS__, rep3, rep2)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
constexpr int inf = 1001001001;
constexpr ll INF = 3003003003003003003LL;
template <typename T>
inline bool chmin(T &x, const T &y) {
    if (x > y) {
        x = y;
        return true;
    }
    return false;
}
template <typename T>
inline bool chmax(T &x, const T &y) {
    if (x < y) {
        x = y;
        return true;
    }
    return false;
}
struct IOSET {
    IOSET() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
    }
} ioset;
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &element : vec) is >> element;
    return is;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &vec) {
    for (int i = 0, vec_len = (int)vec.size(); i < vec_len; ++i) {
        os << vec[i] << (i + 1 == vec_len ? "" : " ");
    }
    return os;
}

// Main
int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(m);
    cin >> a;
    if (m == 0) {
        cout << "1\n";
        return 0;
    }

    sort(all(a));
    vector<int> vec;
    rep(i, m) {
        if (i == 0 && a[i] != 1) vec.push_back(a[i] - 1);
        else if (a[i] - a[i - 1] != 1) vec.push_back(a[i] - a[i - 1] - 1);
    }
    if (a[m - 1] != n) vec.push_back(n - a[m - 1]);
    if (vec.empty()) {
        cout << "0\n";
        return 0;
    }
    int k = *min_element(all(vec));
    int ans = 0;
    for (int x : vec) ans += (x + k - 1) / k;
    cout << ans << "\n";
}


/**
*    author:
*    created: 15.11.2020 00:57:15
**/

#pragma region Macros
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using P = pair<int,int>;
using ll = long long;
const int INF = 1001001001;
const int di[] = {-1,0,1,0}, dj[] = {0,-1,0,1};
typedef vector<int> vi;
typedef vector<vi> vvi;

#define rep(i,n) for(int i = 0; i < (n); i++)
#define repn(i,n) for(int i = 1; i <= (n); i++)
#define pb push_back
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

template<class T>
inline bool chmax(T &a, T b) {
  if(a < b) {
    a = b;
    return true;
  }
  return false;
}
template<class T>
inline bool chmin(T &a, T b) {
  if(a > b) {
    a = b;
    return true;
  }
  return false;
}

const double PI = acos(-1);
const int mod = 1000000007;
class mint {
  long long x;
  public:
  mint(long long x=0) : x((x%mod+mod)%mod) {}
  mint operator-() const {
    return mint(-x);
  }
  mint& operator+=(const mint& a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint& a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const  mint& a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint& a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint& a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint& a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    return a;
  }
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint& a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint& a) const {
    mint res(*this);
    return res/=a;
  }

  friend ostream& operator<<(ostream& os, const mint& m){
    os << m.x;
    return os;
  }
};
#pragma endregion

void fail(){
  cout << "-1\n";
  exit(0);
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  string s,t;
  cin >> s >> t;
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());
  ll ans = 0;
  vector<int> stk;
  for(int i = 0; i < n; ++i){
    if(s[i] == '1') stk.pb(i);
    if(t[i] == '1'){
      if(stk.empty()) fail();
      ans += i - stk.back();
      stk.pop_back();
    }
  }
  if(stk.size() & 1) fail();
  while(stk.size()){
    ll r = stk.back();
    stk.pop_back();
    ans += r - stk.back();
    stk.pop_back();
  }
  cout << ans << "\n";
  return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <assert.h>
#include <sys/time.h>
#include <fstream>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(vec) (vec).begin(),(vec).end()

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define deb(x) cerr << #x << " = " << (x) << " , ";
#define debl cerr << " (L" << __LINE__ << ")"<< endl;

#define clr(a) memset((a),0,sizeof(a))
#define nclr(a) memset((a),-1,sizeof(a))
#define pb push_back
#define INRANGE(x,s,e) ((s)<=(x) && (x)<(e))
#define MP(x,y) make_pair((x),(y))
#define sz(v) ((ll)(v).size())
#define bit(n) (1LL<<n)

double pi=3.14159265358979323846;

using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,double> pld;
typedef pair<double,ll> pdl;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;

template<typename T,typename U> std::ostream& operator<<(std::ostream& os, const pair<T,U>& z){
	return ( os << "(" << z.first << ", " << z.second << ",)" );
}

template<typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& z){
	os << "[ ";
	rep(i,z.size())os << z[i] << ", " ;
	return ( os << "]" << endl);
}

template<typename T> std::ostream& operator<<(std::ostream& os, const set<T>& z){
	os << "set( ";
	for(T p:z)os << p << ", " ;
	//each(p,z)os << (*p) << ", " ;
	return ( os << ")" << endl);
}

template<typename T,typename U> std::ostream& operator<<(std::ostream& os, const map<T,U>& z){
	os << "{ ";
	//each(p,z)os << (p->first) << ": " << (p->second) << ", " ;
	for(auto p:z)os << (p.first) << ": " << (p.second) << ", " ;
	return ( os << "}" << endl);
}

double get_time(){
	struct timeval tv;
	gettimeofday(&tv, NULL);
	return tv.tv_sec + tv.tv_usec*1e-6;
}

ll mod = 1000000007;

vl X,Y;

ll cal(){
	//debug(X);
	//debug(Y);
	ll ret = 0;
	int ix = 0, iy=0;
	while(ix<X.size()){
		if(iy<Y.size() && X[ix]>=Y[iy]){
			ret += X[ix] - Y[iy];
			ix += 1;
			iy += 1;
		}
		else{
			if(ix+1>=X.size()){
				return -1;
			}
			ret += X[ix+1] - X[ix];
			ix += 2;
		}
	}
	if(iy==Y.size())return ret;
	return -1;
}

void _main(istream &inp){
	string s,t;
	ll N;
	inp >> N >> s >> t;
	rep(i,s.size()){
		if(s[i]=='1'){
			X.push_back(i);
		}
		if(t[i]=='1'){
			Y.push_back(i);
		}
	}
	cout << cal() << endl;

}

int main(){
	if(0){
		ifstream ifs("test.txt");
		_main(ifs);
	}
	else{
		_main(cin);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  cout << n - 1 << endl;
}

// IN THE NAME OF GOD
// https://serhatgiydiren.github.io
// 2021/05/13 14:07:26

#include <bits/stdc++.h>

using namespace std;
using namespace chrono;

class timer:high_resolution_clock
{
 const time_point start_time;

 public:
  timer(): start_time(now()) {}
  rep elapsed_time() const { return duration_cast<milliseconds>(now()-start_time).count();}
};

int time_limit=2000;
timer ttt;

#ifdef LOCAL
#include "debug.h"
#else
#define D(...) 404
#endif

mt19937 rng(steady_clock::now().time_since_epoch().count());

void solve(const int &test_id)
{
 int n;
 cin >> n;
 cout << n-1 << endl;
}

void solve_cases()
{
 int test_cases = 1;
 //cin >> test_cases;
 for(int i = 1; i <= test_cases; i++) { solve(i); D(i,ttt.elapsed_time()); }
}

void fast_io()
{
 ios::sync_with_stdio(false);
 srand(time(NULL));
 cin.tie(0);
 cout.tie(0);
 cout << fixed << setprecision(15);
 cerr << fixed << setprecision(15);
}

int main()
{
 fast_io();
 solve_cases();
 return EXIT_SUCCESS;
}


#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,m;
    cin>>n>>m;
    char a[n][m];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
            cin>>a[i][j];
        }
    }
    int even=0,odd=0;
    for(int i=0;i<n;i++)
    {
        int k=0;
        for(int j=0;j<m;j++)
        {
            if(a[i][j]=='1')
            {
                k++;
            }
        }
        if(k%2)
        {
            odd++;
        }
        else
        {
            even++;
        }
    }
    cout<<even*odd;
	return 0;
}

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,avx512f")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>
#include <bitset>
#include <numeric>
#include <cassert>
#include <memory>
#include <random>
#include <functional>
#include <complex>
#include <immintrin.h>
#ifdef DEBUG
#include "./Lib/debug_VC.hpp"
#include "./Lib/Timer.hpp"
#include "./Lib/sample.hpp"
#else
#define dump(...)
#endif

/* macro */
#define FOR(i, b, e) for(ll i = (ll)(b); i < (ll)(e); ++i)
#define RFOR(i, b, e) for(ll i = (ll)(e-1); i >= (ll)(b); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define REPI2(it,b,e) for(auto it = (b); it != (e); ++it)
#define REPI(it,c) REPI2(it, (c).begin(), (c).end())
#define RREPI(it,c) REPI2(it, (c).rbegin(), (c).rend())
#define REPI_ERACE2(it, b, e) for(auto it = (b); it != (e);)
#define REPI_ERACE(it, c) REPI_ERACE2(it, (c).begin(), (c).end())
#define ALL(x) (x).begin(),(x).end()
#define cauto const auto&
/* macro func */
template<class T>
inline auto sort(T& t) { std::sort(ALL(t)); }
template<class T>
inline auto rsort(T& t) { std::sort((t).rbegin(), (t).rend()); }
template<class T>
inline auto unique(T& t) { (t).erase(unique((t).begin(), (t).end()), (t).end()); }
template<class T, class S>
inline auto chmax(T& t, const S& s) { if (s > t) { t = s; return true; } return false; }
template<class T, class S>
inline auto chmin(T& t, const S& s) { if (s < t) { t = s; return true; } return false; }
inline auto BR() { std::cout << "\n"; }

/* type define */
using ll = long long;
using PAIR = std::pair<ll, ll>;
using VS = std::vector<std::string>;
using VL = std::vector<long long>;
using VVL = std::vector<VL>;
using VVVL = std::vector<VVL>;
using VD = std::vector<double>;
template<class T>
using V = std::vector<T>;

/* using std */
using std::cout;
constexpr char endl = '\n';
using std::cin;
using std::pair;
using std::string;
using std::stack;
using std::queue;
using std::vector;
using std::list;
using std::map;
using std::unordered_map;
using std::multimap;
using std::unordered_multimap;
using std::set;
using std::unordered_set;
using std::unordered_multiset;
using std::multiset;
using std::bitset;
using std::priority_queue;

/* Initial processing  */
struct Preprocessing { Preprocessing() { std::cin.tie(0); std::ios::sync_with_stdio(0); }; }_Preprocessing;

/* Remove the source of the bug */
signed pow(signed, signed) { assert(false); return -1; }

/* define hash */
namespace std {
template <>	class hash<std::pair<ll, ll>> { public:	size_t operator()(const std::pair<ll, ll>& x) const { return hash<ll>()(1000000000 * x.first + x.second); } };
}

/* input */
template<class T> std::istream& operator >> (std::istream& is, vector<T>& vec) { for (T& x : vec) is >> x; return is; }

/* constant value */
constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;

//=============================================================================================

signed main() {
    ll n, m;
    cin >> n >> m;

    ll c0 = 0, c1 = 0;
    REP(_, n) {
        string s;
        cin >> s;
        ll cnt = 0;
        REPC(c, s)if (c == '0') { ++cnt; }
        ++((cnt & 1) ? c0 : c1);
    }
    cout << c0 * c1 << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}
void OUTX2(){cout << endl;}
template<typename Head, typename... Tail>
void OUTX2(Head&& head, Tail&&... tail)
{
    cout << head << ' ';
    OUTX2(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define __LONG_LONG_MIN__ (-__LONG_LONG_MAX__ - 1)

//#define MOD 1000000007 // 10^9 + 7
//setprecision(10)

ll abmodn(ll a, ll b, ll n)
{
    if(n == 1) return 0;
    if(b == 0) return 1;
    if(a % n == 0) return 0;

    vbl chk(n, false);
    vll v;
    ll m = a;
    ll loop = 0;
    for (; loop <= n; loop++)
    {
        m %= n;
        if(chk[m]) break;
        chk[m] = true;
        v.ADD(m);
        m *= a;
    }

    ll startloop = 0;
    while(v[startloop] != m) startloop++;
    ll looplen = loop - startloop;

    b--;
    if(b > startloop)
    {
        b -= startloop;
        b %= looplen;
        b += startloop;
    }
    return v[b];
}

int main()
{
    ll N, M;
    INX(N, M);

    ll M2 = M * M;
    ll n10modm = abmodn(10, N, M2);
    ll result = (n10modm / M) % M;
    OUTX(result);

    return 0;
}

#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
const int N=100050;
int a[N],b[N],c[N];
int n,m,k;
int ans;
bool check(int x)
{
	int l=0,r=0;
	for(int i=1;i<=k;i++)
	{
		l+=(m*a[i]-x+n-1)/n;
		r+=(m*a[i]+x)/n;
	}
	if(l<=m&&m<=r) return true;
	else return false;
}
void construct()
{
	int sum=0;
	for(int i=1;i<=k;i++)
	{
		b[i]=(m*a[i]-ans+n-1)/n;
		sum+=b[i];
		c[i]=(m*a[i]+ans)/n;
	}
	for(int i=1;i<=k;i++)
	{
		int temp=min(m-sum,c[i]-b[i]);
		b[i]+=temp;
		sum+=temp;
	}

}
signed  main()
{
	cin>>k>>n>>m;
	for(int i=1;i<=k;i++) cin>>a[i];
	int l=-1,r=n*m;
	while(r-l>1)
	{
		int mid=(r+l)>>1;
		if(check(mid)) r=mid;
		else l=mid;
	}
	ans=r;

	construct();
	for(int i=1;i<=k;i++) cout<<b[i]<<" ";

}


#include <bits/stdc++.h>

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N
#define macro_dispatcher(macro,...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro,nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro,nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro,nargs) macro ## nargs
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DBN1(a)            cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)        cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)        cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)    cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e)    cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"

#define endl '\n'
#define DBN1D(x) cerr<<#x<<endl;for(auto _:x){cerr<<_<<" ";}cerr<<endl
#define DBN2D(x) cerr<<#x<<endl;for(auto _:x){for(auto __:_){cerr<<__<<" ";}cerr<<endl;}cerr<<"------"<<endl
#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mp(x,y) make_pair(x,y)
#define mpp(w,x,y,z) mp(mp(w,x),mp(y,z))
using namespace std;
typedef long long loli;
typedef vector<loli> vl;
typedef vector<vl> vvl;
typedef pair<loli,loli> pll;
typedef pair<pll,pll> pllll;

vl in,out,depth;
vvl edge,din;
int cnt=0;

int bs(vl&arr,int n,loli t,int l,int u){
    if(l==u){
        assert(u==0);
        return -1;
    }
    //    DBN("l",t,l,u);
    int mid=(l+u)/2;
    if(u-l==1){
        if(arr[l]>=t)
            return l;
        return u;
    }
    if(arr[mid]<t)
        return bs(arr,n,t,mid,u);
    else
        return bs(arr,n,t,l,mid);
}

void dfs(loli x){
    in[x]=++cnt;
    din[depth[x]].push_back(in[x]);
    for(auto v:edge[x]){
        depth[v]=depth[x]+1;
        dfs(v);
    }
    out[x]=++cnt;
}

void solve(){
    int n;
    cin>>n;
    edge.assign(n+1,vl());
    depth.resize(n+1,0);
    din.resize(n);
    in.resize(n+1);
    out=in;
    for(int i=2;i<=n;++i){
        int p;
        cin>>p;
        edge[p].push_back(i);
    }
    dfs(1);
//    DBN2D(din);
    int q;
    cin>>q;
    for(auto x:vl(q)){
        int u,d;
        cin>>u>>d;
        if(depth[u]==d){
            cout<<1<<endl;
        }else if(depth[u]>d){
            cout<<0<<endl;
        }else{
//            DBN(u,d);
//            DBN1D(in);
//            DBN1D(out);
//            DBN1D(din[d]);
            int l=bs(din[d],din[d].size(),in[u],0,din[d].size());
            int r=bs(din[d],din[d].size(),out[u],0,din[d].size());
//            DBN(l,r,r-l);
            cout<<r-l<<endl;

        }
    }
}

int main(){
    sync;
    solve();
    return 0;
}

#include <bits/stdc++.h>

long long func(std::vector<std::pair<long long, long long>> &vw, std::vector<long long> &boxsize, int l, int r) {
  std::vector<long long> box;
  for (int i = 0; i < (int)boxsize.size(); ++i) {
    if (i < l || i > r) box.push_back(boxsize[i]);
  }

  std::vector<bool> used(box.size(), false);
  std::sort(box.begin(), box.end());

  long long res = 0LL;
  for (int i = 0; i < (int)vw.size(); ++i) {
    long long value = vw[i].first;
    long long weight = vw[i].second;

    int index = std::lower_bound(box.begin(), box.end(), weight) - box.begin();
    while (index < (int)box.size() && used[index]) ++index;
    if (index < (int)box.size()) { used[index] = true; res += value; }
  }

  return res;
}

int main() {
  int n, m, q;
  std::cin >> n >> m >> q;
  std::vector<std::pair<long long, long long>> vw(n);
  for (int i = 0; i < n; ++i) std::cin >> vw[i].second >> vw[i].first;
  std::vector<long long> boxsize(m);
  for (int i = 0; i < m; ++i) std::cin >> boxsize[i];

  std::sort(vw.begin(), vw.end(), std::greater<std::pair<long long, long long>>());

  std::vector<long long> res;
  for (int i = 0; i < q; ++i) {
    int l, r;
    std::cin >> l >> r;
    --l; --r;
    res.push_back(func(vw, boxsize, l, r));
  }

  for (long long ans : res) std::cout << ans << std::endl;
  return 0;
}


#include<iostream>
#include<algorithm>
#include<cstring>
#define debug(a) cout<<#a<<" = "<<a<<endl

using namespace std;

typedef long long ll;
const int N = 5010;
const int MOD = 998244353;

int n , m;
ll C[N];
ll f[N];

ll Q_power(ll a ,ll b){
    ll res = 1;
    while(b){
        if(b & 1) res = res * a % MOD;
        b >>= 1;
        a = a*a % MOD;
    }
    return res;
}

ll X_1(ll a){ return Q_power(a ,MOD - 2) ;}

void init(){
    C[0] = 1;
    for(int i = 1 ; i <= n ; i ++){
        C[i] = C[i - 1] * (n - i + 1) % MOD * X_1(i) % MOD;
    }
}

ll F(int m){
	if(!(~f[m])){
    	f[m] = 0;
    	if(!(m & 1))
            for(int i = 0 ; i * 2ll <= m ; i ++){
    		    f[m] = (f[m] + C[i * 2] * F(m / 2 - i) % MOD) % MOD;
    	    }
	}
    return f[m];
}

int main(){
    cin >> n >> m;
	memset(f,0xff,sizeof f);
    init(); f[0] = 1;
    cout << F(m) << endl;
    return 0;
}

#include <bits/stdc++.h>

const long long INF = 1e9;
//const long long MOD = 1e9 + 7;
const long long MOD = 998244353;
const long long LINF = 1e18;
using namespace std;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define dump(x)  cout << #x << " = " << (x) << endl
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define COUT(x) cout<<(x)<<endl
#define SCOUT(x) cout<<(x)<<" "
#define VECCOUT(x) for(auto&youso_: (x) )cout<<right<<setw(5)<<youso_<<" ";cout<<endl
#define ENDL cout<<endl
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) long long __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)
#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define mp make_pair
#define PQ priority_queue<long long>
#define PQG priority_queue<long long,V,greater<long long>>

typedef long long ll;
typedef vector<long long> vl;
typedef vector<long long> vi;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vb> vvb;
typedef vector<vc> vvc;
typedef pair<long long, long long> pll;

#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
template<class T>
void mod(T &x) {
    x %= MOD;
    x += MOD;
    x %= MOD;
}

ll GCD(ll a, ll b) {
    if(b == 0) return a;
    else return GCD(b, a%b);
}

struct COMB{
    vl fact, fact_inv, inv;
    void init_nCk(long long SIZE) {
        fact.resize(SIZE + 5);
        fact_inv.resize(SIZE + 5);
        inv.resize(SIZE + 5);
        fact.at(0) = fact.at(1) = fact_inv.at(0) = fact_inv.at(1) = inv.at(1) = 1;
        for(long long i = 2; i < SIZE + 5; i++) {
            fact.at(i) = fact.at(i - 1)*i%MOD;
            inv.at(i) = MOD - inv.at(MOD%i)*(MOD/i)%MOD;
            fact_inv.at(i) = fact_inv.at(i - 1)*inv.at(i)%MOD;
        }
    }
    long long nCk (long long n, long long k) {
        assert(!(n < k));
        assert(!(n < 0 || k < 0));
        return fact.at(n)*(fact_inv.at(k)*fact_inv.at(n - k)%MOD)%MOD;
    }
};
ll extGCD(ll a, ll b, ll &x, ll &y) {
    if(b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a/b*x;
    return d;
}

void Main() {
    ll ans = 0;
    LCIN(N, M);
    COMB c;
    vl ttt(M + 10);
    for(int i = 0; i < M + 10; i++) {
        ttt.at(i) = i;
    }
//    VECCOUT(ttt);
    c.init_nCk(10000);
    /*
    vvl dp(6000, vl(15, 0));
    dp.at(M).at(15) = 1;
 */
    vl dp(M + 10, 0);
    dp.at(M) = 1;
    for(int i2 = 15; i2 >= 0; i2--) {
        ll n = 1 << i2;
        for(int j = 0; j < M + 3; j++) {
            if(dp.at(j) && j/n/2) {
                ll t = j/n/2;
//                dump(j);
                for(int i = 1; i <= t; i++) {
                    if(j - i*2*n >= 0 && i*2 <= N) {
                        dp.at(j - i*2*n) += dp.at(j)*c.nCk(N, i*2)%MOD;
                        dp.at(j - i*2*n) %= MOD;
                    }
                }
//                dump(j);
            }
        }
//        VECCOUT(dp);
    }
//    VECCOUT(dp);
    cout << dp.at(0) << endl;
}

int main() {
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


#include <iostream>

using namespace std;

typedef long long ll;

const int MOD = 998244353;

struct Modint {
  ll val;

  Modint (ll _val = 0)
    : val(_val % MOD) {}

  Modint operator+ (Modint other) const {
    return Modint(val + other.val);
  }

  void operator+= (Modint other) {
    val += other.val;
    val %= MOD;
  }

  Modint operator- () const {
    return Modint(MOD - val);
  }

  Modint operator- (Modint other) const {
    return Modint(val + MOD - other.val);
  }

  void operator-= (Modint other) {
    val += MOD - other.val;
    val %= MOD;
  }

  Modint operator* (Modint other) const {
    return Modint(val * other.val);
  }

  void operator*= (Modint other) {
    val *= other.val;
    val %= MOD;
  }

  bool operator== (Modint other) const {
    return val == other.val;
  }

  bool operator!= (Modint other) const {
    return val != other.val;
  }
};

Modint exp (Modint a, int k) {
  if (k == 0) {
    return Modint(1);
  } else if (k % 2 == 0) {
    Modint half = exp(a, k / 2);
    return half * half;
  } else {
    return a * exp(a, k - 1);
  }
}

Modint inv (Modint a) {
  return exp(a, MOD - 2);
}

ostream& operator<< (ostream& out, Modint p) {
  out << p.val;
  return out;
}

const int MAX_N = 2e5 + 5;
const int MAX_LG = 20;

Modint dp [MAX_LG][MAX_N]; // dp[k][i] is # of ways to write i as a product of k non-1 divisors

Modint fact [MAX_N];
Modint ifact [MAX_N];

Modint choose (int n, int k) {
  return fact[n] * ifact[k] * ifact[n - k];
}

int main () {
  fact[0] = Modint(1);
  for (int i = 1; i < MAX_N; i++) {
    fact[i] = fact[i - 1] * Modint(i);
  }

  for (int i = 0; i < MAX_N; i++) {
    ifact[i] = inv(fact[i]);
  }

  int n, m;
  cin >> n >> m;

  dp[0][1] = Modint(1);
  for (int k = 0; k < MAX_LG - 1; k++) {
    for (int i = 1; i <= m; i++) {
      for (int j = 2 * i; j <= m; j += i) {
        dp[k + 1][j] += dp[k][i];
      }
    }
  }

  Modint ans (0);
  for (int i = 1; i <= m; i++) {
    for (int k = 0; k < MAX_LG; k++) {
      // k nonones, n - k ones
      if (n - k < 0) {
        continue;
      }

      ans += choose(n, k) * dp[k][i];
    }
  }
  cout << ans << endl;
}

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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

ll MOD=998244353;
ll add(ll x, ll y)
{
    x += y;
    if (x >= MOD)
        return x - MOD;
    return x;
}
ll sub(ll x, ll y)
{
    x -= y;
    if (x < 0)
        return x + MOD;
    return x;
}
ll mult(ll x, ll y)
{
    return (x * y) % MOD;
}
ll bin_pow(ll x, ll p)
{
    if (p == 0)
        return 1;
    if (p & 1)
        return mult(x, bin_pow(x, p - 1));
    return bin_pow(mult(x, x), p / 2);
}

const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m;
    cin>>n>>m;
    COMinit();
    int ans=0;
    /*vector<int>pre(30);
    for (int i = 0; i <= 30; i++)
    {
        int cnt=0;
        for(int j=n;j>=1; j--){
            cnt+=bin_pow(j,i);
            cnt%=MOD;
        }
        pre[i]=cnt;
    }
    */
    for (int i = 1; i <= m; i++)
    {
        int N = i;
        int c=2;
        int cnt=0;
        int res=1;
        map<int,int>mp;
        while(c*c<=N){
            if(N%c==0){
                mp[c]++;
                cnt++;
                N/=c;
            }
            else{

                //if(cnt>0) res *= COM(n-1+cnt, cnt);
                res%=MOD;
                c++;
                cnt=0;
            }
        }
        if(N!=1) {
            mp[N]++;
            cnt++;
        }
        for(auto &u : mp){
            int x =u.second;
            res*=COM(n-1+x,x);
            res%=MOD;
        }
        //if(cnt>0) res*=COM(n-1+cnt, cnt);
        res%=MOD;
        //cerr<<i<<" "<<res<<endl;
        ans+=res;
        ans%=MOD;
    }
    cout<<(ans)%MOD<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    ll T, N; cin >> T >> N;

    ll ans = (N * 100 + T - 1) / T + N - 1;
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vc = vector<T>;
template<class T> using vvc = vc<vc<T>>;
template<class T> using vvvc = vc<vvc<T>>;
template<class T> using vvvvc = vvc<vvc<T>>;
template<class T> using PQ = priority_queue<T>;
template<class T> using invPQ = priority_queue<T, vector<T>, greater<T>>;
using IP = pair<int, int>;
using LP = pair<ll, ll>;
#define all(x) begin(x), end(x)
#define rep(i, n) for (int i = 0; (i) < (int)(n); i++)
#define rep3(i, m, n) for (int i = (m); (i) < (int)(n); i++)
#define repr(i, n) for (int i = (n) - 1; (i) >= 0; i--)
#define rep3r(i, m, n) for (int i = (n) - 1; (i) >= (int)(m); i--)
template<class T> inline bool chmax(T & a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T & a, T b) { if (a > b) { a = b; return 1; } return 0; }

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int t, N;
    cin >> t >> N;

    auto isok = [&] (ll x) -> bool {
        if (x - (x+1)*100/(100+t) < N) return true;
        else return false;
    };

    ll ok = 0, ng = 1000000000000;
    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;
        if (isok(mid)) ok = mid;
        else ng = mid;
    }

    if ((ng+1)*100/(100+t) * (100+t)/100 == ng) cout << ok << endl;
    else cout << ng << endl;
}


/* include c++ libraries */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <queue>
#include <set>
#include <bitset>
#include <tuple>

/* include c-lang libraries */
#include <climits>
#include <cmath>
#include <cassert>

/* include my libraries */
//#include <show_vec.hh>

using namespace std;

#define LINE DEBUG{ printf("LINE : %d\n", __LINE__); }
#define DEBUG if(false)

using ll = long long;
template<class T> using vec = vector<T>;

template<class T>void sort(vector<T> &v){
  sort(v.begin(), v.end());
  return;
}
template<class T>void rsort(vector<T> &v){
  sort(v.begin(), v.end(), std::greater<T>());
  return;
}

const int MOD = 1000000007;

int main(int argc, char* argv[]){
  int N;
  cin >> N;
  vec<bool> A(N, false);
  for(int i = 0; i < N; i++){
    int tmp;
    cin >> tmp;
    A[tmp-1] = true;
  }
  string Ans = "Yes";
  for(int i = 0; i < N; i++){
    if(A[i] == false){
      Ans = "No";
      break;
    }
  }
  cout << Ans << endl;
  return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
//#include <atcoder/all>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  int N; cin >> N;
  vector<int> A(N); rep(i,N) cin >> A[i];
  vector<int> B(N);
  rep(i,N) B[i]=i+1;
  sort(all(A));
  sort(all(B));
  if(A==B){
    cout << "Yes" << endl;
  }
  else cout << "No" << endl;
  return 0;
}


#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define pii pair<ll,ll>
#define inf 1000000000000000000
#define bpc(x) __builtin_popcountll(x)
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define autoitr(x,it) for(auto it = x.rbegin(); it != x.rend(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)
#define hmap gp_hash_table<ll, ll>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>

using namespace std;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
  FAST/**/

  ll n;
  cin>>n;

  ll arr[n];
  map<ll,ll> ma;
  rep(n)
        cin>>arr[i], ma[arr[i]] = 1;
  ma[0] = 1;
  vector<ll> v;
  autoit(ma,it)
  {
      v.pb(it->ff);
  }

  ll ans = 1;
  for(ll i=1;i<v.size();i++)
        ans = (ans * (v[i]-v[i-1]+1))%mod;
  cout<<ans<<"\n";

  return 0;
}

#include <bits/stdc++.h>
# define INF32 2147483647
# define INF64 9223372036854775807
# define rep(i,l,n) for(int i=l,i##_end=n;i<i##_end;++i)
# define rrep(i,n,l) for(int i=((int)(n)-1),i##_end=l;i>=i##_end;--i)
# define erep(i,n) for(auto &i : n)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define _f_ first
# define _s_ second
using namespace std;
using ll = long long;
using ull = unsigned long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
    // 1. input
    ll N,X;
    cin>>N>>X;

    // 2.
    // 3. output
    rep(i,0,N){
        ll a = 0;
        cin>>a;
        if(a == X) continue;
        cout << a << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e6+10;
const double eps = 0.01;
inline ll read()
{
    ll x=0,f=1;char ch=getchar();
    while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
    while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
    return x*f;
}
inline ll pt(ll ans,ll f){
    printf("%lld",ans);
    if(f==1) putchar(' ');
    else putchar('\n');
}
ll n,k,m,tot;
ll a[N],c[N],vis[N],mi=1e10;
void dfs(int x,ll now){
    if(x==n+1) mi=min(mi,now);
    ll res=0;
    for(int i=x;i<=n;i++){
        res|=a[i];
        dfs(i+1,res^now);
    }
}
int main()
{
//    freopen("../in.in","r",stdin);
    ll _;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    dfs(1,0);
    cout<<mi<<endl;
    return 0;
}

// Problem : C - ORXOR
// Contest : AtCoder - AtCoder Beginner Contest 197（Sponsored by Panasonic）
// URL : https://atcoder.jp/contests/abc197/tasks/abc197_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

// Delete the dynamically allocated memory

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

#define ff              first
#define ss              second
#define pb              push_back
#define pr              pair<long long,long long>
#define mp(a,b)         make_pair(a,b)
#define vr              vector<long long>
#define mod1            1000000007
#define mod2            998244353
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define fill(a,b)       memset(a, b, sizeof(a))
#define mk(arr,n,type)  type *arr=new type[n];
#define ll              long long
#define ld	            long double
#define w(x)            int x; cin>>x; while(x--)

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n;
	cin>>n;
	mk(a,n,ll)
	for(ll i=0;i<n;i++){
		cin>>a[i];
	}
	ll ans=inf;
	for(ll i=0;i<(1<<(n-1));i++){
		vr c;
		ll sum=a[0];
		for(ll j=1;j<n;j++){
			if((i&(1<<(j-1)))){
				c.pb(sum);
				sum=a[j];
			}else{
				sum|=a[j];
			}
		}
		c.pb(sum);
		// for(ll j=0;j<c.size();j++){
			// cout<<c[j]<<" ";
		// }
		// cout<<"\n";
		ll x=0;
		for(ll j=0;j<c.size();j++){
			x^=c[j];
		}
		ans=min(ans,x);
	}
	cout<<ans<<"\n";
	delete[] a;
	return 0;
}


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

ll solve() {
    ll N;
    cin >> N;
    vector<ll> X(N);
    for ( int i = 0; i < N; i++ ) cin >> X[i];
    // 素因数分解 O(x^(1/2))
    auto PrimeFactor = [](ll x) {
        map<ll, ll> pr;
        for ( ll k = 2; k * k <= x; k++ ) {
            while ( x % k == 0 ) {
                pr[k]++;
                x /= k;
            }
        }
        if ( x > 1 ) pr[x]++;
        return pr;
    };
    set<ll> s, sp;
    s.insert(1);
    for ( int i = 0; i < N; i++ ) {
        swap(s,sp);
        s.clear();
        auto ps = PrimeFactor(X[i]);
        for ( auto p : ps ) {
            for ( ll x : sp ) {
                if ( x % p.first != 0 ) {
                    s.insert(x*p.first);
                } else {
                    s.insert(x);
                }
            }
        }
    }
    return *s.begin();
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
using namespace std;
using Graph = vector<vector<long long>>;

template<class T> void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}

const long long INF = 1LL << 60;

int N;

double func (double x, const vector<double> &a) {
    double res = 0;
    for (int i = 0; i < N; ++i) {
        res += x + a[i] - min(2 * x, a[i]);
    }

    return res;
}

int main() {
    cin >> N;
    vector<double> a(N);
    for (int i = 0; i < N; ++i) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());

    double left = 0, right = 1e12;
    while (right - left > 1e-6) {
        double h1 = left + (right - left) / 3;
        double h2 = right - (right - left) / 3;
        if (func(h1, a) < func(h2, a)) {
            right = h2;
        } else {
            left = h1;
        }
    }

    double ans = func(left, a) / N;

    cout << setprecision(12) << ans << endl;

    return 0;
}


/*Rabbi Zidni Ilma*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define scl(n) scanf("%lld",&n)
#define scll(n,m) scanf("%lld %lld",&n,&m)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define mod 1000000007
#define read freopen("input.txt","r",stdin)
#define write freopen("output.txt","w",stdout)

int main()
{
    ll n,w,ans;
    scll(n,w);
    ans=n/w;
    printf("%lld\n",ans);
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;

const ll mod = 1000000007;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, w;
    cin >> n >> w;
    cout << n / w << endl;
    return 0;
}


#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef long double ld;
//#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define rev(i,b,a)  for (ll i = b - 1; i >= a; i--)
#define all(v)      (v).begin(), (v).end()
#define maxe(v)     *max_element(v.begin(), v.end())
#define mine(v)     *min_element(v.begin(), v.end())
#define pb          push_back
#define pf          push_front
#define mp          make_pair
#define FF          first
#define SS          second
#define REM         1000000007
#define cont        continue
#define PI          3.141592653589793238462643383279502
//#define debug(n1) cout<<"debug... "<<n1<<"\n"
//const ll INF=(1ll<<60)-1;//ll ans = 3e18 + 5;
//const int N=2e5+10;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

bool isprime(ll n){
    if(n%2==0 && n!=2)return false;
    for(ll i=3;i*i<=n;i+=2){
        if(n%i==0)return false;
    }
    return true;
}

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

   int tc=1;
   //cin>>tc;
    while(tc--){
           ll n;
           cin>>n;
           ll a[n],b[n];
           rep(i,0,n){cin>>a[i];}
           rep(i,0,n){cin>>b[i];}

           ll sum=0;

           rep(i,0,n){
                sum+=(a[i]*b[i]);
           }

           if(sum==0){cout<<"Yes\n";}
           else{cout<<"No\n";}

    }

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll pwr(ll a, ll b){
  ll res=1;
  while(b>0){
   if(b&1)
    res=res*a;
   a*=a;
   b>>=1;
  }
  return res;
  }
int main()
{
  ll n;
  cin>>n;
  ll a[n],b[n];
  ll sum=0;
  for(int i=0;i<n;i++)
  {
     cin>>a[i];
  }
  for(int i=0;i<n;i++)
  {
     cin>>b[i];
  }
  for(int i=0;i<n;i++)
  {
     sum+=a[i]*b[i];
  }
  if(sum==0)
  cout<<"Yes\n";
  else cout<<"No\n";
 return 0;
}


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

int arr[801][801], prefix[801][801];
int n, k;

bool check(int m){
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			if(arr[i][j] <= m) prefix[i][j] = 1;
			else prefix[i][j] = 0;
			prefix[i][j] += prefix[i - 1][j] + prefix[i][j - 1] - prefix[i - 1][j - 1];
		}
	}
	int maxx = 0;
	for(int i = k; i <= n; i++){
		for(int j = k; j <= n; j++){
			maxx = max(maxx, prefix[i][j] - prefix[i - k][j] - prefix[i][j - k] + prefix[i - k][j - k]);
		}
	}
	if(maxx >= k * k - k * k / 2) return true;
	else return false;
}

int main(){
	cin >> n >> k;
	int minn = 2e9, maxx = 0;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			cin >> arr[i][j];
			minn = min(minn, arr[i][j]);
			maxx = max(maxx, arr[i][j]);
		}
	}
	int l = minn, r = maxx;
	while(r - l > 0){
		int m = (l + r) / 2;
		if(check(m)) r = m;
		else l = m + 1;
	}
	cout << l << '\n';
}

#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
struct position {
    int x, y;
};

int main() {
    int h, w;
    cin >> h >> w;
    position g = {0, 0};
    vector<string> a(h);
    vector<vector<int>> c(h, vector<int>(w, 1 << 30));
    vector<vector<position>> t(26);
    vector<bool> init(26, true);
    queue<position> q;
    for (auto i = 0; i < h; i++) cin >> a[i];
    for (auto i = 0; i < h; i++) {
        for (auto j = 0; j < w; j++) {
            if (a[i][j] == 'S') q.push({i, j}), c[i][j] = 0;
            if (a[i][j] == 'G') g = {i, j};
            if (a[i][j] - 'a' >= 0 and a[i][j] - 'a' < 26)
                t[a[i][j] - 'a'].push_back({i, j});
        }
    }
    while (not q.empty()) {
        auto p = q.front();
        q.pop();
        for (auto i = 0; i < 4; i++) {
            position n = {p.x + dx[i], p.y + dy[i]};
            if (n.x < 0 or n.x >= h or n.y < 0 or n.y >= w)
                continue;
            if (a[n.x][n.y] == '#') continue;
            if (c[n.x][n.y] <= c[p.x][p.y] + 1) continue;
            c[n.x][n.y] = c[p.x][p.y] + 1;
            if (a[n.x][n.y] != 'G') q.push(n);
        }
        auto index = a[p.x][p.y] - 'a';
        if (index >= 0 and index < 26 and init[index]) {
            init[index] = false;
            for (auto& elm : t[index]) {
                if (elm.x == p.x and elm.y == p.y) continue;
                if (c[elm.x][elm.y] <= c[p.x][p.y] + 1)
                    continue;
                c[elm.x][elm.y] = c[p.x][p.y] + 1;
                q.push(elm);
            }
        }
    }
    if (c[g.x][g.y] == 1 << 30) c[g.x][g.y] = -1;
    cout << c[g.x][g.y] << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 50;
const int inf = 1e9;
inline int lowbit(const int & x) { return x & (-x);}
int n, rt;
int ls[maxn], rs[maxn];
int a[maxn][maxn];
void check()
{
	for(int i = 1; i <= n; ++i) for(int j = 1; j <= n; ++j) a[i][j] = (i == j) ? 0 : inf;
	for(int i = 1; i <= n; ++i) a[i][ls[i]] = a[i][rs[i]] = 1;
	for(int k = 1; k <= n; ++k)
		for(int i = 1; i <= n; ++i)
			for(int j = 1; j <= n; ++j)
				a[i][j] = min(a[i][k] + a[k][j], a[i][j]);
	for(int i = 1; i <= n; ++i)
	{
		for(int j = 1; j <= n; ++j)
			printf("%d ", a[i][j]);
		puts("");
	}
}
int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; ++i)
	{
		ls[i] = (i << 1) % n + 1;
		rs[i] = (i << 1 | 1) % n + 1;
		printf("%d %d\n", ls[i], rs[i]);
	}
	//check();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
int main()
{
    ll b,c;
    cin>>b>>c;
    if(b==0)
        cout<<c;
    else
    {
        ll ans=0;
        if(c%2)
        {
            ans+=c-1;
            if(b>0&&c>1)
            ans-=1;
            ans+=2;
            ans+=2*min(abs(b),c/2);
            if(c/2>=abs(b))ans--;
        }
        else
        {
            /*ans+=c;
            ans--;

            ans+=2;
            c--;
            ans+=2*min(abs(b),c/2);
            if(c/2>=abs(b))ans--;*/
            if(b<0)
            {
              ans+=c;
            ans--;

            ans+=2;
            c--;
            ans+=2*min(abs(b),c/2);
            if(c/2>=abs(b))ans--;
            }
            else
            {
                ans+=c;
                ans-=2;
                ans+=2;
                ans+=2*min(b,c/2);
                ans--;
            }
        }
        cout<<ans<<endl;
    }
}

#include <bits/stdc++.h>
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define ALL(v) (v).begin(), (v).end()
#define LLA(v) (v).rbegin(), (v).rend()
#define SZ(v) (v).size()
#define INT(...)                                                               \
    int __VA_ARGS__;                                                           \
    read(__VA_ARGS__)
#define LL(...)                                                                \
    ll __VA_ARGS__;                                                            \
    read(__VA_ARGS__)
#define DOUBLE(...)                                                            \
    double __VA_ARGS__;                                                        \
    read(__VA_ARGS__)
#define CHAR(...)                                                              \
    char __VA_ARGS__;                                                          \
    read(__VA_ARGS__)
#define STRING(...)                                                            \
    string __VA_ARGS__;                                                        \
    read(__VA_ARGS__)
#define VEC(type, name, size)                                                  \
    vector<type> name(size);                                                   \
    read(name)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
template <typename T> struct edge {
    int to;
    T cost;
    edge(int t, T c) : to(t), cost(c) {}
};
template <typename T> using WGraph = vector<vector<edge<T>>>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;
template <class T> inline vector<T> make_vec(size_t a, T val) {
    return vector<T>(a, val);
}
template <class... Ts> inline auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec(ts...))>(a, make_vec(ts...));
}

void read() {}
template <class T> inline void read(T &a) { cin >> a; }
template <class T, class S> inline void read(pair<T, S> &p) {
    read(p.first), read(p.second);
}
template <class T> inline void read(vector<T> &v) {
    for(auto &a : v)
        read(a);
}
template <class Head, class... Tail>
inline void read(Head &head, Tail &...tail) {
    read(head), read(tail...);
}
template <class T> inline void chmax(T &a, T b) { (a < b ? a = b : a); }
template <class T> inline void chmin(T &a, T b) { (a > b ? a = b : a); }

ll mod_pow(ll x, ll n, ll mod) {
    if(n == 0)
        return 1;
    ll res = mod_pow(x * x % mod, n / 2, mod);
    if(n & 1)
        res = res * x % mod;
    return res;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    LL(n, m);
    cout << mod_pow(10, n, m * m) / m << endl;
}


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

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

    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m);
    rep(i, n) cin >> a[i];
    rep(i, m) cin >> b[i];
    vector<int> ans;
    rep(i, n) {
        bool ok = true;
        rep(j, m) {
            if(a[i] == b[j]) ok = false;
        }
        if(ok) ans.push_back(a[i]);
    }
    rep(i, m) {
        bool ok = true;
        rep(j, n) {
            if(b[i] == a[j]) ok = false;
        }
        if(ok) ans.push_back(b[i]);
    }
    sort(ans.begin(), ans.end());
    rep(i, ans.size()) {
        cout << ans[i] << " ";
    }
    cout << endl;
    return 0;
}

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

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> A(N), B(M);
    for (auto &Ai : A)
        cin >> Ai;
    for (auto &Bi : B)
        cin >> Bi;
    set<int> XOR;
    for (auto Ai : A)
        XOR.insert(Ai);
    for (auto Bi : B) {
        if (XOR.count(Bi))
            XOR.erase(Bi);
        else
            XOR.insert(Bi);
    }
    bool is_head = true;
    for (auto XORi : XOR) {
        if (!is_head)
            cout << ' ';
        cout << XORi;
        is_head = false;
    }
    cout << endl;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
using graph = vector<VI>;
template<class T = ll> using w_graph = vector<vector<pair<int, T>>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n);++i)
#define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i)
#define erFOR(i,a,n) for(int i=(n);i>=(a);--i)
#define SORT(a) sort(a.begin(),a.end())
#define rSORT(a) sort(a.rbegin(),a.rend())
#define fSORT(a,f) sort(a.begin(),a.end(),f)
#define all(a) a.begin(),a.end()
#define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x))
#define tp(a,i) get<i>(a)
#ifdef _DEBUG
#define line cout << "-----------------------------\n"
#define stop system("pause")
#endif
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
template<class T>inline void print(const T& a) { cout << a << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }
template<class T>inline T sum(const vector<T>& a, int l, int r) { return a[r] - (l == 0 ? 0 : a[l - 1]); }
template<class T>inline void END(T s) { print(s); exit(0); }
void END() { exit(0); }

int main() {
    init();

    int n; cin >> n;
    auto c = vec<ll>(n, n); cin >> c;

    VL a(n), b(n);
    FOR(i, 1, n)a[i] = a[i - 1] + (c[i][0] - c[i - 1][0]);
    ll base = *min_element(all(a));
    FOR(i, 0, n)a[i] -= base;
    FOR(i, 0, n)b[i] = c[0][i] - a[0];

    if (*min_element(all(a)) < 0 || *min_element(all(b)) < 0)END("No");
    FOR(i, 0, n)FOR(j, 0, n)if (a[i] + b[j] != c[i][j])END("No");

    print("Yes");
    print(a);
    print(b);

    return 0;
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#pragma GCC optimize ("-O3")
#define int long long
#define ld long double
#define endl "\n"

#define rep(i,begin,end) for (__typeof(end) i=begin-(begin>end); i!=(end)-(begin>end); i+=1-2*(begin>end))
#define umap unordered_map
#define pq priority_queue
#define pb push_back
#define mp make_pair
#define fs first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define mii map<int,int>
#define pii pair<int,int>
#define vc vector
#define vi vc<int>
#define vvi vc<vi>
#define all(v) v.begin(),v.end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define w(t) int t; cin>>t; rep(tc,0,t)
#define clr(a,x) memset(a,x,sizeof a)

#define chkbit(x,i) ((x)&(1LL<<(i)))
#define setbit(x,i) ((x)|(1LL<<(i)))
#define setbits(x)  __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define ps(x,y) fixed<<setprecision(y)<<x
#define print(a, n) rep(i,0,n) cout<<a[i]<<" "; cout<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const int mod = 1e9+7;
const int mod2 = 998244353;
const int N = 2e5;
const int inf = 1e18;
const ld PI = 3.141592653589793;

//=====================================================

template<typename... T>
void in(T&... args) {((cin>>args), ...);}
template<typename... T>
void out(T&&... args) {((cout<<args<<" "), ...);}
template<typename... T>
void outln(T&&... args) {((cout<<args<<" "), ...); cout<<endl;}

int nxt(){int x;cin>>x;return x;}
int add(int a,int b,int mod){int res=(a+b)%mod;return (res<0)?res+mod:res;}
int mul(int a,int b,int mod){int res=(a*1LL*b)%mod;return (res<0)?res+mod:res;}
int range(int x,int y,int z) {return (x >= y && x <= z);}

struct customCompare {
    bool operator () (int x, int y) {
        return x>y;
    }
};

//=====================================================

int calc(int x){
    return ((x*(x+1))/2)%mod2;
}

void solve() {
    int a,b,c;
    in(a,b,c);

    int ans = calc(a);
    ans = mul(ans, calc(b), mod2);
    ans = mul(ans, calc(c), mod2);

    cout <<  ans << endl;
}

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

    solve();
    // int t; cin >> t;
    // for (int tc = 1; tc <= t; tc++) {
    //     cout << "Case #" << tc << ": ";
    //     solve();
    // }

    // printclock;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>
#include <cassert>
#include <random>
#include <chrono>

/* #include <atcoder/all> */
/* using namespace atcoder; */
using namespace std;

void debug_out(){ cout << "\n"; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}
#ifdef _DEBUG
#define debug(...) debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1000000007;
/* const ll MOD = 998244353; */
const ll INF = (1<<30)-1;
const ll INFLL = 1ll<<60;
const double PI = acos(-1);

struct INIT { INIT(){
  cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;

signed main() {
  int sx, sy, gx, gy;
  cin >> sx >> sy >> gx >> gy;

  if(sx == gx) cout << sx << "\n";
  else{
    int x = gx-sx;
    int y = sy+gy;

    ld t = (ld)x/y;
    cout << t*sy+sx << "\n";
  }

  return 0;
}

  #include <bits/stdc++.h>
  using namespace std;
  #define rep(i, n) for(int i = 0; i < n; ++i)
  #define ll long long
  template <typename T>
  bool PN(T x){ if (x <= 1) return false; if (x == 2) return true; for (int i = 2; i < sqrt(x) + 1; i++) if (x % i == 0) return false; return true;}

  const ll MOD = 1e9+7;
  const ll LINF = 1001002003004005006ll;
  const int INF = 1001001001;
  long long Comb(ll n, ll i){long long ans = 1; if(i>n || i < 0) return 0; if(i == 0 || i == n) return 1; else {for(int j = 1; j <= i; ++j){ans *=(n+1-j); ans /= j;} }return ans;}
  template<typename T> T gcd(T a, T b){if(b == 0) return a;else return gcd(b, a%b);}
  template<typename T> T lcm(T a, T b){if(b > a) swap(a, b); T g = gcd(a, b);return a / g * b;}

void solve(){
  int n; cin >> n;
  vector<pair<double, double>> inter;
  rep(i, n) {
    double t, a, b;
    cin >> t >> a >> b;
    if(t == 1) inter.push_back(make_pair(a, b));
    else if(t == 2) inter.push_back(make_pair(a, b-0.1));
    else if(t == 3) inter.push_back(make_pair(a+0.1, b));
    else inter.push_back(make_pair(a+0.1, b-0.1));
  }
  sort(inter.begin(), inter.end());
  int ans = 0;
  for(int i = 0; i < n-1; ++i) {
    //if(inter[i].first > inter[i].second) continue;
    double end = inter[i].second;
    for(int j = i + 1; j < n; ++j) {
      //if(inter[j].first > inter[j].second) continue;
      double start = inter[j].first;
      if(start <=  end) {
        ans++;
        //cout << i << " "  << j << endl;
      }
    }
  }
  cout << ans << endl;
}

  int main(void){
    solve();
    return 0;
  }


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

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    string s;
    cin >> s;
    int x = 0, o = 0, q = 0;
    for (auto &i : s)
    {
        if (i == 'x')
            x++;
        else if (i == 'o')
            o++;
        else
            q++;
    }
    if (o > 4 or o + q == 0)
        cout << 0 << endl;
    else
    {
        q += o;
        int ans = q * q * q * q;

        auto c = [](int n, int r)
        {
            if (r == 1)
                return n;
            if (r == 2)
                return n * (n - 1) / 2;
            if (r == 3)
                return n * (n - 1) * (n - 2) / 6;
            return n * (n - 1) * (n - 2) * (n - 3) / 24;
        };

        for (int i = 1; i <= o; i++)
        {
            ans -= (i & 1 ? 1 : -1) * pow(q - i, 4) * c(o, i);
        }
        cout << ans << endl;
    }
}

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

int main() {
  string s;
  cin >> s;

  int res = 0;
  for (int i = 0; i < 10000; i++) {
    int n = i;
    vector<int> d(4);
    for (int j = 0; j < 4; j++) {
      d.at(j) = n%10;
      n /= 10;
    }

    bool check = true;
    for (int j = 0; j < 4; j++) {
      if (s.at(d.at(j)) == 'x') {
        check = false;
        break;
      }
    }
    if (!check) {
      continue;
    }

    for (int k = 0; k < 10; k++) {
      if (s.at(k) == 'o') {
        if (d.at(0) != k && d.at(1) != k && d.at(2) != k && d.at(3) != k) {
          check = false;
          break;
        }
      }
    }

    if (check) {
      res++;
    }
  }

  cout << res << endl;
}


#include <iostream>
using namespace std;

int main(void) {
  /* code */
  /* A,Tの数、C,Gの数がそれぞれ等しい*/
  /* １文字ずつ足していき、最後の文字を含めた部分文字列のみを捜索するDP法 */

  int N;
  string S;
  int answer = 0;

  std::cin >> N >> S;

  for (int i = 0; i < N; i++)
  {
    int c1 = 0;
    int c2 = 0;

    for (int j = i; j < N; j++)
      {
        switch(S[j])
          {
            case 'A':
              c1++;
              break;
            case 'T':
              c1--;
              break;
            case 'G':
              c2++;
              break;
            case 'C':
              c2--;
              break;
          }
          if (c1 == 0 && c2 == 0)
          {
            answer++;
          }
      }
    }

  std::cout << answer << '\n';

  return 0;
}

#include <bits/stdc++.h>

#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define FILL0(x) memset(x,0,sizeof(x))
#define FILL1(x) memset(x,-1,sizeof(x))

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int a, b;
    cin >> a >> b;

    cout << (a+b)/2 << " " << (a-b)/2 << endl;

    return 0;

}


//
// Created by Kushagra on 30-01-2021.
//

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

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<ll> vll;
typedef set<int> si;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define INF 1e18+5
#define MOD 1e9+7
#define TEST(i, a, t) for (int i=a; i<=t; i++)
#define FORn(i, a, b) for (int i=a; i>=b; i--)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define FRIO freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int main()
{
    FIO;
    int n,s,d;
    cin>>n>>s>>d;
    int x,y;
    int c=0;
    TEST(i,1,n)
    {
        cin>>x>>y;
        if(x<s && y>d)
        {
            c++;
        }
    }
    if(c>0)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    return 0;
}

#include <iostream>

int main(){
   int N, S, D;
   std::cin >> N >> S >> D;
   int X, Y;
   long long ans = 0;
   for(int i=0; i<N; ++i){
      std::cin >> X >> Y;
      if(X<S && Y>D) ans += Y;
   }
   std::cout << (ans>0 ? "Yes" : "No") << std::endl;
   return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<ll, ll> pl;
struct edge {
    ll to;     // 辺の行き先
    ll weight; // 辺の重み
    edge(ll t, ll w) : to(t), weight(w) { }
};
typedef vector<vector<ll> > Graph;
typedef vector<vector<edge> > WGraph;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define vout(v) for(int i=0; i < v.size(); i++) cout<<v[i]<<' '
#define blank_row cout<<endl
const ll MOD = 1e9 + 7;
const ll INF = MOD*MOD+1;

void dfs(const Graph &G, ll v, vector<bool> &seen, ll &ver, ll &edg){
    seen[v] = true;
    ver++;
    edg += G[v].size();
    for(auto next_v:G[v]){
        if(seen[next_v]) continue;
        dfs(G, next_v, seen, ver, edg);
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    Graph G(400000);
    rep(i,n){
        ll a,b;
        cin >> a >> b;
        a--; b--;
        G[a].pb(b);
        G[b].pb(a);
    }
    vector<bool> seen(400000);
    ll ans = 0;
    rep(v, 400000){
        ll ver = 0, edg = 0;
        if(seen[v]) continue;
        dfs(G, v, seen, ver, edg);
        ans += min(ver, edg/2);
    }
    cout << ans << endl;

    return 0;
}

#include <bits/stdc++.h>

using namespace std;
const long long N=200005;

vector<long long> edge[N];

long long tinggi[N];
long long isi[N];
long long berat[N];
long long a[N];
long long b[N];
void cari(long long a,long long harga,long long par){
    berat[a]=isi[a]+harga;
    int banyak=edge[a].size();
    for(int i=0;i<banyak;i++){
        if(edge[a][i]==par)continue;
        cari(edge[a][i],berat[a],a);
    }
    return;
}
void jalanin(long long a,long long b,long long par){
    tinggi[a]=b;
    int banyak=edge[a].size();
    for(int i=0;i<banyak;i++){
        if(edge[a][i]==par)continue;
        jalanin(edge[a][i],b+1,a);
    }
    return;
}
int main(){
    long long i,n,hasil,jum,depan,tambah,harga,levelA,levelB;
    int stat,urutan,tc;
    scanf("%lld", &n);
    getchar();
    for(i=1;i<n;i++){
        scanf("%lld %lld", &a[i], &b[i]);
        getchar();
        edge[a[i]].push_back(b[i]);
        edge[b[i]].push_back(a[i]);
    }
    jalanin(1,0,-1);
    scanf("%d", &tc);
    getchar();
    tambah=0;
    for(i=0;i<tc;i++){
        scanf("%d %d %lld", &stat,&urutan, &harga);
        getchar();
        if(stat==1){
            levelA=tinggi[a[urutan]];
            levelB=tinggi[b[urutan]];
            if(levelA<levelB){
               // cout<<"lili"<<endl;
                isi[b[urutan]]-=harga;
                tambah+=harga;
            }
            else{
                //cout<<"lala"<<endl;
                isi[a[urutan]]+=harga;
            }
        }
        else{
            levelA=tinggi[a[urutan]];
            levelB=tinggi[b[urutan]];
            if(levelA<levelB){
                isi[b[urutan]]+=harga;

            }
            else{
                isi[a[urutan]]-=harga;
                tambah+=harga;
            }
        }
    }
    cari(1,0,-1);
    for(i=1;i<=n;i++){
       // cout<<tinggi[i]<<"--"<<endl;
        printf("%lld\n",berat[i]+tambah);
    }

    return 0;
}


#define DEBUG
#define OPTIMIZE
//#define PBDS
//#define INTERACTIVE

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

const int MAXN = 1e3;
const int INF = 0x3f3f3f3f, MOD = 1000000007;
const long long LINF = LONG_LONG_MAX;
#define INIT(arr, val) fill(arr, arr+(int)(sizeof(arr)/sizeof(arr[0])), val)
#define REP(i, lb, rb, inc) for(int i = (lb); i < (rb); i += inc)
#define RREP(i, rb, lb, dec) for(int i = (rb)-1; i >= (lb); i -= dec)
typedef long long ll;
typedef queue<int> QI;
typedef vector<int> VI;
#define pb push_back
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define X real()
#define Y imag()
#define ALL(x) x.begin(), x.end()

#define OUT(x) {x; cout<<endl;}
#define READ(a, t) t a; cin >> a
#define println(x) cout << (x); cout << endl
#define READARR(arr, n) REP(___i, 0, (n), 1) cin >> arr[___i]
#define PRINTARR(arr, n) REP(___i, 0, (n), 1) cout << arr[___i] << " ";

#ifdef INTERACTIVE
#    define IOS()
#else
#    define endl '\n'
#    define IOS() cin.tie(0); cout.sync_with_stdio(0); cout.tie(0)
#endif

#ifdef DEBUG
#    define dbg(x) x
#else
#    define dbg(x)
#endif

#ifdef OPTIMIZE
#    pragma GCC optimize("unroll-loops")
#    pragma GCC optimize("O3")
#    pragma GCC optimize("Ofast")
#endif

#ifdef PBDS
#   include <bits/extc++.h>
    using namespace __gbu_pbds;
#endif

void NO() { cout << "-1\n"; exit(0); }

set<string> a;
vector<string> v;

signed main() {
	IOS();

	READ(n, int);
	REP(i, 0, n, 1) {
		READ(str, string);
		if (str[0] == '!') {
			a.insert(str);
		} else {
			v.pb(str);
		}
	}
	for(string str : v) {
		str = "!"+str;
		if (a.find(str) != a.end()) {
			cout << str.substr(1, str.size()-1) << endl;
			exit(0);
		}
	}
	cout << "satisfiable" << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
int main()
{
	SPEED
	int n;
	cin >> n;

	vector<string> clean;
	unordered_map<string, int> mp;

	for (int i = 0; i < n; ++i)
	{
		string s;
		cin >> s;

		if (s[0] == '!')
		{
			string s2 = "";
			for (int i = 1; i < s.size(); ++i)
			{
				s2 += s[i];
			}
			mp[s2]++;
		}
		else
		{
			clean.push_back(s);
		}
	}

	for (int i = 0; i < clean.size(); ++i)
	{
		if (mp.count(clean[i]))
		{
			cout << clean[i];
			return 0;
		}
	}

	cout << "satisfiable";

  	return 0;
}


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

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         cout<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define pw(b,p)         pow(b,p) + 0.1
#define endl            "\n"
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

void __print(int32_t x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

void fastIO()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

void solve()
{
    int n;
    cin>>n;
    int ar[n];

    for(int i=0;i<n;i++)
    {
        cin>>ar[i];
    }

    vector<pii> ans;

    ans.pb({0,ar[0]});

    for(int j=1;j<n;j++)
    {
        int sz = ans.size();

        for(int i=0;i<sz;i++)
        {
            ans.pb({ans[i].ff^ans[i].ss,ar[j]});
            //.//debug(ans[i]);
            ans[i].ss=ans[i].ss|ar[j];
            ///debug(ans[i]);
        }
        //debug(ans);
    }

    int ret = inf;

    for(pii i: ans)
    {
        //debug(i);
        ret = min(ret, i.ff^i.ss);
    }

    cout<<ret;
}

int32_t main()
{
    fastIO();
    //w(t)
    {
        solve();
        cout<<endl;
    }
    return 0;
}

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define mod              1000000000000007
#define ff              first
#define int             long long
#define pb              push_back

void c_p_c()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
}
int arr[21];
int orr[21][21];
void make_or(int n)
{
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      orr[i][j] = 0;
  for (int i = 0; i < n; i++)
  {
    int ans = 0;
    for (int j = i; j < n; j++)
    {
      ans = ans | arr[j];
      orr[i][j] = ans;
    }
  }

  return;
}

int32_t main()
{
  c_p_c();
  int n;
  cin >> n;

  for (int i = 0; i < n; i++)
    cin >> arr[i];
  make_or(n);

  int finland = mod;
  int val = pow(2, n) - 1;
  for (int rrr = 1; rrr <= val; rrr++)
  {
    int l = 0;
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
      if (rrr & (1 << i))
      {
        ans ^= orr[l][i];
        l = i + 1;
      }
    }
    if (l < n)
      ans ^= orr[l][n - 1];

    finland = min(finland, ans);
  }
  cout << finland << endl;
  return 0;
}


#line 2 "/Users/kaage/Desktop/ProgrammingWorkspace/library/other/template.hpp"
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx2")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define all(V) V.begin(),V.end()
typedef unsigned int uint;
typedef long long lint;
typedef unsigned long long ulint;
typedef std::pair<int, int> P;
typedef std::pair<lint, lint> LP;
constexpr int INF = INT_MAX/2;
constexpr lint LINF = LLONG_MAX/2;
constexpr double eps = DBL_EPSILON;
constexpr double PI=3.141592653589793238462643383279;
template<class T>
class prique :public std::priority_queue<T, std::vector<T>, std::greater<T>> {};
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
inline lint gcd(lint a, lint b) {
	while (b) {
		lint c = a;
		a = b; b = c % b;
	}
	return a;
}
inline lint lcm(lint a, lint b) {
	return a / gcd(a, b) * b;
}
bool isprime(lint n) {
	if (n == 1)return false;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0)return false;
	}
	return true;
}
template<typename T>
T mypow(T a, lint b) {
	T res(1);
	while(b){
		if(b&1)res*=a;
		a*=a;
		b>>=1;
	}
	return res;
}
lint modpow(lint a, lint b, lint m) {
	lint res(1);
	while(b){
		if(b&1){
			res*=a;res%=m;
		}
		a*=a;a%=m;
		b>>=1;
	}
	return res;
}
template<typename T>
void printArray(std::vector<T>& vec) {
	rep(i, vec.size()){
		std::cout << vec[i];
		std::cout<<(i==(int)vec.size()-1?"\n":" ");
	}
}
template<typename T>
void printArray(T l, T r) {
	T rprev = std::prev(r);
	for (T i = l; i != rprev; i++) {
		std::cout << *i << " ";
	}
	std::cout << *rprev << std::endl;
}
LP extGcd(lint a,lint b) {
	if(b==0)return {1,0};
	LP s=extGcd(b,a%b);
	std::swap(s.first,s.second);
	s.second-=a/b*s.first;
	return s;
}
LP ChineseRem(const lint& b1,const lint& m1,const lint& b2,const lint& m2) {
	lint p=extGcd(m1,m2).first;
	lint tmp=(b2-b1)*p%m2;
	lint r=(b1+m1*tmp+m1*m2)%(m1*m2);
	return std::make_pair(r,m1*m2);
}
template<typename F>
inline constexpr decltype(auto) lambda_fix(F&& f){
	return [f=std::forward<F>(f)](auto&&... args){
		return f(f,std::forward<decltype(args)>(args)...);
	};
}
#line 2 "main.cpp"
int N,M,w[8],l[100010],v[100010];
std::vector<P> vec;
int main(){
	std::cin>>N>>M;
	rep(i,N)std::cin>>w[i];
	rep(i,M){
		std::cin>>l[i]>>v[i];
		vec.emplace_back(v[i],l[i]);
	}
	if(*std::min_element(v,v+M)<*std::max_element(w,w+N)){
		puts("-1");
		return 0;
	}
	vec.emplace_back(0,0);
	std::sort(all(vec));
	rep(i,M)chmax(vec[i+1].second,vec[i].second);
	std::vector<int> pm(N);
	std::iota(all(pm),0);
	int ans=INF;
	do{
		std::vector<int> dp(N);
		rep(i,N-1){
			int weight=w[pm[i]];
			for(int j=i+1;j<N;j++){
				weight+=w[pm[j]];
				chmax(dp[j],dp[i]+std::prev(std::lower_bound(all(vec),P{weight,0}))->second);
			}
		}
		chmin(ans,dp[N-1]);
	}while(std::next_permutation(all(pm)));
	std::cout<<ans<<std::endl;
	return 0;
}

#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr ll LLINF {1001002003004005006};//ll = 9*LLINF
constexpr int INTINF {1000000000};//int = 2*INTINF

#define  rep(i,n)   for(int i = 0; i < (n); ++i)
#define rrep(i,n)   for(int i = 1; i <= (n); ++i)
#define drep(i,n)   for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for(int i = s; i < t;  ++i)

template<typename T>
void maxs(T& x, T&& y) {
  x=std::max(x,y);
}
template<typename T>
void maxs(T& x, T& y) {
  x=std::max(x,y);
}

template<typename T>
void mins(T& x, T&& y) {
  x=std::min(x,y);
}
template<typename T>
void mins(T& x, T& y) {
  x=std::min(x,y);
}

int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  ll n; cin >> n;
  const std::string S {"110"};
  std::string T; cin >> T;
  constexpr ll const_n {30000000000};
  //constexpr ll const_n {3};

  ll ans {};

  rep(i, 3) {
    bool is_find {true};
    rep(j, n) {
      if (T[j] != S[(i+j)%3]) {
        is_find = false;
        break;
      }
    }
    if (is_find == true) {
      ans += (const_n - n- i) / S.size() + 1;
    }
  }
  cout << ans << '\n';
}


#include<iostream>
using namespace std;
int main()
{
  int m, h;
  cin >> m >> h;
  if(h % m == 0)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}

#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define mp make_pair
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define w(x) int x;cin>>x;while(x--)
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pair<int,int>>
#define vvi vector<vector<int>>
#define precision(x,k) fixed<<setprecision(k)<<x
#define inf 1e16
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>ordered_set;
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
int m,k;
cin>>m>>k;
if(k%m==0)
cout<<"Yes\n";
else
cout<<"No\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i =0; i <(n); i++)
using ll = long long;
int main(){
    int a,b;
    cin >> a >> b;
    cout << (double)(a-b)/a*100;
}

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

int main() {
     double a , b; cin>>a>>b;
     scanf("%lf%lf" , &a,&b);
     double ans = (a - b)/a;
     ans = (ans  * 100.0);
     printf("%.7f" , ans);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long   ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<pair<int,int>> vpi;
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define pb    push_back
#define rev(i,a,b) for(int i=a;i<b;i++)
#define sz(a)   (int)a.size()
#define all(a)  a.begin(),a.end()
#define fast  ios_base::sync_with_stdio(false);cin.tie(NULL);
const ll mod=1e9+7;//cout<<fixed<<setprecision(15);
ll exp(ll x,ll y){;ll res=1;while(y){if(y &1)res=res*x;x=x*x;y>>=1;}return res;}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return (a/gcd(a,b) * b);}
bool prime(ll n){if(n<2)return 0;for(int i=2;i*i<=n;i++)if(n%i==0)return 0;return 1;}

int main()
{
    fast;
    int T=1;
    //cin>>T;
    while(T--)
    {
        ll n;
        cin>>n;
        int s=log2(n);
        ll ans=1e18;
        for(ll b=s;b>=0;b--)
        {
            ll a=n/exp(2,b);
            ll c=n-a*exp(2,b);
            ans=min(ans,a+b+c);
        }
        cout<<ans<<endl;
    }
}

// D - Circle Lattice Points
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using dbl = long double;

ll MAX = 2e9, scale = 1e4;
ll X, Y, R;

ll in(){
	dbl x; cin>>x;
	return round(x*scale);
}

ll lo_bin(ll dy2){
	ll ok = X;
	ll ng = -(MAX + 1);
	while(ok - ng > 1){
		ll x = (ok + ng) / 2;
		ll dx = x - X;
		if(dy2 + dx*dx <= R*R) ok = x;
		else ng = x;
	}
	// cout<<" ok "<<ok<<"\n";
	return ok;
}

ll hi_bin(ll dy2){
	ll ok = X;
	ll ng = MAX + 1;
	while(ng - ok > 1){
		ll x = (ok + ng) / 2;
		ll dx = x - X;
		if(dy2 + dx*dx <= R*R) ok = x;
		else ng = x;
	}
	return ok;
}

int main(){
	X = in(), Y = in(), R = in();
	ll ans = 0;
	for(ll y=-MAX; y<=MAX; y+=scale){
		ll dy = y - Y;
		ll dy2 = dy*dy;
		if(R*R - dy2 < 0) continue;
		ans += floor(hi_bin(dy2) / (dbl)scale)
		 - ceil(lo_bin(dy2) / (dbl)scale) + 1;
	}
	cout<< ans <<endl;
}


#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,m; cin >> n >> m;
    vector<vector<pair<int,int>>> g(n);
    vector<int> c(m),d(m);
    for(int i=0;i<m;i++){
        int x,y; cin >> x >> y;
        x--,y--;
        g[x].push_back({y,i});
        g[y].push_back({x,i});
        cin >> c[i] >> d[i];
    }
    vector<ll> dp(n,1e18);
    dp[0]=0;
    priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> pq;
    pq.push({0,0});
    auto cost=[&](int j,ll ti)->ll{
        ll res=d[j]/(ti+1);
        ll p=sqrt(d[j]);
        for(ll T=max(ti,p-15);T<=p+15;T++){
            res=min(res,T-ti+d[j]/(T+1));
        }
        return res+c[j];
    };
    while(pq.size()){
        auto p=pq.top(); pq.pop();
        if(dp[p.second]!=p.first)continue;
        int s=p.second;
        for(auto to:g[s]){
            ll c=cost(to.second,p.first);
            int t=to.first;
            if(dp[t]>c+p.first){
                dp[t]=c+p.first;
                pq.push({dp[t],t});
            }
        }
    }
    if(dp[n-1]==1e18)dp[n-1]=-1;
    cout << dp.back() << endl;
}

#include <bits/stdc++.h>
#define REP(i, nn ) for(int i = 0 ; i < (int) nn; i++)
#define REPS(i, ss, nn ) for(int i = ss ; i < (int) nn; i++)
#define REV(i, ss, nn ) for(int i = ss ; i >= nn; i--)
#define deb(x) std::cout << #x << " " << x << endl;
#define debl(x) std::cout << #x << " " << x << " ";
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace std{
    template<class Fun>
    class y_combinator_result{
        Fun fun_;
        public:
            template<class T>
            explicit y_combinator_result(T &&fun) : fun_(std::forward<T>(fun)){}
            template<class ...Args>
            decltype(auto) operator()(Args&&...args){
                return fun_(std::ref(*this), std::forward<Args>(args)...);
            }
    };
    template<class Fun>
    decltype(auto) y_combinator(Fun && fun){
        return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
    }
};
template<typename T>
bool umax(T& a, T b){
    bool ret = a < b;
    if(ret) a = b;
    return ret;
}
template<typename T>
bool umin(T& a, T b){
    bool ret = a > b;
    if(ret) a = b;
    return ret;
}
struct edge{
    int to; ll cost;
    int from;
    edge(){ edge(0,0);}
    edge(int to_, ll cost_) : to(to_), cost(cost_){}
    edge(int to_, int from_, ll cost_) : to(to_), cost(cost_), from(from_){}
};

template<typename... T>
void read(T& ... a){
    ((cin >> a),...);
}

template<typename... T>
void write(T... a){
    ((cout << a),...);
}

template<typename T>
vector<T> read_array(int sz){
    vector<T> ret(sz);
    for(auto & x : ret) cin >> x;
    return ret;
}

int m, n;
constexpr int mxN = 1e5;
vector<array<ll,3>> adj[mxN];
ll dist[mxN];

ll f(ll d, ll t0, ll x){
    return t0 + x + d / (t0 + 1 + x);
}

ll best_time(ll d, ll t0){
    ll left = ceil(sqrtl(d));
    ll ans =  f(d, t0, 0);

    for(ll x = max(0ll, left - 10) ; x <= left + 10; x++){
        umin(ans, f(d, t0, x));
    }
    return ans;
}

void solve(){
    read(n, m);
    REP(i, m){
        ll a, b, c, d;
        read(a, b, c, d);
        a--; b--;
        // if(a == b) continue;
        adj[a].push_back({b, c, d});
        adj[b].push_back({a, c, d});
    }
    ll INF = 3e14;
    REP(i, n) dist[i] = INF;
    dist[0] = 0;
    set<pair<ll,ll>> st;
    st.insert({dist[0], 0});
    while(st.size()){
        auto [t, idx] = *st.begin();
        st.erase(st.begin());
        if(dist[idx] < t) continue;
        // debl(idx) deb(t)
        for(auto edge : adj[idx]){
            auto [nxt, c, d] = edge;
            ll best = best_time(d, t);
            best += c;
            if(best < dist[nxt]){
                dist[nxt] = best;
                st.insert({dist[nxt], nxt});
            }
        }
    }
    if(dist[n-1] >= INF){
        write(-1);
        return;
    }
    write(dist[n-1]);
}
int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/
    int T = 1;
    // cin >> T;
    while(T--)
        solve();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int v, t, s, d;
int main() {
    cin >> v >> t >> s >> d;
    if (d >= v * t && d <= v * s) puts("No");
    else puts("Yes");
    return 0;
}

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

int main()
{
    ll a,b,c,d;

    cin >> a >> b >> c>>d;

    cout << min({a,b,c,d}) << endl;
}


#include <bits/stdc++.h>

#define ll                  long long int
#define pii                 pair<ll,ll>
#define vi                  vector<ll>
#define mii                 map<ll,ll>
#define pb                  push_back
#define mp                  make_pair
#define fi                  first
#define se                  second
#define mod                 1000000007
#define inf                 1e18
#define endl 		        "\n"
#define ps(x,y)             fixed<<setprecision(y)<<x
#define all(x)              (x).begin(),(x).end()
#define FOR(i, j, k, in)    for (ll i=j ; i<k ; i+=in)
#define RFOR(i, j, k, in)   for (ll i=j ; i>k ; i-=in)

using namespace std;

bool bysec(const pair<string,ll> &a, const pair<string,ll> &b)
{
    return (a.second < b.second);
}

bool rev(ll a, ll b)
{
    return a > b;
}

void solve()
{
    ll a[3];

    cin>>a[0]>>a[1]>>a[2];

    sort(a,a+3);

    cout<<a[1]+a[2];
}

int main() {

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t = 1;
    //cin>>t;

    while(t--)
    	solve();

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define vi vector<int>
#define vc vector<char>
bool cmp(ll a,ll b)
{
    return a>b;
}

ll lcm(ll n,ll m)
{
    return (n*m)/__gcd(n,m);
}

bool status[10000+ 1];
vi v,vp;
void siv()
{
    ll N= 10000;
    for (int i = 2; i*i <= N; i++)
    {
        if (status[i] == 0)
        {
            for (int j = i * i; j <= N; j += i)
                status[j] = 1;
        }
    }

    status[1] = 1;
    for(int i=2; i<=N; i++)
    {
        if(status[i]==0)
            v.pb(i);
    }
}

int main()
{

     int t,i,n,k,y,j,c1,c2,h,q,l,m,r,x,c;
     cin>>h>>q>>y;
     ll s=0;
     s+=h;
     s+=q;
     s+=y;
     s-=min(h,min(q,y));
     cout<<s;

}


#include <bits/stdc++.h>
#define int int
#define maxn 800005
#define mod 3
using namespace std;
int n;
char r[maxn];
char get_char(){
    char ch = getchar();
    while(ch != 'W' && ch != 'B' && ch != 'R')    ch = getchar();
    return ch;
}
int jc[maxn], inv[maxn];
int qpow(int a, int b, int p){
    if(b == 0)    return 1;
    int tmp = qpow(a, b / 2, p);
    tmp = (tmp * tmp) % p;
    if(b & 1)   tmp = (tmp * a) % p;
    return tmp;
}
void get_jc(){
    jc[0] = 1;
    for(int i = 1; i <= n; i++)
        jc[i] = (jc[i - 1] * i);
}
int C(int a, int b, int p) {
    if (b < a)    return 0;
    int s = jc[a] * jc[b - a] % p;
    return jc[b] * qpow(s, p - 2, p) % p;
}

int lucas(int x, int y, int p) {
    if (x == 0)    return 1;
    return lucas(x / p, y / p, p) * C(x % p, y % p, p) % p;
}

int tra(char ch){
    //putchar(ch);
    if(ch == 'B')    return 1;
    if(ch == 'W')    return 2;
    if(ch == 'R')    return 0;
    return -1;
}
signed main(void)
{
    scanf("%lld", &n);
    for(int i = 1; i <= n; i++)
        r[i] = get_char();
    get_jc();
    int res = 0;
    for(int i = 0; i <= n - 1; i++)
    {
        res = (res + tra(r[i + 1]) * lucas(i, n - 1, mod)) % mod;
        //printf("%d\n", res);
    }
    if((n + 1) & 1)
        res = -res;
    res = ((res % mod) + mod) % mod;
    if(res == 1)
        printf("B\n");
    else if(res == 2)
        printf("W\n");
    else
        printf("R\n");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll fac3[400005];
ll fac[400005];
ll N;
string s;
void init_(){
    fac3[0]=0;fac[0]=1;
    for(ll i=1;i<400005;i++){
        ll x=0;ll I=i;
        while(I%3==0){
            I/=3;x++;
        }fac3[i]=fac3[i-1]+x;
        fac[i]=(fac[i-1]*I)%3;
    }
}
int main(){
cin>>N>>s;
ll sum=0;init_();
for(ll i=0;i<N;i++){
    if(fac3[N-1]-fac3[i]-fac3[N-1-i]!=0)
    continue;
    ll x=(fac[N-1]*fac[i]*fac[N-1-i])%3;
    if(s[i]=='W')x=0;
    else if(s[i]=='R'){}else x=(2*x)%3;
    if(N%2==0)x=(3-x)%3;
    sum=(sum+x)%3;

}if(sum==0)cout<<"W"<<endl;
else if(sum==1)cout<<"R"<<endl;
else cout<<"B"<<endl;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
#include <assert.h>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
long double pie = acos(-1) ;
ll INF = 1e18 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
ll extGCD(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x = 1 ;
        y = 0 ;
        return a ;
    }
    ll d = extGCD(b,a%b,y,x) ;
    y -= a/b*x ;
    return d ;
}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T b){if(a>b) a = b ;}

int main(){
    ll n ; cin >> n ;
    V<pair<ll,ll>> f(88) ;
    f[0] = {0,0} ;
    f[1] = {1,0} ;
    for(int i=2;i<88;i++){
        f[i].first = f[i-1].first+f[i-1].second ;
        f[i].second = f[i-1].first ;
    }
    V<bool> use(88,false) ;
    ll m = n ;
    for(int i=87;i>0;i--){
        if(m>=f[i].first){
            use[i] = true ;
            m -= f[i].first ;
        }
    }
    int t = 0 ;
    V<int> ans ;
    pair<ll,ll> cur(0,0) ;
    while(cur.first!=n){
        if(use[87-t]){
            if(t&1){
                ans.push_back(2) ;
                cur.second++ ;
            }else{
                ans.push_back(1) ;
                cur.first++ ;
            }
        }
        if(t&1){
            ans.push_back(4) ;
            cur.second += cur.first ;
        }else{
            ans.push_back(3) ;
            cur.first += cur.second ;
        }
        t++ ;
    }
    reverse(all(ans)) ;
    for(int i=(int)ans.size()-1;i>=0;i--){
        if(ans[i]<=2) break ;
        ans.pop_back() ;
    }
    reverse(all(ans)) ;
    cout << ans.size() << endl ;
    for(auto i:ans) cout << i << endl ;
}


#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using llu = unsigned long long;
using ld = long double;

#define CEIL(x, y) (ll)ceil((ld)(x) / (ld)(y))

#define dbgPR(ds) cout << ds.first << ' ' << ds.second
#define dbgLST(ds) for(auto it : ds) cout << it << ' '
#define dbgMP(ds) for(auto it : ds) cout << it.first << ' ' << it.second << '\n'

const double PI = acos(-1.0), g = 9.80665;
const bool unseen = 0;
const ll inf = 1e18 + 505, ninf = -1e18 - 505;
const int MOD = 1000000007;

void solve(void)
{
	ll n, k;
	cin >> n >> k;

	map<ll, ll> mp;

	for(int i = 0; i < n; i++) {
		ll a, b;
		cin >> a >> b;
		mp[a] += b;
	}

	ll ans = k;
	for(auto it : mp) {
		if(ans >= it.first) {
			ans += it.second;
		}
		else break;
	}

	cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int testcase = 1;
    // cin >> testcase;
    while(testcase--) {
        solve();
    }
    return 0;
}

#include <iostream>
#include <vector>
#include  <numeric>
#include<cstdlib>
#include <map>
#include <algorithm>    // std::random_shuffle
#define INF (1<<30)
#define ll long long
using namespace std;

int main() {
    int N;
    cin>>N;
    ll K;
    cin>>K;
    vector<pair<ll,ll>> AB;
    for(int i=1;i<=N;i++) {
        AB.push_back({-1,-1});
        cin>>AB.back().first>>AB.back().second;
    }
    sort(AB.begin(),AB.end());

    ll curr = 0;
    for(int i=0;i<AB.size();i++) {
        ll id = AB[i].first;
        ll B = AB[i].second;
        if (id - curr <= K) {
            K -= id-curr;
            K += B;
            curr = id;
        } else {
            break;
        }
    }

    curr += K;
    cout << curr << endl;

}


#include<bits/stdc++.h>
#define LL long long
#define dl double
template <class T>
void rd(T &x){
    x=0;T f=1;char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch<='9' && ch>='0'){x=x*10+ch-'0';ch=getchar();}x*=f;
}

using namespace std;

int main(){
    // freopen("in.txt","r",stdin);
    // freopen("o.txt","w",stdout);
    LL n;
    rd(n);
    LL l = 1,r = n + 1;
    while(l != r){
        LL mid = (l + r) / 2 + 1;
        __int128 a1 = 1;
        a1 = a1 * (n + 1 - mid + 1) * (mid + n + 1) / 2;
        __int128 a2 = 1;
        a2 = a2 * n * (n + 1) / 2;
        if(a1 < a2)r = mid - 1;
        else l = mid;
    }
    cout << n + 1 - l + 1 << endl;
    return 0;
}
/**/

#include<bits/stdc++.h>

using namespace std;

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

using ll = long long;
using P = pair<int,int>;
using mp =  map<int,int>;

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

int main(){

    int k;
    cin >> k;

    ll ans = 0;
    for(int i = 1; i <= k; i++){
        for(int j = 1; j <= k / i; j++){
            //cout << i << " " << j <<  " " << (int)(k / (i * j)) << "\n";
            int tmp = k / (i * j);
            ans += tmp;
        }
    }

    cout << ans << "\n";

    return 0;
}