#include <bits/stdc++.h>
#define maxn 100005
#define INF 9223372036854775807LL
using namespace std;
using Road = tuple<int, int, int>;
using LL = long long;
using pli = pair<LL, int>;
vector<Road> G[maxn];
LL dist[maxn];
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	while(m--)
	{
		int a, b, c, d;
		scanf("%d%d%d%d", &a, &b, &c, &d);
		if(--a == --b) continue;
		G[a].emplace_back(b, c, d);
		G[b].emplace_back(a, c, d);
	}
	dist[0] = 0LL;
	for(int i=1; i<n; i++) dist[i] = INF;
	priority_queue<pli, vector<pli>, greater<pli>> q;
	q.emplace(0LL, 0);
	while(!q.empty())
	{
		auto [t, u] = q.top(); q.pop();
		if(dist[u] != t) continue;
		for(auto [v, c, d]: G[u])
		{
			LL t2 = sqrt((long double) d) - 0.5;
			if(t2 < t) t2 = t;
			t2 += LL(c) + LL(d) / (t2 + 1LL);
			if(t2 < dist[v])
				q.emplace(dist[v] = t2, v);
		}
	}
	if(dist[n - 1] == INF) puts("-1");
	else printf("%lld\n", dist[n - 1]);
	return 0;
}

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)
#define uid(a, b) uniform_int_distribution<int>(a, b)(rng)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

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

const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy

void solve() {

    int N, S, D; cin >> N >> S >> D;
    F0R(i, N) {
        int X, Y; cin >> X >> Y;
        if (X < S && Y > D) {
            cout << "Yes" << nl; return;
        }
    }
    cout << "No" << nl;

}

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

    int T = 1;
//    cin >> T;
    while(T--) {
        solve();
    }

	return 0;
}

// read the question correctly (ll vs int)
// template by bqi343


//SKD
// 16 32 108
#include<bits/stdc++.h>
#define ll long long int
#define pp push_back
#define pi 2*acos(0.0)
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout<<fixed;
    cout<<setprecision(9);
    double m=0,p=0,l,q=0,r=0,t;
    int n,k,i,j;

        cin>>n;ll a[n],b[n];k=0;
        for(i=0; i<n; i++)cin>>a[i]>>b[i];
        for(i=0; i<n-1; i++)
        {
            for(j=i+1; j<n; j++)
            {
                l=b[j];q=b[i];t=a[i];r=a[j];
                p=(l-q)/(t-r);
                if(p>=-1 && p<=1)k++;
            }
        }
       cout<<k;
}

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n;
  R n;
  P a[n];
  rep(i,n) cin >> a[i].F >> a[i].S;
  ll ans=0;
  rep(i,n) {
    REP(j,i+1,n) {
      ll x=abs(a[i].F-a[j].F),y=abs(a[i].S-a[j].S);
      if(x>=y) ans++;
    }
  }
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
template<class in_chmax> void chmax(in_chmax &x, in_chmax y) {x = max(x,y);}
template<class in_chmin> void chmin(in_chmin &x, in_chmin y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

ll H, W;
vector<string> A;

bool is_Takahashi(ll i, ll j) {return (i+j)%2==0;}

void init() {
    cin >> H >> W;
    A.resize(H);
    rep(i,H) cin >> A[i];
}

int main() {
    init();
    vector<vector<ll>> dp(H,vector<ll>(W));
    rep(i,H) rep(j,W) {
        if (is_Takahashi(i,j)) dp[i][j] = -inf;
        else dp[i][j] = inf;
    }
    dp[H-1][W-1] = 0;
    for (ll i=H-1; i>=0; i--) for (ll j=W-1; j>=0; j--) {
        ll add = 0;
        if (is_Takahashi(i,j)) {
            if (i+1<H) {
                if (A[i+1][j]=='+') add = 1;
                else add = -1;
                chmax(dp[i][j],dp[i+1][j]+add);
            }
            if (j+1<W) {
                if (A[i][j+1]=='+') add = 1;
                else add = -1;
                chmax(dp[i][j],dp[i][j+1]+add);
            }
        } else {
            if (i+1<H) {
                if (A[i+1][j]=='+') add = -1;
                else add = 1;
                chmin(dp[i][j],dp[i+1][j]+add);
            }
            if (j+1<W) {
                if (A[i][j+1]=='+') add = -1;
                else add = 1;
                chmin(dp[i][j],dp[i][j+1]+add);
            }
        }
    }

    ll x = dp[0][0];
    if (x>0) Cout("Takahashi");
    else if (x==0) Cout("Draw");
    else Cout("Aoki");
}

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

#define pb push_back
#define FOR(i,f,n) for(int i=f;i<n;i++)
#define FORI(i,f,n) for(int i=f;i>=n;i--)
#define sz(a) ((int)(a).size())
#define ff first
#define ss second
#define all(a) (a).begin(),(a).end()
#define alli(a) (a).rbegin(),(a).rend()
#define approx(a) fixed<<setprecision(a)
#define trav(a,x) for(auto& a : x)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,bool> pib;
typedef pair<ll,bool> plb;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<ld> vld;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
template <class T> void ckmin(T &a, const T &b) { a = min(a, b); }
template <class T> void ckmax(T &a, const T &b) { a = max(a, b); }

template <class T> void read(vector<T> &v);
template <class F, class S> void read(pair<F, S> &p);
template <class T> void read(T &x) {cin>>x;}
template <class R, class... T> void read(R& r, T&... t){read(r); read(t...);};
template <class T> void read(vector<T> &v) {trav(x, v) read(x);}
template <class F, class S> void read(pair<F, S> &p) {read(p.ff, p.ss);}

template <class F, class S> void pr(const pair<F, S> &x);
template <class T> void pr(const T &x) {cout<<x;}
template <class R, class... T> void pr(const R& r, const T&... t) {pr(r); pr(t...);}
template <class F, class S> void pr(const pair<F, S> &x) {pr("{", x.ff, ", ", x.ss, "}");}
void ps() {pr("\n");}
template <class T> void ps(const T &x) {pr(x); ps();}
template <class T> void ps(vector<T> &v) {trav(x, v) pr(x, ' '); ps();}
template <class F, class S> void ps(const pair<F, S> &x) {pr(x.ff, ' ', x.ss); ps();}
template <class R, class... T> void ps(const R& r,  const T &...t) {pr(r, ' '); ps(t...);}

const int mod = 998244353;

void solve(){
    int n, k; read(n, k);
    vector<vl> dp(n+1, vl(2*n+1));
    dp[1][1] = 1;
    FOR(i,2,n+1){
        FORI(j,n,1){
            dp[i][j] = (dp[i-1][j-1] + dp[i][2*j]) % mod;
        }
    }
    ps(dp[n][k]);
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll; typedef double db;
typedef pair<int, int> pii; typedef pair<ll, ll> pll;
typedef vector<int> vi; typedef vector<ll> vl;
typedef vector<pii> vpii; typedef vector<pll> vpll;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FOR0(n) for(int i=0;i<n;++i)
#define FOR1(n) for(int i=1;i<=n;++i)
ll gcd(ll a, ll b) { return a % b ? gcd(b, a % b) : b; }
const ll mod = 1e9 + 7; const ll inf = 0x3f3f3f3f;
ll qpow(ll a, ll b) { ll t = 1; while (b != 0) { if (b & 1)t = (t * a) % mod; a = (a * a) % mod; b >>= 1; }return t; }
template <typename T>
void re(T& a) { for (auto& t : a)cin >> t; }
template <typename T>
void pr(T& a) { for (auto& t : a)cout << t << "  "; cout << endl; }

void solve() {
	vi a(3);
	re(a);
	sort(a.begin(), a.end());
	if (a[0] == a[1])cout << a[2];
	else if (a[1] == a[2])cout << a[0];
	else cout << 0;
}

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int T = 1;
	//cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
#define rep(i, a, b) for (int i = a; i < (int)(b); i++)
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() {
    int a, b, c;
    cin >> a >> b >> c;
    int ans;
    if(a==b) ans = c;
    else if(b==c) ans = a;
    else if(c==a) ans = b;
    else ans = 0;

    cout << ans << endl;

    return 0;
}


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

#define vt vector
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()
#define ll long long
#define ld long double
#define ar array
#define inf() ifstream cin("d.txt")
#define onf() ofstream cout("test.txt")
#define mod 1000000007
#define pb push_back
#define endl cout<<"\n";
#define prt1(a) cout<<a<<" "
#define prt2(a,b) cout<<a<<" "<<b<<" "
#define prt3(a,b,c) cout<<a<<" "<<b<<" "<<c<<" "
#define in(a) cin>>a
#define inn(a,b) cin>>a>>b
#define innn(a,b,c) cin>>a>>b>>c
#define rep(i,st,end) for(int i=st;i<end;i++)
#define repv(i,st,end) for(int i=st;i>=end;i--)
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define TEST ll tc;cin>>tc;while(tc--)
#define EACH(x, a) for (auto& x: a)

template<class A> void read(vt<A>& v);
template<class A, size_t S> void read(ar<A, S>& a);
template<class T> void read(T& x) {
    cin >> x;
}
void read(double& d) {
    string t;
    read(t);
    d=stod(t);
}
void read(long double& d) {
    string t;
    read(t);
    d=stold(t);
}
template<class H, class... T> void read(H& h, T&... t) {
    read(h);
    read(t...);
}
template<class A> void read(vt<A>& x) {
    EACH(a, x)
        read(a);
}
template<class A, size_t S> void read(array<A, S>& x) {
    EACH(a, x)
        read(a);
}
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a <<"\n";
    err(++it, args...);
}

void solve()
{
    ll a,b,c,d;
    read(a,b,c,d);
    double x = ((a*d) + (b*c))/((b+d)*1.0);
    cout<<fixed <<setprecision(9)<<x;

}

 int main()
 {
    clock_t start, end;
    start = clock();
    fio;
    ll k = 1;
    ll tc = 1;
    //cin>>tc;
    while(tc--){
       // cout<<"Case #"<<k<<": ";k++;
        solve();
        endl;
    }
     double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
    // debug(time_taken);

 }

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cctype>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <stdio.h>
#include <string>
#include <sstream>
#include <stack>
#include <set>
#include <vector>

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

const int AAA = 1000000007;

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pairII;
typedef vector<int> vecI;

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;
}
ll powD(ll a, ll b) {
	ll ans = 1;
	a %= AAA;
	for (int i = 0; i < b; i++)
	{
		ans *= a;
		ans %= AAA;
	}
	return ans;
}

vecI input(int N) {
	int i;
	vecI A(N);
	rep(i, 0, N) {
		cin >> A[i];
	}
	return A;
}

int main(int argc, char* argv[]) {
	int i, j;
	int N, M, K;

	double Sx, Sy, Gx, Gy;
	cin >> Sx >> Sy >> Gx >> Gy;
	double k = (-Gy - Sy) / (Gx - Sx);
	double ans = Sx - Sy / k;
	printf("%.12f", ans);

	return 0;
}


#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <cassert>
#include <functional>

using ll = long long;
using namespace std;

template<typename A, typename B>
bool chmin(A &a, const B b) {
  if (a <= b) return false;
  a = b;
  return true;
}

template<typename A, typename B>
bool chmax(A &a, const B b) {
  if (a >= b) return false;
  a = b;
  return true;
}

#ifndef LOCAL
#define debug(...) ;
#else
#define debug(...) cerr << __LINE__ << " : " << #__VA_ARGS__ << " = " << _tostr(__VA_ARGS__) << endl;

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v);

template<typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}

void _tostr_rec(ostringstream &oss) {
  oss << "\b\b \b";
}

template<typename Head, typename... Tail>
void _tostr_rec(ostringstream &oss, Head &&head, Tail &&...tail) {
  oss << head << ", ";
  _tostr_rec(oss, forward<Tail>(tail)...);
}

template<typename... T>
string _tostr(T &&...args) {
  ostringstream oss;
  int size = sizeof...(args);
  if (size > 1) oss << "{";
  _tostr_rec(oss, forward<T>(args)...);
  if (size > 1) oss << "}";
  return oss.str();
}
#endif

constexpr int mod = 1'000'000'007; //1e9+7(prime number)
constexpr int INF = 1'000'000'000; //1e9
constexpr ll LLINF = 2'000'000'000'000'000'000LL; //2e18
constexpr int SIZE = 200010;

// {a, {b, c}} : a = gcd(p, q) = bp + cq
pair<ll, pair<ll, ll>> ext_gcd(ll p, ll q) {
  if (q == 0) return {p, {1, 0}};
  auto r = ext_gcd(q, p % q);
  return {r.first, {r.second.second, r.second.first - p / q * r.second.second}};
}

/* 中国剰余定理 */

pair<ll, ll> CRT(ll a1, ll m1, ll a2, ll m2) {
  auto eg = ext_gcd(m1, m2);
  ll d = eg.first;
  if ((a2 - a1) % d) return {0, -1};
  ll m = m1 / d * m2;
  ll r = ((a1 + m1 * ((__int128_t)(a2 - a1) / d * eg.second.first % (m2 / d))) % m + m) % m;
  return {r, m};
}

void solve() {
  ll X, Y, P, Q;

  cin >> X >> Y >> P >> Q;

  ll ans = LLINF;

  for (int i = 0; i < Y; i++) {
    for (int j = 0; j < Q; j++) {
      auto r = CRT(X + i, (X + Y) * 2, P + j, P + Q);

      if (r.second != -1) {
        debug(X + i, r);
        chmin(ans, r.first);
      }
    }
  }

  if (ans == LLINF)
    puts("infinity");
  else
    printf("%lld\n", ans);
}

int main() {
  int T;

  cin >> T;

  while (T--) solve();

  return 0;
}

#include<bits/stdc++.h>
using namespace std;
const long long mod=998244353,INF=1e18;
#define ll long long
#define line cout<<"\n";
#define flush cout<<endl;
#define pll pair<ll,ll>
#define x first
#define y second
#define p_all(arr) for(auto i:arr){cout<<i<<" ";}cout<<"\n";
ll power(ll u,ll v)
{
    ll res=1;
    while(v)
    {
        if(v&1)
        {
            res=(res*u)%mod;
        }
        u=(u*u)%mod;
        v>>=1;
    }
    return res;
}
ll modInv(ll u)
{
    return power(u,mod-2);
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    ll t=1;
    // cin>>t;
    for(ll test=1;test<=t;test++)
    {
        ll n,m;
        cin>>n>>m;
        if(m%2)
        {
            cout<<"0\n";
            continue;
        }
        vector<ll> fac(5005),facInv(5005);
        fac[0]=facInv[0]=1;
        for(ll i=1;i<=5000;i++)
        {
            fac[i]=(i*fac[i-1])%mod;
            facInv[i]=modInv(fac[i]);
        }
        ll dp[2][5005];
        memset(dp,0,sizeof(dp));
        dp[1][0]=1;
        auto nCr=[&](ll u,ll v)
        {
            if(u<v)
            return 0LL;
            ll res=fac[u];
            res=(res*facInv[v])%mod;
            res=(res*facInv[u-v])%mod;
            return res;
        };
        ll set=0;
        for(int i=0;(1<<i)<=m;i++)
        {
            for(int j=0;j<=n;j+=2)
            {
                ll tot=(1<<i)*j;
                for(int k=0;(k+tot)<=m;k++)
                {
                    dp[set][k+tot]=(dp[set][k+tot]+dp[1-set][k]*nCr(n,j))%mod;
                }
            }
            set^=1;
            for(int j=0;j<=n;j+=2)
            {
                for(int k=0;k<=m;k++)
                dp[set][k]=0;
            }
        }
        cout<<dp[1-set][m]<<"\n";
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define pb push_back
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
typedef vector<int> vi;
using ll = long long;
typedef pair<int, int> pii;
typedef unsigned long long ul;

const int mn = 200005;
const int mk = 302;
const int mod = 998244353;
int n, k;
ll a[mn][mk];
ll s[mk];

ll powmod(ll a, ll b, ll P) {
	ll t = 1;
	for (; b; b >>= 1, a = a * a % P)
		if (b & 1) t = t * a % P;
	return t;
}

ll C[mk][mk];

inline void modp(ll &ans) {
	ans %= mod;
	if (ans < 0) ans += mod;
}

ll inv2 = 499122177;

int main() {
	//cin.sync_with_stdio(0);
#ifdef LOCAL
	freopen("../1.txt", "r", stdin);
	//freopen("../2.txt", "w", stdout);

	auto st = chrono::system_clock::now();
#endif

	C[0][0] = 1;
	for (int i = 1; i <= 300; i++) {
		C[i][0] = 1;
		for (int j = 1; j <= i; j++) {
			C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
		}
	}

	scanf("%d%d", &n, &k);
	for (int i = 1; i <= n; i++) {
		a[i][0] = 1;
		s[0] += 1;
		scanf("%lld", &a[i][1]);
		s[1] += a[i][1];
		for (int j = 2; j <= k; j++) {
			a[i][j] = a[i][1] * a[i][j - 1] % mod;
			s[j] += a[i][j];
		}
	}
	for (int i = 1; i <= k; i++) s[i] %= mod;

	for (int x = 1; x <= k; x++) {
		ll ans = 0;
		for (int i = 0; i <= x; i++) {
			ll sum = (s[i] * s[x - i] - s[x]) % mod * C[x][i] % mod;
			ans += sum;
		}
		ans %= mod;
		ans *= inv2;
		modp(ans);
		printf("%lld\n", ans);
	}

#ifdef LOCAL
	auto ed = chrono::system_clock::now();
	auto diff = std::chrono::duration_cast<std::chrono::milliseconds>(ed - st);
	std::cerr << "cost time " << diff.count() << "ms." << std::endl;
#endif
	return 0;
}

#include <bits/stdc++.h>
// #include <atcoder/all>
using namespace std;
// using namespace atcoder;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
#define rrep1(i, n) for (int i = n; i >= 1; i--)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define eb emplace_back
#define fi first
#define se second
#define sz(x) (int)(x).size()
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
typedef long long int ll;
typedef pair<int, int> P;
// typedef modint1000000007 mint;

void speedUpIO() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
}

template <class T> bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
/*--------------------------------------------------*/
const int INF = 1e9;
const ll LINF = 1e18;
const int MAX = 100010;

void solve() {
    int h, w;
    cin >> h >> w;
    VV<int> G(h + 1, V<int>(w + 1));
    rep(i, h) rep(j, w) {
        char c;
        cin >> c;
        G[i][j] = c == '+' ? 1 : -1;
    }
    VV<int> dp(h + 1, V<int>(w + 1, -INF));
    rep(i, h) dp[i][w] = INF;
    rep(j, w) dp[h][j] = INF;
    dp[h - 1][w - 1] = 0;
    rrep(i, h) rrep(j, w) {
        if (i == h - 1 && j == w - 1) continue;
        chmax(dp[i][j], G[i + 1][j] - dp[i + 1][j]);
        chmax(dp[i][j], G[i][j + 1] - dp[i][j + 1]);
    }
    string ans = "Draw";
    if (dp[0][0] > 0) ans = "Takahashi";
    if (dp[0][0] < 0) ans = "Aoki";
    cout << ans << "\n";
}

int main() {
    speedUpIO();
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
        // cout << solve() << "\n";
        // cout << (solve() ? "Yes" : "No") << "\n";
        // cout << fixed << setprecision(15) << solve() << "\n";
    }
    return 0;
}


//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
const int N = 6666;
const long long MOD = 998244353;
int dp[N][N];
void solve()
{
	int n, k;
	cin >> n >> k;
	dp[0][0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int j = n + n; j >= 1; j--) {
			dp[i][j] = (dp[i - 1][j - 1] + (i >= j ? dp[i][j + j] : 0)) % MOD;
		}
	}
	cout << dp[n][k] << endl;
}
int main()
{
#ifdef QWERTY
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
//    ios_base::sync_with_stdio(false);
	int TC = 1;
//	cin >> TC;
	while (TC--) solve();
	return 0;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <chrono>
#include <random>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
// typedef pair<int,int> P;
// typedef pair<int,P> IP;
// typedef pair<P,P> PP;
double const PI=3.141592653589793;
int const INF=1001001001;
ll const LINF=1001001001001001001;
ll const MOD=998244353;

ll mpow(ll x,ll n){
    if(n==0) return 1;
    else if(n%2) return x*mpow(x,n-1)%MOD;
    return mpow(x*x%MOD,n/2)%MOD;
}

ll N;
ll A[200000];

int main(){
    cin>>N;
    rep(i,N) cin>>A[i];

    sort(A,A+N);

    vector<ll> sum(N+1,0);
    repn(i,N-1){
        sum[i+1]=sum[i]+A[i]*mpow(2,i-1)%MOD;
        sum[i+1]%=MOD;
    }

    ll ans=0;
    repn(i,N){
        ans+=A[i-1]*(sum[N]-sum[i])%MOD*mpow(mpow(2,i-1),MOD-2)%MOD;
        ans%=MOD;
        ans+=A[i-1]*A[i-1];
        ans%=MOD;
    }
    if(ans<0) ans+=MOD;

    cout<<ans<<endl;

    return 0;
}


#include <bits/stdc++.h>
#define startt ios_base::sync_with_stdio(false);cin.tie(0);
typedef unsigned long long ull;
typedef long long  ll;
using namespace std;
#define vint vector<int>
#define all(v) v.begin(), v.end()
#define sz(a) (int)a.size()
#define MOD 1000000007
#define MOD2 998244353
#define MX 1000000000
#define nax 100005
#define MXL 1000000000000000000
#define PI 3.14159265
#define pb push_back
#define pf push_front
#define sc second
#define fr first
#define endl '\n' //delete if interactive
#define ld long double
#define mp make_pair

void solve(){
	int n;cin>>n;
	string a,b,c;cin>>a>>b>>c;
	int lim=2*n+1;
	int x = lim/3;
	for(int i=0;i<n;i++) cout<<"1";
	for(int i=0;i<n;i++) cout<<"0";
	cout<<"1\n";
}

int main(){
	int t=1;cin>>t;
	for(int tc=1;tc<=t;tc++){
		solve();
	}
	return 0;
}

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

int tc, n;
string s[3];

int main(){
	cin.tie(0)->sync_with_stdio(0);
	cin >> tc;
	while(tc--){
		cin >> n;
		for(int i=0;i<3;i++) cin >> s[i];

		for(int i=0;i<n;i++) cout << 1;
		for(int i=0;i<n;i++) cout << 0;
		cout << "1\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<ll(n);i++)
#define REP(i,k,n) for(ll i=k;i<ll(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define UNIQUE(a) sort(all(a));a.erase(unique(all(a)),a.end())
#define decimal cout<<fixed<<setprecision(10)
#define summon_tourist cin.tie(0);ios::sync_with_stdio(false)
using ll=long long;
using P=pair<ll,ll>;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
constexpr ll inf=1001001001001001;
constexpr int INF=1001001001;
constexpr int mod=1000000007;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
void YesNo(bool b){if(b)out("Yes");else out("No");}
void yesno(bool b){if(b)out("yes");else out("no");}
void YESNO(bool b){if(b)out("YES");else out("NO");}
ll modpow(ll a,ll b){ll c=1;while(b>0){if(b&1){c=a*c%mod;}a=a*a%mod;b>>=1;}return c;}
vi calc(ll x){vi v;while(x>0){v.eb(x%10);x/=10;}reverse(all(v));return v;}

int main(){
    ll n,x;
    cin>>n>>x;
    vi a(n);
    rep(i,n) cin>>a[i];
    vi b;
    rep(i,n) if(a[i]!=x) b.eb(a[i]);
    outv(b);
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
#endif

    int n,x,i;
    cin>>n>>x;
    int ar[n];
    vector<int>s;
    for(auto &x: ar)cin>>x;
    for(i=0;i<n;i++)
    {
       if(ar[i]!=x)
           s.push_back(ar[i]);
    }
    for(auto x:s)cout<<x<<" ";
    cout<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

bool chmin(ll &a, ll b) {if(a>b){a=b; return 1; } return 0; }
typedef pair<ll, int> P;
struct edge {int to; ll cost; };

struct Graph {
	private:
		int n;
		vector<ll> d;
		vector<vector<edge>> es;
	public:
		Graph(int _n): n(_n), d(_n), es(_n) {}
		void add_edge(int from, int to, ll cost) {
			edge e;
			e.to = to, e.cost = cost;
			es[from].push_back(e);
		}
		void dijkstra(int s) {
			rep(i,n) d[i] = LINF;
			d[s] = 0;
			priority_queue<P, vector<P>, greater<P>> q;
			q.push(P(0, s));
			while (!q.empty()) {
				P p = q.top(); q.pop();
				int v = p.second;
				if (d[v] < p.first) continue;
				for (edge e: es[v]) {
					if (chmin(d[e.to], p.first + e.cost)) {
						q.push(P(d[e.to], e.to));
					}
				}
			}
		}
		ll get_dist(int u) {
			return d[u];
		}
};

int h, w;
int f(int i, int j) {
	return i*w+j;
}

int main() {
	cin >> h >> w;
	vector<string> g(h);
	rep(i,h) cin >> g[i];
	Graph dij(h*w+26);
	int ps = -1, pg = -1;
	rep(i,h) {
		rep(j,w) {
			if (g[i][j] == '#') continue;
			int cur = f(i,j);
			if (g[i][j] == 'S') ps = cur;
			if (g[i][j] == 'G') pg = cur;
			rep(d, 4) {
				int ni = i + dy[d];
				int nj = j + dx[d];
				if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
				if (g[ni][nj] == '#') continue;
				int nxt = f(ni,nj);
				dij.add_edge(cur, nxt, 1);
			}
			if ('a' <= g[i][j] && g[i][j] <= 'z') {
				int spr = h*w + (g[i][j] - 'a');
				dij.add_edge(cur, spr, 1);
				dij.add_edge(spr, cur, 0);
			}
		}
	}
	dij.dijkstra(ps);
	if (dij.get_dist(pg) == LINF) cout << -1 << endl;
	else cout << dij.get_dist(pg) << endl;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<(a)<<endl
#define dumparr(a,n) cerr<<#a<<"["<<(n)<<"]="<<(a[n])<<endl
#else
#define dump(a)
#define dumparr(a,n)
#endif
#define FOR(i, a, b) for(ll i = (ll)a;i < (ll)b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = (ll)b-1LL;i >= (ll)a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

pll operator+(pll a,pll b){
  return pll(a.first+b.first,a.second+b.second);
}
pll operator-(pll a,pll b){
  return pll(a.first-b.first,a.second-b.second);
}
pll operator*(ll a,pll b){
  return pll(b.first*a,b.second*a);
}
const ll INF=(1LL<<60);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  a=abs(a);
  b=abs(b);
  if(a==0)return b;
  if(b==0)return a;
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
template<class T>
bool chmax(T& a,const T& b){
  if(a<b){
    a=b;
    return true;
  }
  return false;
}
template<class T>
bool chmin(T& a,const T& b){
  if(a>b){
    a=b;
    return true;
  }
  return false;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

int main(){
  cout<<setprecision(1000);
  ll N,M;
  cin>>N>>M;
  vector<ll> dp(1LL<<N);
  vector<vector<pll>> cond(N);
  REP(M){
    ll x,y,z;
    cin>>x>>y>>z;
    --x;--y;
    cond[x].push_back(pll(y,z));
  }
  auto f=[](ll num,ll y,ll z){
    ll mask=(1LL<<(y+1))-1;
    num&=mask;
    return __builtin_popcountll(num)<=z;
  };
  dp[0]=1;
  For(j,(1LL<<N)){
    ll n=__builtin_popcountll(j);
    if(n==N)continue;
    ll cur=1;
    REP(N){
      if((cur&j)==0){
        ll jj=(j|cur);
        ([&]() {
          FOR(cidx, n, N)
          {
            for (auto &&[y, z] : cond[cidx])
            {
              if (!f(jj, y, z))
              {
                return;
              }
            }
          }
          dp[jj]+=dp[j];
        })();
      }
      cur<<=1;
    }
  }
  dump(dp);
  cout<<dp[(1LL<<N)-1]<<endl;
  return 0;
}


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

int calc_min_delta(const vector<int> &a){
    int ret = 1e9;
    for(int i=1; i<int(a.size()); ++i){
        ret = min(ret, abs(a[i] - a[i-1]));
    }
    return ret;
}

int main(){
    int n;
    string s;
    cin >> n >> s;
    vector<int> a(n+1);
    for(int i=0; i<=n; ++i)cin >> a[i];
    const auto k = calc_min_delta(a);
    cout << k << endl;
    for(int i=0; i<k; ++i){
        cout << (a[0] + i) / k;
        for(int j=1; j<=n; ++j){
            cout << " " << (a[j] + i) / k;
        }
        cout << endl;
    }
    return 0;
}

#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<sstream>
#include<cstring>
#include<cstdio>
#include<string>
#include<deque>
#include<cmath>
#include<queue>
#include<set>
#include<map>

using namespace std;

int n;
char s[110];
int a[110];
int b[110];
int maxB[110];
int szA;
int step[110];
int r[110];

bool checkYes(int numA, int numB, char sign) {
	if (numA == numB)
		return false;

	if (sign == '>') {
		if (numA > numB)
			return true;
		else
			return false;
	} else {	//<
		if (numA < numB)
			return true;
		else
			return false;
	}
}

void testB() {
	int curLevel = 0;
	b[0] = 0;
	int minD = b[0];
	for (int i = 0 ; i < n ; i++) {
		if (s[i] == '<') {
			b[i + 1] = b[i] + 1;
		} else {
			b[i + 1] = b[i] - 1;
		}

		if (minD > b[i + 1])
			minD = b[i + 1];
	}

	int adds = -minD;
	for (int i = 0 ; i <= n ; i++) {
		b[i] = b[i] + adds;
	}

	for (int i = 0 ; i <= n ; i++) {
		maxB[i] = b[i];
	}

	if (s[0] == '<') {
		b[0] = 0;
	}
	if (s[n - 1] == '>') {
		b[n] = 0;
	}
	for (int i = 1 ; i < n ; i++) {
		if ((s[i - 1] == '>') && (s[i] == '<')) {
			b[i] = 0;
		}
	}

	for (int ii = 0 ; ii <= 200 ; ii++) {
		for (int i = 0 ; i <= n ; i++) {
			int curNum = b[i] - 1;
			if (curNum < 0)
				continue;
			bool canDel = true;
			if ((i - 1) >= 0) {
				if (checkYes(b[i - 1], curNum, s[i - 1]) == false) {
					canDel = false;
				}
			}

			if (i + 1 <= n) {
				if (checkYes(curNum, b[i + 1], s[i]) == false) {
					canDel = false;
				}
			}

			if (canDel) {
				b[i] = curNum;
			}
		}
	}
}

bool checkLast(int b[]) {
	for (int i = 0 ; i < n ; i++) {
		int numA = a[i] - b[i];
		int numB = a[i + 1] - b[i + 1];
		if ((numA < 0) || (numB < 0))
			return false;

		if ((a[i] - b[i]) == (a[i + 1] - b[i + 1]))
			return false;

		bool isBigger = true;
		if ((a[i] - b[i]) > (a[i + 1] - b[i + 1])) {
			isBigger = true;
		} else {
			isBigger = false;
		}

		if (s[i] == '>') {
			if (isBigger == false) {
				return false;
			}
		} else {	//<
			if (isBigger == true) {
				return false;
			}
		}
	}

	return true;
}

int main(void)
{
	scanf("%d\n", &n);
	scanf("%s\n", s);
	szA = n + 1;
	for (int i = 0 ; i <= n ; i++) {
		scanf("%d", &(a[i]));
	}
	testB();

	int minDiff = abs(a[1] - a[0]);
	for (int i = 2 ; i <= n ; i++) {
		int curDiff = abs(a[i] - a[i - 1]);
		if (minDiff > curDiff)
			minDiff = curDiff;
	}

	int k = minDiff;
	printf("%d\n", k);

	for (int j = 0 ; j <= n ; j++) {
		a[j] = a[j] - b[j] * k;
		step[j] = a[j] / k;
		r[j] = a[j] % k;
	}

	for (int i = 0 ; i < k ; i++) {
		for (int j = 0 ; j <= n ; j++) {
			int curNum;
			if (r[j] > 0) {
				curNum = b[j] + step[j] + 1;
				r[j]--;
			} else {
				curNum = b[j] + step[j];
			}
			printf("%d ", curNum);
		}
		printf("\n");
	}

	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fastio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define pf push_front
#define mp make_pair
#define mod 1000000007
#define vll vector<ll>
#define inf 3e15 +7
#define pll pair<ll,ll>
#define ff first
#define ss second
#define PI acos(-1)
#define prm 998244353
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
/*
ll dx[4]={1,-1,0,0};
ll dy[4]={0,0,-1,1};
cout<<fixed<<setprecision(12)<<;
ll power(ll a, ll b){//a^b
    ll res=1;
    a=a%prm;
    while(b>0){
        if(b&1){res=(res*a)%prm;b--;}
        a=(a*a)%prm;
        b>>=1;
    }
    return res;
}
ll inv(ll y){return power(y,prm-2);}
ll fact[300060];
ll nCr(ll n, ll r)
{
   if (r==0)
      return 1;
    return (fact[n]* inv(fact[r]) % prm *
            inv(fact[n-r]) % prm) % prm;
}

void init(ll n)
{
	fact[0]=1;
	for(ll i=1;i<=n;i++)fact[i]=(fact[i-1]*i)%prm;
}
*/
/*
//cout<<"Case #"<<fff-T<<": ";
/*
ll spf[15000050];
void sieve()
{
	for(ll i=2;i*i<=15000030;i++){
		if(spf[i]==0){
			for(ll j=i+i;j<=15000030;j+=i){
				if(spf[j]==0){
					spf[j]=i;
				}
			}
		}
	}
}*/

int main()
{
    fastio;
	ll T=1;
	//cin>>T;
	//ll fff=T;
	while(T--)
	{
	     ll n;
	     cin>>n;
	     ll a[n];
	     for(ll i=0;i<n;i++)cin>>a[i];
	     sort(a,a+n);
	     ld x1=(ld)a[n/2]/2;
	     ld x2=(ld)a[n/2 -1]/2;
	     ld x3=(ld)a[n/2 +1]/2;

	     ld ans1=0,ans2=0,ans3=0;
	     for(ll i=0;i<n;i++)
	     {
	         ans1=(ans1+x1+a[i]-min((ld)a[i],(ld)2*x1));
	         ans2=(ans2+x2+a[i]-min((ld)a[i],(ld)2*x2));
	         ans3=(ans3+x3+a[i]-min((ld)a[i],(ld)2*x3));
	     }

	     cout<<fixed<<setprecision(12)<<(ld)min({ans1,ans2,ans3})/(ld)n;
	}
}
/*

*/

//Template Created By: OptimalKnight
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <chrono>

using namespace std;
using namespace __gnu_pbds;
using namespace chrono;

#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")

#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);

#define max3(a,b,c) max(max((a),(b)),(c))
#define max4(a,b,c,d) max(max((a),(b)),max((c),(d)))
#define min3(a,b,c) min(min((a),(b)),(c))
#define min4(a,b,c,d) min(min((a),(b)),min((c),(d)))

#define ll long long int
#define fo(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define endl "\n"
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define up upper_bound
#define all(V) V.begin(),V.end()

#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define ye(x) ((x)==0)?(cout<<"YES"<<endl):(cout<<"Yes"<<endl)
#define no(x) ((x)==0)?(cout<<"NO"<<endl):(cout<<"No"<<endl)
#define take(x) for(auto &y:x) cin>>y
#define show(x) for(auto y:x) cout<<y<<" "; cout<<endl

mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
//uniform_int_distribution<long long int> dis(L,R);
//dis(gen): Produces uniformly distributed integer values on the closed interval [L,R]
//dis.reset(): Resets the distribution
template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
//find_by_order(K): Returns an iterator to the Kth largest element(counting from zero)
//order_of_key(K): Returns the number of items that are strictly smaller than K

//const long double pi=3.14159265358979323846264338;
//const long long INF=1000000000000000000;
//const long long IINF=1000000000;
//const long long int MOD=1000000007;
//Template Ends

int main(){
    ios
    ll Tests=1;
//    cin>>Tests;
    while(Tests--){
    	float A,B;
    	cin>>A>>B;
    	float ans=A*B;
    	ans/=100;
    	cout<<ans<<endl;
    }
}


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

int main(){
  ll N,X,Y,a=-1e18,i=0;cin>>N>>X;
  ll A[N+1],T[N+1],B[N+1];
  for(int i=1;i<=N;B[i]=A[i],T[i]=a,i++)cin>>A[i];
  vector<vector<int>>G(N+1);
  for(;cin>>X>>Y;)G[X].push_back(Y);
  for(i=1;i<=N;i++)for(auto v:G[i])T[v]=max(T[v],A[v]-B[i]),B[v]=min(B[v],B[i]);
  cout<<*max_element(T+1,T+N+1);
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define LOL cout << '\n';
#define kill(x) {cout << (x) << '\n'; return;}
#define sz(x) ((int)x.size())
#define INF 1e15
#define NINF LONG_LONG_MIN
#define deb(x) cout << "[" << (#x) << "=" << x << "]" << '\n'
#define deb2(x,y) cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "]" << '\n'
#define deb3(x,y,z) cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "] [" << (#z) << "=" << z << "]" << '\n'

int n,m;
const int N=2e5+69;
vector<int> adj[N];
int a[N];
vector<pair<int,int>> vis(N);
int OP=NINF;

pair<int,int> dfs(int s){
  if(vis[s].f!=-1 && vis[s].s!=-1) return vis[s];
  int ans=NINF,mx=0;
  for(auto &el:adj[s]){
    pair<int,int> T=dfs(el);
    ans=min(ans,T.f);
    mx=max(mx,T.s);
    //  deb3(s,ans,mx);
  }
  if(mx!=0) ans=max(ans,mx-a[s]);
  mx=max(mx,a[s]);
  //  deb3(s,ans,mx);
  OP=max(OP,ans);
  return vis[s]={ans,mx};
}

void solve(){
  cin>>n>>m;
  for(int i=1 ; i<=n ; i++) cin>>a[i],vis[i]={-1,-1};
  for(int i=0 ; i<m ; i++){
    int u,v; cin>>u>>v;
    adj[u].pb(v);
  }
  for(int i=1 ; i<=n ; i++){
    if(vis[i].f==-1 && vis[i].s==-1){
      dfs(i);
    }
  }

  cout<<OP;LOL
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  int _ = 1; // cin >> _;
  for(int i = 1 ; i <= _ ; i++){
    // cout << "\nCase #" << i << ": \n";
    solve();
  }
  return 0;
}

// 1.77245


#include <bits/stdc++.h>
using namespace std;
template<typename T = int> vector<T> create(size_t n){ return vector<T>(n); }
template<typename T, typename... Args> auto create(size_t n, Args... args){ return vector<decltype(create<T>(args...))>(n, create<T>(args...)); }
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	string s;
	cin >> s;
	long long p = 1;
	for(int i = 0; i < 10; i++) p *= 10;
	int pieces = (n + 5) / 3;
	vector<int> vs;
	string to_match;
	for(int i = 0; i < pieces; i++){
		vs.push_back(i); vs.push_back(i); vs.push_back(i);
		to_match.push_back('1');
		to_match.push_back('1');
		to_match.push_back('0');
	}
	long long ans = 0;
	for(int i = 0; i < 3; i++){
		bool ok = true;
		for(int j = 0; j < n; j++){
			if(to_match[i + j] != s[j])
				ok = false;
		}
		if(ok){
			int len = vs[i + n - 1] - vs[i] + 1;
			ans += (p - len + 1);
		}
	}
	cout << ans << '\n';
	return 0;
}


//------HARSH------//
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;

#define int long long
#define f(i,a,n) for(int i=a;i<n;i++)
#define rf(i,a,n) for(int i=n-1;i>=a;i--)
#define read(arr,n) for(int i=0;i<n;i++)cin>>arr[i];
#define in cin>>
#define out cout<<
#define fr first
#define sc second
#define VC vector<int>
#define VP vector<pair<int,int>>
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832

int gcd(int a, int b){
    if (b == 0){return a;}
    else{return gcd(b,a%b);}
}

int lcm(int a, int b){
    return (a*b)/(gcd(a,b));
}

map<int,vector<int>> vec;

void primeFactors(int n)
{
    int TEMP=n;
    vector<int> temp;
    while (n % 2 == 0)
    {
        n = n/2;
        temp.pb(2);

    }

    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        while (n % i == 0)
        {
            n = n/i;
            temp.pb(i);
        }
    }
    if (n > 2){temp.pb(n);}

    vec[TEMP]=temp;
}

void solve(){
    int n;
    cin>>n;

    int arr[n];
    read(arr,n);

    f(i,0,n){
        primeFactors(arr[i]);
    }

    int ans=1;
    set<int> s;

    // for(auto itr:vec){
    //     int flag=0;
    //     for(auto itr2:itr.sc){
    //         if(s.find(itr2)!=s.end()){flag=1;break;}
    //     }
    //     if(flag==0){s.insert(*itr.sc.begin());ans*=*itr.sc.begin();}
    // }

    // cout<<ans<<"\n";

    for(auto itr:vec){
        for(auto itr2:itr.sc){
            s.insert(itr2);
        }
    }

    for(auto itr:s){ans*=itr;}

    int ans2=ans;

    for(auto itr=s.rbegin();itr!=s.rend();itr++){
        int temp=ans/(*itr);
        int flag=0;

        f(i,0,n){
            if(gcd(temp,arr[i])==1){flag=1;break;}
        }

        if(flag==0){ans=temp;}

    }

    for(auto itr:s){
        int temp=ans2/(itr);
        int flag=0;

        f(i,0,n){
            if(gcd(temp,arr[i])==1){flag=1;break;}
        }

        if(flag==0){ans2=temp;}

    }

    cout<<min(ans,ans2)<<"\n";

}

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

    int t;
    t=1;
    //in t;
    while(t--){
        solve();
    }
}

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

typedef long long ll;
#define int long long
#define fs first
#define sc second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define MP make_pair
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifdef FlameDragon
    freopen("in.txt", "r", stdin);
#endif
    int n;
    cin >> n;
    int k = 5;
    vector<vector<int>> a(n, vector<int>(k));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < k; j++) {
            cin >> a[i][j];
        }
    }
    const int INF = 1e9 + 123;
    int l = 0, r = INF;
    auto check = [&](int x) -> bool {
        vector<int> cnt(1 << k);
        for (int i = 0; i < n; i++) {
            int mask = 0;
            for (int j = 0; j < k; j++) {
                if (a[i][j] >= x) {
                    mask ^= 1 << j;
                }
            }
            cnt[mask] = 1;
        }
        for (int i = 0; i < (1 << k); i++) {
            for (int j = 0; j < (1 << k); j++) {
                for (int p = 0; p < (1 << k); p++) {
                    if (cnt[i] && cnt[j] && cnt[p] && (i | j | p) == ((1 << k) - 1)) {
                        return true;
                    }
                }
            }
        }
        return false;
    };
    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (check(mid)) {
            l = mid;
        } else {
            r = mid;
        }
    }
    cout << l << '\n';
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vp> vvp;

// input
int n, k;
string s;

void input() {
    cin >> n >> k;
    cin >> s;
}

int main() {
    input();
    map<char, map<char, char>> m;
    m['R']['R'] = m['R']['S'] = m['S']['R'] = 'R';
    m['P']['P'] = m['P']['R'] = m['R']['P'] = 'P';
    m['S']['S'] = m['P']['S'] = m['S']['P'] = 'S';
    rep(i, k) {
        s += s;
        int sn = s.size();
        string t = "";
        for (int j = 0; j < sn; j += 2) t += m[s[j]][s[j + 1]];
        swap(s, t);
    }
    char ans = s[0];
    cout << ans << endl;
}

#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 4000000000000000000 //オーバーフローに注意
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

#define SIZE 105

char buf[SIZE],work[2*SIZE];

char calc(char a,char b){

	switch(a){
	case 'R':
		switch(b){
		case 'R':return 'R';
		case 'P':return 'P';
		case 'S':return 'R';
		}
		break;
	case 'P':
		switch(b){
		case 'R':return 'P';
		case 'P':return 'P';
		case 'S':return 'S';
		}
		break;
	case 'S':
		switch(b){
		case 'R':return 'R';
		case 'P':return 'S';
		case 'S':return 'S';
		}
		break;
	}
	return '@';
}

int main(){

	int N,K;

	scanf("%d %d",&N,&K);
	scanf("%s",buf);

	for(int a = 0; a < K; a++){

		int index = 0;
		for(int loop = 0; loop < 2; loop++){

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

				work[index] = buf[i];
				index++;
			}
		}

		index = 0;
		for(int i = 0; i < 2*N; i += 2){

			buf[index++] = calc(work[i],work[i+1]);
		}
	}

	printf("%c\n",buf[0]);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
const int nax=2e5+100,mod=1e9+7;
int dp[nax][19];
int32_t main()
{
    int t=1;
    //cin>>t;
    while(t--)
    {
        string a;
        cin>>a;
        int k;
        cin>>k;
        set<int> s;
        s.clear();
        for(int i=0;i<a.size();i++)
        {
            for(int j=0;j<17;j++)
            {
                dp[i+1][j]+=dp[i][j]*j;
                dp[i+1][j]%=mod;
                dp[i+1][j+1]+=dp[i][j]*(16-j);
                dp[i+1][j+1]%=mod;
            }
            int num=a[i]-'0';
            if(a[i]>='A')
            num=10+a[i]-'A';
            for(int j=0;j<num;j++)
            {
                if(i==0 and j==0)
                continue;
                if(s.count(j))
                {
                    dp[i+1][s.size()]++;
                    dp[i+1][s.size()]%=mod;
                }
                else
                {
                    dp[i+1][s.size()+1]++;
                    dp[i+1][s.size()+1]%=mod;
                }
            }
            s.insert(num);
            if(i!=0)
            dp[i+1][1]+=15;
        }
        int res=dp[a.size()][k];
        set<char> ss;
        for(int i=0;i<a.size();i++)
        ss.insert(a[i]);
        if(ss.size()==k)
        ++res;
        cout<<res;
    }
    return 0;
}

#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<queue>
#include<vector>
#include<cstring>
#include<map>
#include<set>
#include<cstdlib>
#include<bitset>
using namespace std;
#define FAST ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
typedef long long ll;
#define N 200005
ll p=1e9+7;
ll n,m,f[N][17][17]={0},v[22]={0},sm;
char a[N];
int main()
{
	ll i,j,k,a1,a2,an=0;
	scanf("%s",a+1);
	n=strlen(a+1);
	for(ll i=1;i<=n;i++)
		if(a[i]>='0'&&a[i]<='9')
			a[i]-='0';
		else
			a[i]-='A'-10;
	scanf("%lld",&m);
	for(ll i=0;i<=m;i++)
		f[0][i][i]=1;
	for(ll i=1;i<=n;i++)
		for(ll j=1;j<=m;j++)
			for(ll k=j;k<=m;k++)
				f[i][j][k]=((ll)f[i-1][j][k-1]*(17ll-k)+(ll)f[i-1][j][k]*k)%p;
	for(ll i=1;i<=n;i++)
		an=(an+15ll*f[i-1][1][m])%p;
	// for(ll i=1;i<=n;i++)
	// {
	// 	for(ll j=1;j<=m;j++)
	// 		for(ll k=j;k<=m;k++)printf("%lld\n",f[i][j][1]);
	// }
	for(ll i=1;i<=n;i++)
	{
		for(ll j=a[i]+1;j<=15;j++)
			an=(an-f[n-i][sm+(!v[j])][m]+p)%p;
		//printf("%lld\n",an);
		sm+=!v[a[i]];
		v[a[i]]=1;
	}
	printf("%lld",an);
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf=0x3f3f3f3f;
const double pi=3.1415926535897932384626;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
int n;
vector<int> ans;
int main(){
    n=read();
    for(int i=10;n&&i<=10000;++i){
        if(i%6==0||i%10==0||i%15==0){
            ans.push_back(i);
            --n;
        }
    }
    for(int i=0;i<ans.size();++i) printf("%d%c",ans[i],i<ans.size()-1?' ':'\n');
	return 0;
}

#include <iostream>
#include <cmath>
#include <string>
#include <vector>
using namespace std;

int main()
{
    int N;
    cin >> N;
    int mx = 0;
    int mn = 1000;
    for (int i = 0; i < N;++i) {
        int a;
        cin >> a;
        mx = max(a, mx);
    }

    for (int i = 0;i < N;++i) {
        int b;
        cin >> b;
        mn = min(mn, b);
    }

    int ans = mn - mx + 1;
    if (ans > 0) {
        cout << ans;
    }
    else {
        cout << 0;
    }

    return 0;
}


#include <iostream>
#include <array>
#include <vector>
#include <cassert>
#include <algorithm>
using namespace std;
using lint = long long;

int main()
{
    int n, m;
    cin >> n >> m;
    vector<vector<int>> g(n);
    for (int i = 0; i < m; ++i)
    {
        int s, t;
        cin >> s >> t;
        s--;
        t--;
        g[s].push_back(t);
        g[t].push_back(s);
    }
    vector<int> idx(n, -1); //dfs順を記録。違う連結成分になら同じindexを持ちうる。
    auto dfs = [&](auto dfs, int now, array<int, 20> &v) -> lint {
        for (int to : g[now])
        {
            if (v[to] == v[now])
            {
                return 0;
            }
        }
        lint res = 1;
        for (int to : g[now])
        {
            if (idx[to] == -1)
                idx[to] = idx[now] + 1;
            if (idx[to] == idx[now] + 1)
            {
                lint tmp = 0;
                v[to] = (v[now] + 1) % 3;
                tmp += dfs(dfs, to, v);
                v[to] = (v[now] + 2) % 3;
                tmp += dfs(dfs, to, v);
                v[to] = -1;
                res *= tmp;
                if (tmp == 0)
                    break;
                // tmp == 0 の時、早期に return してるのでidxが振り切れていない事に注意
            }
        }
        return res;
    };

    lint ans = 1;
    array<int, 20> v;
    v.fill(-1);

    for (int i = 0; i < n; ++i)
    {
        if (idx[i] != -1)
            continue;
        idx[i] = 0;
        v[i] = 0;
        ans *= dfs(dfs, i, v) * 3;
    }
    cout << ans << endl;
}

#include <bits/stdc++.h>

using namespace std;

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define pi pair<int, int>
#define mp make_pair
#define F first
#define S second

int n, m, a, b;
vector<vi> adj;
vi c, cgroup;
vector<bool> vis;

ll calc(int i) {
    if (i==cgroup.size()) return 1;
    int node = cgroup[i];
    ll ans = 0;
    vector<bool> taken(4, false);
    for (int nb : adj[node]) taken[c[nb]]=true;
    F0R(j, 3) if (!taken[j]) {
        c[node]=j;
        ans += calc(i+1);
    }
    c[node]=3;
    return ans;
}

void group(int i) {
    if (vis[i]) return;
    vis[i]=true;
    cgroup.pb(i);
    for (int nb : adj[i]) if (! vis[nb]) group(nb);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m;
    adj.rsz(n);
    F0R(i, m) {
        cin >> a >> b;
        adj[a-1].pb(b-1);
        adj[b-1].pb(a-1);
    }
    c.rsz(n, 3);
    ll ans = 1;
    vis.rsz(n, false);
    F0R(i, n) {
        if (!vis[i]) {
            cgroup.clear();
            group(i);
            c[i]=0;
            ans *= 3*calc(1);
        }
    }
    cout << ans << '\n';
}


#include <bits/stdc++.h>
using namespace std;
#define fo(a,b) for(int64_t a=0;a<b;a++)
#define sor(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define ll int64_t
#define mod 1000000007
#define vl vector<int64_t>
#define vc vector<char>
#define vs vector<string>
#define np(vec) next_permutation(vec.begin(),vec.end())==true
#define en endl
#define vvl vector<vector<int64_t>>
#define sti stack<int64_t>
#define qui que<int64_t>
#define ms(a,b) memset(a,b,sizeof(a))
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

int main(){
  ll li;
  string x;
  cin>>x;
  ll s=x.size();
  vl vec(s);
  ll m,ma;
  ma=0;
  cin>>m;
  fo(i,s){
    vec.at(i)=x.at(i)-'0';
  }
  fo(i,s){
    ma=max(ma,vec.at(i));
  }
  if(s==1){if(vec.at(0)<=m){cout<<1<<endl;}
          else{cout<<0<<en;}}
  else{ll lb=-1;
  ll ub=2*pow(10,18);
  while(ub-lb>1){
    ll mid=(lb+ub)/2;
    if(vec.at(0)*pow(mid,(s-1))>pow(10,18)){
      ub=mid;
    }
    else{lb=mid;}
  }
  li=lb;
  ub=lb;
  lb=ma+1;
  if(lb>ub){cout<<0<<endl;}
  else{
    lb=0;
    ub=2*pow(10,18);
    while(ub-lb>1){
         ll mid=(lb+ub)/2;
      if(mid>li){ub=mid;}
         else{ll ans=0;
         fo(i,s){
           ans=ans*mid;
           ans+=vec.at(i);
           }
         if(ans>m){
           ub=mid;
         }
         else{lb=mid;}
       }}
     cout<<max(lb-ma,0L)<<en;
  }
      }
}

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

typedef long long ll;
#define pb push_back

bool check(ll a, ll b, ll m)
{
    if (a == 0 || b == 0)
        return false;
    if (a > m / b)
        return true;
    return false;
}

bool pos(vector<ll> &dig, ll x, ll m)
{
    ll num = dig[0], cur = 1;
    for (int i = 1; i < dig.size(); i++)
    {
        if (check(cur, x, m))
            return false;
        cur *= x;
        if (check(cur, dig[i], m))
            return false;
        if (num > m - (cur * dig[i]))
            return false;
        num += cur * dig[i];
        if (num > m)
            return false;
    }
    return num <= m;
}

ll solve()
{
    string str;
    ll m, res = 0;
    cin >> str >> m;
    ll d = 0;
    vector<ll> dig;
    for (char s : str)
    {
        dig.pb((s - '0') * 1ll);
        d = max(d, dig.back());
    }
    reverse(dig.begin(), dig.end());
    if (dig.size() == 1)
    {
        if (dig[0] > m)
            return 0;
        return 1;
    }
    ll l = d + 1, r = 1e18;
    while (l < r)
    {
        ll mid = l + (r - l) / 2;
        if (pos(dig, mid, m))
        {
            res = max(res, mid - d);
            l = mid + 1;
        }
        else
            r = mid - 1;
    }
    if (pos(dig, l, m))
        res = max(res, l - d);
    return res;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout << solve() << "\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define BUFF ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define IO freopen("in.txt","r",stdin),freopen("out.txt","w",stdout)
#define P(x) cout<<x<<endl
#define P2(x,y) cout<<x<<' '<<y<<endl
#define P3(x,y,z) cout<<x<<' '<<y<<' '<<z<<endl
#define P4(x,y,z,u) cout<<x<<' '<<y<<' '<<z<<' '<<u<<endl
#define P5(x,y,z,u,v) cout<<x<<' '<<y<<' '<<z<<' '<<u<<' '<<v<<endl
#define P6(x,y,z,u,v,w) cout<<x<<' '<<y<<' '<<z<<' '<<u<<' '<<v<<' '<<w<<endl
#define PV(x) for(auto ii:(x)){cout<<ii<<' ';}cout<<endl
#define PN(x,n) for(int ii=1;ii<=(n);ii++){cout<<x[ii]<<' ';}cout<<endl
#define PNN(x,n,m) for(int ii=1;ii<=(n);ii++){for(int jj=1;jj<=(m);jj++){cout<<x[ii][jj]<<' ';}cout<<endl;}
typedef long long ll;
typedef unsigned long long ull;
const ll D = 0;
const ll N = 222;
const ll mod = 1e9 + 7;
const ll inf = 1e9 + 7;
const double eps = 1e-9;

ll n;
bool visRow[10010];
vector<ll> adInRow[10010];
double score=0;
struct AD
{
	ll id,x,y,r,a,b,c,d;
	bool operator <(const AD &tmp)const
	{
		return y<tmp.y;
	}
}ad[N];
bool cmp(ll id1,ll id2)
{
	return ad[id1].y < ad[id2].y;
}
ll area(ll x,ll y,ll z,ll w)
{
	return abs(x-y) * abs(z-w);
}
int solve()
{
	cin>>n;
	ll maxX=0;
	for(ll i=1;i<=n;i++)
	{
		cin>>ad[i].x>>ad[i].y>>ad[i].r;
		ad[i].id = i;
		//visRow[ad[i].x]=true;
		adInRow[ad[i].x].push_back(i);
		maxX = max(maxX, ad[i].x);
		//P("ok");
	}
	for(ll i=0;i<10000;i++)
	{
		sort(adInRow[i].begin(),adInRow[i].end(),cmp);
	}
	ll lstX=0,lstY=0,cnt,siz;
	for(ll i=0;i<10000;i++)
	{
		if(!adInRow[i].empty())
		{
			cnt=0;
			siz = adInRow[i].size();
			lstY=0;
			for(ll j=0;j<siz;j++)
			{
				AD *now = &ad[adInRow[i][j]];
				now->a = lstY;
				now->b = now->y + 1;
				if(j == siz-1) now->b = 10000;
				lstY = now->b;

				if(i==maxX) now->d = 10000;
				else now->d = now->x + 1;

				ll tmpx = now->x;
				while(tmpx<now->x && area(now->b,now->a,now->d,now->c)<(now->r))
				{
					tmpx--;
				}
				now->c = lstX;//[lstx,nowx]

			}
			lstX = i + 1;
		}
	}
	score=0;
	for(ll i=1;i<=n;i++)
	{
		P4(ad[i].a,ad[i].c,ad[i].b,ad[i].d);
		if(D)
		{
			double s = area(ad[i].b,ad[i].a,ad[i].d,ad[i].c);
			double r = ad[i].r;
			score += 1 - pow(1 - (min(r,s)/max(r,s)), 2.);
			//P((min(r,s)/max(r,s)));
		}
	}
	if(D)
	{
		score = 1e9 * (score / n);
		cout<<"Your score: "<<(ll)score;
	}

	return 0;
}

int main()
{
	//BUFF;
	if(D)IO;
	solve();
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a, b)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, n) for (ll i = n - 1; i >= 0; i--)

struct Timer {
  private:
    chrono::high_resolution_clock::time_point start, end;

  public:
    Timer() { set(); }
    void set() { start = chrono::high_resolution_clock::now(); }
    int time() {
        end = chrono::high_resolution_clock::now();
        return chrono::duration_cast<chrono::milliseconds>(end - start).count();
    }
    void print() { cerr << "elapsed time: " << (double)time() / 1000 << " sec" << endl; }
};

struct Random {
  private:
    uint32_t a, b, c, d;

  public:
    Random(uint32_t seed = 517) { set_seed(seed); }
    void set_seed(uint32_t seed) {
        a = seed = 1812433253u * (seed ^ (seed >> 30));
        b = seed = 1812433253u * (seed ^ (seed >> 30)) + 1;
        c = seed = 1812433253u * (seed ^ (seed >> 30)) + 2;
        d = seed = 1812433253u * (seed ^ (seed >> 30)) + 3;
    }
    uint32_t operator()() {
        uint32_t t = (a ^ (a << 11));
        a = b;
        b = c;
        c = d;
        return d = (d ^ (d >> 19)) ^ (t ^ (t >> 8));
    }

    // [0,MAX)
    uint32_t operator()(int MAX) { return (uint64_t) operator()() * MAX >> 32; }

    // [L,R)
    uint32_t operator()(int L, int R) { return L + operator()(R - L); }

    // [0,1) の実数
    double drnd() { return (double)operator()() / (1LL << 32); }

    // 確率 p で true を返す
    bool prob(const double p) { return (uint32_t)(p * (1LL << 32)) > operator()(); }
};

double TL = 3500;
double start_temp = 2.5, end_temp = 0;
int main()
{
  Timer T;
  Random rnd;
  int n;
  cin >> n;
  int x[n], y[n], r[n];
  rep(i, n) cin >> x[i] >> y[i] >> r[i];
  int a[n], b[n], c[n], d[n], cnt = 0;
  rep(i,n){
    a[i] = -1;
    int ok = 0, ng = max(1.0, sqrt(r[i])) + 1e-5 + 1;
    while(ng - ok > 1){
      int nr = (ok + ng) / 2;
      rep(k,4){
        int xl = x[i], xr = x[i] + nr*(1+(-2)*(k/2)), yl = y[i], yr = y[i] + nr*(1+(-2)*(k%2));
        if(xl>xr)
          swap(xl, xr);
        if(yl>yr)
          swap(yl, yr);
        int flag = 1;
        if(xl<0||yl<0||xr>10000||yr>10000)
          flag = 0;
        rep(j, i) if (a[j] < xr && c[j] > xl && b[j] < yr && d[j] > yl) flag = 0;
        if(flag){
          a[i] = xl, b[i] = yl, c[i] = xr, d[i] = yr;
          ok = nr;
          break;
        }
        if(k == 3)
          ng = nr;
      }
    }
    if(a[i] == -1){
      while (1){
        int xl = cnt / 10000, yl = cnt % 10000;
        int xr = xl + 1, yr = yl + 1;
        cnt++;
        int flag = 1;
        rep(j, i) if (a[j] < xr && c[j] > xl && b[j] < yr && d[j] > yl) flag = 0;
        if(flag){
          a[i] = xl, b[i] = yl, c[i] = xr, d[i] = yr;
          break;
        }
      }
    }
  }
  rep(i, n) cout << a[i] << " " << b[i] << " " << c[i] << " " << d[i] << endl;
}


#include <bits/stdc++.h>

int main() {
	using namespace std;
	ios_base::sync_with_stdio(false), cin.tie(nullptr);

	const int INF = 1e9;

	int N; cin >> N;
	string S; cin >> S;
	std::array<int, 26> dp; dp.fill(INF);
	dp[S[0] - 'a'] = 0;
	for (int i = 0; i < int(S.size()); i++) {
		int best = INF;
		for (int v = 0; v < 26; v++) {
			if (v == S[i] - 'a') continue;
			best = min(best, dp[v] + 1);
		}
		if (i+1 < int(S.size())) {
			dp[S[i+1] - 'a'] = min(dp[S[i+1] - 'a'], best);
		} else {
			if (best > N) best = -1;
			cout << best << '\n';
		}
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
#define pow(n,m) powl(n,m)
#define sqrt(n) sqrtl(n)
const ll MAX = 5000000000000000000;
const ll MOD = 0;
random_device rd;
mt19937 mt(rd());
int main(){
    ll N;
    string S;
    cin >> N >> S;
    if(S[0] != S[N - 1]){
        cout << 1 << endl;
    }
    else{
        for(ll i = 0;i < N - 1;i++){
            if(S[0] != S[i] && S[0] != S[i + 1]){
                cout << 2 << endl;
                return 0;
            }
        }
        cout << -1 << endl;
    }
}


#include<iostream>
#include<string>
using namespace std;

string judge(long N) {
	if (N == 0) return "Yes";
	while (N % 10 == 0) {
		N /= 10;
	}
	long reverse = 0;
	long  buf = N;
	while (buf != 0) {
		reverse = reverse * 10 + buf % 10;
		buf /= 10;
	}
	if (N == reverse) return "Yes";
	else return "No";
}

int main() {

	long N = 0;
	cin >> N;

	cout << judge(N) << endl;

}

#include <iostream>
#include <map>
#include <vector>
#include <set>
#include <stack>
#include <bitset>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cassert>
#include <random>

using namespace std;

void solve();

int main() {
    srand(time(0));
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#endif
    solve();
}

#define int long long

const int N = 2e5 + 100, mod = 1e9 + 7, INF = 2e18;
long double EPS = 0.00000001;

bool bit(int a, int n) {
    return (a >> n) & 1;
}

string s;
int ans = 0;

void solve() {
    cin >> s;
    for (int mask = 0; mask < (1 << s.size()); mask++) {
        int k = 0, cnt = 0;
        for (int i = 0; i < s.size(); i++) {
            if (bit(mask, i)) {
                k += s[i] - '0';
                cnt++;
            }
        }
        if (k % 3 == 0) {
            ans = max(ans, cnt);
        }
    }
    if (ans == 0) cout << -1;
    else cout << s.size() - ans;
}


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

int main(){
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    double a,b;
    cin>>a;
    cin>>b;
    if(b<=a)
    {
        cout<<((a-b)/a)*100;

        ;
    }
    return 0;
}

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

void solve(long long A, long long B){
    cout << (double) (A - B) * 100 / A << endl;
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    solve(A, B);
    return 0;
}


#include <bits/stdc++.h>

#define debug(var)  do{std::cout << #var << " :";std::cout << std::endl;view(var);}while(0)
template<typename T> void view(T e){ std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){ int c = v.size(); std::cout << "{"; for(const auto& e : v){ std::cout << e; if (--c) std::cout << ", "; } std::cout << "}" << std::endl; }
template<typename T, typename U> void view(const std::pair<T, U>& v){ std::cout << v.first << ", " << v.second << std::endl; }
template<typename T> void view(const std::set<T>& v){ int c = v.size(); std::cout << "{"; for(const auto& e : v){ std::cout << e; if (--c) std::cout << ", "; } std::cout << "}" << std::endl; }
template<typename T, typename U> void view(const std::map<T, U>& v){ std::cout << "{" << std::endl; for(const std::pair<T, U>& e : v){ std::cout << e.first << ", " << e.second << std::endl; } std::cout << "}" << std::endl; }
template<typename T> void view(const std::vector<std::vector<T> >& vv){ std::cout << "{" << std::endl; for(const auto& v : vv){ view(v); } std::cout << "}" << std::endl; }

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
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; }
const ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;
const double PI = acos(-1);

int main() {
    int n; cin >> n;
    vector<int> A(n);
    rep(i,n) {
        cin >> A[i];
    }

    int cnt = 0;
    int ans = -1;
    for (int i = 2; i <= 1000; i++) {
        int tmp = 0;
        for (auto x : A) {
            if (x % i == 0) tmp++;
        }

        if (chmax(cnt, tmp)) ans = i;
    }

    cout << ans << endl;
}

#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = int64_t; using ull = uint64_t; const ll INF = 9e18;
void print() { cout << endl; }
template<typename Head,typename... Tail> void print(Head head,Tail... tail){cout<<head;if(sizeof...(Tail)>0)cout<<" ";print(tail...);}
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<head;print0(tail...);}
// clang-format on

struct person {
    ll id;
    ll a;
    ll b;
};

bool recursive(ll N, ll start, ll donenum, ll anymovenum, vector<ll>& start_static, vector<ll>& end_static, ll skip_kai, ll rest_add, ll rest_end, vector<bool>& checked) {
    if (anymovenum < 0) {
        return false;
    }
    if (donenum == N) {
        return true;
    }
    if (start >= 2 * N) {
        return false;
    }

    if (start <= rest_end) {
        ll end = start + rest_add;
        if ((start_static[end] >= 0) ||
            (end_static[start] >= 0) ||
            (start_static[start] >= 0 && end_static[end] >= 0 && start_static[start] != end_static[end])) {
            return false;
        }
        ll anym = (start_static[start] >= 0 || end_static[end] >= 0) ? anymovenum : anymovenum - 1;
        return recursive(N, start + 1, donenum + 1, anym, start_static, end_static, skip_kai, rest_add, rest_end, checked);
    } else if (skip_kai) {
        return recursive(N, skip_kai, donenum, anymovenum, start_static, end_static, 0, -1, -1, checked);
    } else {
        if (checked[start]) {
            return false;
        }
        checked[start] = true;
        for (ll end = start + 1; true; end++) {
            if (end - 1 + end - start > 2 * N || end > start + N) {
                break;
            }
            if ((start_static[end] >= 0) ||
                (end_static[start] >= 0) ||
                (start_static[start] >= 0 && end_static[end] >= 0 && start_static[start] != end_static[end])) {
                continue;
            }
            ll anym = (start_static[start] >= 0 || end_static[end] >= 0) ? anymovenum : anymovenum - 1;
            bool ok = recursive(N, start + 1, donenum + 1, anym, start_static, end_static, end + end - start, (end - start), end - 1, checked);
            if (ok) {
                return true;
            }
        }
        return false;
    }
}

bool solve(ll N, vector<person>& persons) {
    set<ll> duplicate;
    for (auto p : persons) {
        if (p.a >= 0) {
            if (duplicate.count(p.a)) {
                return false;
            }
            duplicate.insert(p.a);
        }
        if (p.b >= 0) {
            if (duplicate.count(p.b)) {
                return false;
            }
            duplicate.insert(p.b);
        }
    }
    vector<ll> start_static(2 * N + 1, -1);
    vector<ll> end_static(2 * N + 1, -1);
    for (auto p : persons) {
        if (p.a >= 0) {
            start_static[p.a] = p.id;
        }
        if (p.b >= 0) {
            end_static[p.b] = p.id;
        }
    }
    ll anymovenum = 0;
    for (auto p : persons) {
        if (p.a == -1 && p.b == -1) {
            anymovenum++;
        }
    }
    vector<bool> checked(2 * N + 1, false);
    return recursive(N, 1, 0, anymovenum, start_static, end_static, 0, -1, -1, checked);
}

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

    vector<person> persons(N);
    for (ll i = 0; i < N; i++) {
        person p;
        cin >> p.a >> p.b;
        p.id = i;
        persons[i] = p;
    }
    if (solve(N, persons)) {
        print("Yes");
    } else {
        print("No");
    }
}


// Problem: C - Unexpressed
// Contest: AtCoder - Caddi Programming Contest 2021(AtCoder Beginner Contest
// 193) URL: https://atcoder.jp/contests/abc193/tasks/abc193_c Memory Limit:
// 1024 MB Time Limit: 2000 ms Powered by CP Editor
// (https://github.com/cpeditor/cpeditor)

/*-----------------------------------------------------------*/

#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define l long long
#define rep(i, x, n) for (i = x; i < n; i++)
#define all(a) a.begin(), a.end()
#define fill0(a) memset(a, 0, sizeof(a))
#define fill_1(a) memset(a, -1, sizeof(a))
#define pb push_back
#define v(n) vector<l> v(n)
#define mp(l) map<l, l> mp
#define mp1(s, l) map<string, l> mp1
#define s(x) x.size()
#define space cout << endl
#define YES cout << "YES\n"
#define Yes cout << "Yes\n"
#define NO cout << "NO\n"
#define No cout << "No\n"
#define mx 1e17
#define mn LONG_MIN
#define mod 1000000007
#define mode 998244351
#define in(a, x) binary_search(a.begin(), a.end(), x)
#define ina(a, n, x) binary_search(a, a + n, x)

#define see(args...)                         \
  {                                          \
    cerr << "LINE " << __LINE__;             \
    string _s = #args;                       \
    replace(_s.begin(), _s.end(), ',', ' '); \
    stringstream _ss(_s);                    \
    istream_iterator<string> _it(_ss);       \
    err(_it, args);                          \
    cerr << endl;                            \
  }
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << ' ' << *it << " = " << a;
  err(++it, args...);
}
inline void op() { cout << '\n'; }
template <typename T, typename... Types>
inline void op(T var1, Types... var2) {
  cout << var1 << ' ';
  op(var2...);
}
inline void ip() {}
template <typename T, typename... Types>
inline void ip(T& var1, Types&... var2) {
  cin >> var1;
  ip(var2...);
}
template <typename T, typename U>
inline void min_self(T& x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void max_self(T& x, U y) {
  if (x < y) x = y;
}
template <class T1, class T2>
ostream& operator<<(ostream& out, pair<T1, T2> pair) {
  return out << "(" << pair.first << ", " << pair.second << ")";
}
template <class T>
ostream& operator<<(ostream& out, vector<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ' ';
  return out << ")";
}
template <class T>
ostream& operator<<(ostream& out, set<T> vec) {
  out << "(";
  for (auto& v : vec) out << v << ", ";
  return out << ")";
}
template <class L, class R>
ostream& operator<<(ostream& out, map<L, R> vec) {
  out << "(";
  for (auto& v : vec) out << "[" << v.first << ", " << v.second << "]";
  return out << ")";
}
template <class A, class B>
istream& operator>>(istream& in, pair<A, B>& a) {
  return in >> a.first >> a.second;
}
template <class A>
istream& operator>>(istream& in, vector<A>& a) {
  for (A& i : a) in >> i;
  return in;
}
template <class Container>
void split(const std::string& str, Container& cont, char delim = ',') {
  stringstream ss(str);
  string token;
  while (std::getline(ss, token, delim)) {
    cont.push_back(token);
  }
}

void solve() {
  l n, i, j, k;
  ip(n);
  l ans = n;
  map<l, l> mp;
  for (i = 2; i <= 100005; i++) {
    l x = i * i;

    while (x < n) {
      if (mp[x] == 0) {
        ans--;
        mp[x]++;
      }
      x *= i;
    }
    if (x == n) {
      if (mp[x] == 0) {
        ans--;
        mp[x]++;
      }
    }
  }
  op(ans);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  int t;
  t = 1;
  // cin >> t;
  while (t--) {
    solve();
  }
}

	//IQ134高知能系Vtuberの高井茅乃です。
	//Twitter: https://twitter.com/takaichino
	//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

	#define INF INT_MAX
	#define LLINF LLONG_MAX
	#define REP(i,n) for(int i=0;i<n;i++)
	#define REP1(i,n) for(int i=1;i<=n;i++)
	#define MODA 1000000007
	#define MODB  998244353

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

	int main() {
		ll ans = 0;
		ll tmp = 0;
		int n; cin >> n;
		string s; cin >> s;
		vector<int> a(n+1); cin >> a;
		int mi[n+1] = {};
		REP(i, n) if(s[i] == '<') mi[i+1] = max(mi[i+1], mi[i]+1);
		for(int i = n; i >= 0; i--) if(s[i] == '>') mi[i] = max(mi[i], mi[i+1]+1);
		ans = INF;
		//REP(i, n+1) if(mi[i] > 0) ans = min(ans, (ll)(a[i]/mi[i]));
		REP(i, n) ans = min(ans, (ll)abs(a[i] - a[i+1]));
		cout << ans << endl;
		REP(i, ans){ REP(j, n+1){cout << (a[j] + i)/ ans << " ";} cout << endl;}
		//REP(i, ans - 1){ REP(j, n+1){cout << mi[j] << " ";} cout << endl;}
		//REP(i, n+1){cout << a[i] - mi[i] *(ans - 1) << " ";} cout << endl;
	}


#include <iostream>
#include <algorithm>
#include <cstring>
#define NMAX 101

using namespace std;

int frecv[NMAX], n, m, k, ans;
pair<int, int> ab[NMAX], cd[NMAX];

int res(int start) {
    memset(frecv, 0, sizeof(frecv));
    for (int i = 0; i < k; ++i)
        if (start & (1 << i))
            ++frecv[cd[i].first];
        else
            ++frecv[cd[i].second];

    int rez = 0;
    for (int i = 1; i <= m; ++i)
        if (frecv[ab[i].first] && frecv[ab[i].second])
            ++rez;
    return rez;
}

int main() {
    cin >> n >> m;
    for (int i = 1; i <= m; ++i)
        cin >> ab[i].first >> ab[i].second;
    cin >> k;
    for (int i = 0; i < k; ++i)
        cin >> cd[i].first >> cd[i].second;

    for (int i = 0; i < 1<<k; ++i)
        ans = max(ans, res(i));
    cout << ans;
    return 0;
}

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

// Sieve of Eratosthenes
// https://youtu.be/UTVg7wzMWQc?t=2774
struct Sieve {
    int n;
    vector<int> f, primes;
    Sieve(int n = 1) : n(n), f(n + 1) {
        f[0] = f[1] = -1;
        for (ll i = 2; i <= n; ++i) {
            if (f[i]) continue;
            primes.push_back(i);
            f[i] = i;
            for (ll j = i * i; j <= n; j += i) {
                if (!f[j]) f[j] = i;
            }
        }
    }
    bool isPrime(int x) { return f[x] == x; }
    vector<int> factorList(int x) {
        vector<int> res;
        while (x != 1) {
            res.push_back(f[x]);
            x /= f[x];
        }
        return res;
    }
    vector<P> factor(int x) {
        vector<int> fl = factorList(x);
        if (fl.size() == 0) return {};
        vector<P> res(1, P(fl[0], 0));
        for (int p : fl) {
            if (res.back().first == p) {
                res.back().second++;
            } else {
                res.emplace_back(p, 1);
            }
        }
        return res;
    }
    vector<pair<ll, int>> factor(ll x) {
        vector<pair<ll, int>> res;
        for (int p : primes) {
            int y = 0;
            while (x % p == 0) x /= p, ++y;
            if (y != 0) res.emplace_back(p, y);
        }
        if (x != 1) res.emplace_back(x, 1);
        return res;
    }
};

ll A, B;
unordered_map<ll, int> mp;
ll dp[1 << 20][74];

ll dfs(ll t, int mask) {
    if (dp[mask][t - A] != 0) {
        return dp[mask][t - A];
    }
    if (t > B) {
        return dp[mask][t - A] = 1;
    }

    int tmask = mp[t];
    ll retVal = 0;
    // cerr << "tmask =" << tmask << "bit wise=" << bitset<20>(mask & tmask) << endl;
    if ((mask & tmask) == 0) {
        retVal += dfs(t + 1, mask | tmask);
    }
    retVal += dfs(t + 1, mask);
    return dp[mask][t - A] = retVal;
}

void solve() {
    Sieve sieve(72);
    for (ll i = A; i <= B; i++) {
        int mask = 0;
        rep(j, sieve.primes.size()) {
            if (i % sieve.primes[j] == 0) {
                mask |= (1 << j);
            }
        }
        // cerr << "i=" << i << " mask=" << mask << endl;
        mp[i] = mask;
    }
    dfs(A, 0);
    cout << dp[0][0] << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main() {
    scanf("%lld", &A);

    scanf("%lld", &B);
    solve();
    return 0;
}


//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES

#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <functional>
#include <utility>
#include <tuple>
#include <vector>
#include <string>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <deque>
#include <stack>
#include <iterator>
#include <bitset>
#include <complex>
#include <limits>
#include <random>
#include<fstream>
#include<array>
#include<assert.h>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;

const double EPS = 1e-9;

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

	int N;
	cin >> N;

	int X;
	cin >> X;

	vector<int> A(N);
	rep(i, 0, N)
	{
		cin >> A[i];
	}

	if (A[0] > X || X % A[0] != 0)
	{
		cout << 0 << endl;
		return 0;
	}
	X /= A[0];
	rrep(i, 0, N)
	{
		A[i] /= A[0];
	}
	A.push_back(INF);

	map<int, int> DP;
	DP[X] = 1;
	rrep(i, 0, N)
	{
		int t = A[i + 1] / A[i] - 1;
		map<int, int> NDP;
		for (const auto& p : DP)
		{
			if (abs(p.first) < A[i])
			{
				NDP[p.first] += p.second;
			}
			int d = p.first - A[i];
			int cnt = 0;
			if (d > 0)
			{
				cnt += d / A[i];
				d = d - d / A[i] * A[i];
			}
			while (cnt < t&&abs(d) < A[i])
			{
				NDP[d] += p.second;
				d -= A[i];
				cnt++;
			}
			d = p.first + A[i];
			cnt = 0;
			if (d < 0)
			{
				cnt += (-d) / A[i];
				d = d + (-d) / A[i] * A[i];
			}
			while (cnt<t&&abs(d) < A[i])
			{
				NDP[d] += p.second;
				d += A[i];
				cnt++;
			}
		}
		DP = NDP;
	}

	cout << DP[0] << endl;

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
vector<long>p(60);map<pair<long,int>,long> m;long n,x;
long z(long a,int i) {
    if (i == n)return 1;
    if (m.count({a, i}))return m[{a, i}];
    long r, y = p[i], b = a-a%y;
    if (a % y == 0)r = z(a, i + 1);
    else if (a > 0)r = z(b, i + 1) + z(b + y, i + 1);
    else r = z(b, i + 1) + z(b - y, i + 1);
    return m[{a, i}] = r;
}
int main() {
    cin >> n >> x;
    for (int i = 0; i < n; i++)cin >> p[i];
    cout << z(x, 1);
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll x, y, a, b; cin >> x >> y >> a >> b;
  ll tmp = 0;
  ll ans = 0;
  while(x < y) {
    chmax(ans, (y-x-1)/b+tmp);
    if(y/x < a) break;
    x *= a;
    tmp++;
  }
  cout << ans << endk;
  return 0;
}

#include <bits/stdc++.h>
typedef long int l;
typedef unsigned long int ul;
typedef long long int ll;
typedef unsigned long long int  ull;
#define endl '\n'
#define PB push_back
#define MP make_pair
#define fs first
#define sd second
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1   e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
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;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
l gcd(l a, l b){return b?gcd(b,a%b):a;}
l lcm(l a, l b){return a/gcd(a,b)*b;}

void solve_test(){

      int a , b , x , y ;
      l answer ;
      cin >> a >> b >> x >> y ;

      if(a == b){

            cout << x <<endl ;
            return ;

      }

      if( a < b){
            answer = x + (b - a ) * y ;

            answer = min(answer , (l)(2 *(b-a) + 1) * x )  ;

            cout << answer << endl;
            return ;
      }

      if(a > b ){
            answer = x + ( a - b -1) * y ;
            answer = min(answer , (l)(2 *(a-b) -1) * x )  ;
            cout << answer << endl ;
            return ;
      }

}

int main(){
    cin.sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    l test = 1 ;
    //cin>>test;
    while(test--){

        solve_test();

    }

    return 0 ;
}


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

#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
#define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__); // __VA_ARGS__可変引数マクロ
template<typename T> void MACRO_VAR_Scan(T& t) { std::cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest& ...rest) { std::cin >> first; MACRO_VAR_Scan(rest...); }
#define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
#define MAT(type, c, m, n) std::vector<std::vector<type>> c(m, std::vector<type>(n));for(auto& R:c)for(auto& w:R)std::cin>>w;
template<typename T>void MACRO_OUT(const T t) { std::cout << t; }
template<typename First, typename...Rest>void MACRO_OUT(const First first, const Rest...rest) { std::cout << first << " "; MACRO_OUT(rest...); }
#define OUT(...) MACRO_OUT(__VA_ARGS__);
#define FOUT(n, dist) std::cout<<std::fixed<<std::setprecision(n)<<(dist); // std::fixed 浮動小数点の書式 / setprecision 浮動小数点数を出力する精度を設定する。
#define SP std::cout<<" ";
#define BR std::cout<<"\n";
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define ENDL std::cout<<std::endl;
#define FLUSH std::cout<<std::flush;
#define ALL(a) (a).begin(),(a).end()
#define FOR(w, a, n) for(int w=(a);w<(n);++w)
#define REP(w, n) for(int w=0;w<int(n);++w)
#define IN(a, x, b) (a<=x && x<b)
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; }
template<class T> using V = std::vector<T>;
template<class T> using VV = V<V<T>>;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using PAIR = std::pair<int, int>;
using PAIRLL = std::pair<ll, ll>;
constexpr int INFINT = (1 << 30) - 1;                    // 1.07x10^ 9
constexpr int INFINT_LIM = (1LL << 31) - 1;              // 2.15x10^ 9
constexpr ll INFLL = 1LL << 60;                          // 1.15x10^18
constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62);  // 9.22x10^18
constexpr double eps = 1e-7;
constexpr int MOD = 1000000007;
constexpr double PI = 3.141592653589793238462643383279;
template<class T, size_t N> void FILL(T(&a)[N], const T & val) { for (auto& x : a) x = val; }   //  int a[5] = {1,2,3,4,5};	FILL(a,10);
template<class ARY, size_t N, size_t M, class T> void FILL(ARY(&a)[N][M], const T & val) { for (auto& b : a) FILL(b, val); }  // ２次元配列でもそのまま使える
template<class T> void FILL(std::vector<T> & a, const T & val) { for (auto& x : a) x = val; }   //	使い方 vector<int> a(3);	FILL(a,10);
template<class ARY, class T> void FILL(std::vector<std::vector<ARY>> & a, const T & val) { for (auto& b : a) FILL(b, val); }  // ２次元配列でもそのまま使える

int main() {
INIT;

VAR(ll,n)
ll i =2;
// V<bool> done(n +1);
map<int,bool> done;
ll ans =0;
while(1){
    if(i *i > n) break;
    if(done[i] !=1 ){
        __int128_t out =0;
        ll j =2;
        while(1){
            out = pow(i , j);
            if(out > n) break;
            done[out] = true;
            ans++;
            j++;
        }
    }
    i++;
}
OUT( n -ans)

return 0;
}

    #include<bits/stdc++.h>
    //#include <ext/pb_ds/assoc_container.hpp>
    //#include <ext/pb_ds/tree_policy.hpp>
    #define ll long long
    #define pb push_back
    #define mod 1000000007
    #define ff first
    #define ss second
    #define pi 3.1415926535
    #define endl '\n'
    using namespace std;
    struct custom {
        static uint64_t splitmix64(uint64_t x)
        {
            x += 0x9e3779b97f4a7c15;
            x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
            x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
            return x ^ (x >> 31);
        }
        size_t operator()(uint64_t x) const {
            static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
            return splitmix64(x + FIXED_RANDOM);
        }
    };
    //using namespace __gnu_pbds;
    //typedef tree<ll,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
    const ll inf=4e10;
    /*ll power(ll x,ll y)
    {
        ll res=1;
        while(y>0)
        {
            if(y%2==1)
                res=(res*x)%mod;
            x=(x*x)%mod;
            y=(y>>1);
        }
        return res;
    }*/
    int main()
    {
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
       unordered_map<ll,ll,custom>mp;
        ll i,a,b,c,d,n,x,f=0;
        cin>>n;
        c=0;
        for(i=2;i<=1e5;i++)
        {
            a=i*i;
            while(a<=n)
            {
                if(mp[a]==0)
                {
                    c++;
                    mp[a]=1;
                }
                a=a*i;
            }
        }
        cout<<n-c<<endl;
    }


/*@author Vipen Loka*/
#include <bits/stdc++.h>
#define endl '\n'
#define ff first
#define ss second
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define deb(x) cout << #x << ':' << x << '\n';

using namespace std;
template<class T>void show(vector<T> &a) {cerr << "[ "; for (int ij = 0; ij < (int)a.size(); ij++) {cerr << a[ij] << " ";} cerr << "]\n";}
template<class T>void show(T a) {cerr << a << endl;}
template<typename... T>void show(T... args) {((cerr << args << ' '), ...); cerr << endl;}

void solve() {
	int i, j;

	map<int, int> mp;

	mp[0] = 0;
	mp[1] = 1;
	mp[6] = 9;
	mp[8] = 8;
	mp[9] = 6;

	string s;
	cin >> s;

	for (int i = s.size() - 1; i >= 0; i--) {
		int n = s[i] - '0';
		cout << mp[n];
	}
	cout << endl;

}

int32_t main(int32_t argc, char *argv[]) {
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int T = 1;
	// cin >> T;
	while (T--) {
		solve();
	}
	cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
}

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

int main() {
    int n;
    cin >> n ;
    cout << n - 1 << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define SZ(x) ((int)(x).size())
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout << fixed
#define endl '\n'

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

void solve(istream& cin, ostream& cout) {
  string s;
  cin >> s;
  int n = s.size();
  REVERSE(s);
  map<char, char> mp;
  mp['0'] = '0';
  mp['1'] = '1';
  mp['6'] = '9';
  mp['8'] = '8';
  mp['9'] = '6';
  string t = "";
  REP(i, n) t += mp[s[i]];
  cout << t << endl;
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
  return 0;
}
#endif

#include <cstdio>

int n, a[300006];
long long res, sum;

int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%d", a + i);
    for (int i = 0; i < n; i++) res += (n - 1LL) * a[i] * a[i];
    for (int i = 0; i < n; i++) res -= 2 * a[i] * sum, sum += a[i];
    printf("%lld", res);
}


#include<bits/stdc++.h>
#define rep(i,m,n) for (int i=m;i<n;i++)
using namespace std;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);

	int N,K,M;
	cin>>N>>K>>M;
	int sum=0;
	rep(i,0,N-1){
		int data;
		cin>>data;
		sum +=data;
	}
	if(sum/N>=M){
			cout<<0<<endl;
			return 0;
		}

	rep(i,0,K+1){
		int d=(sum+i)/N==M;
		if(d)
			{
				cout<<i<<endl;
				return 0;
			}

	}
	cout<<-1<<endl;
}

#include<bits/stdc++.h>
using namespace std;
#define foreach(i,n) for(auto&i:(n))
#define all(x) (x).begin(),(x).end()
using ll = long long;

template<class t>
auto collect(int n,t f){
    vector<decltype(f())> res(n);
    for(auto &i:res){
        i = f();
    }
    return res;
}

template<class t,class f>
auto mapcar(t x,f func){
    int n = x.size();
    vector<typename t::value_type> res(n);
    auto itr = res.begin();
    for(auto &i:x){
        *itr = func(i);
        ++itr;
    }
    return res;
}
template<class t,class f>
void mapc(t x,f func){
    for(auto &i:x){
        func(i);
    }
}
template<class t,class u>
auto sellect(t x,u f){
    vector<typename t::value_type> res;
    for(auto &i:x){
        if(f(i)){
            res.push_back(i);
        }
    }
    return res;
}

ll in(){
    ll res;
    scanf("%lld",&res);
    return res;
}

int main(){
    int n = in();
    int k = in();
    int m = in();
    vector<ll> line = collect(n-1,in);
    ll ans = n * m - accumulate(all(line),0ll);
    if(ans<=k){
        cout << max(0ll,ans) << endl;
    }else{
        cout << -1 << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
const ll INF=4e18;
const int inf=1e9;
const double pi=acos(-1);
ll n, ans;

ll cek(ll pos, ll pjg){
	return pjg*(2*pos+(pjg-1))/2;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n;
	for(int len=1;len<=2000000;++len){
		ll l=1, r=n;
		while(l<=r){
			ll mid=(l+r)/2;
			ll cur=cek(mid, len);
			if(cur==n){
				ans+=2;
				break;
			}
			else if(cur>n){
				r=mid-1;
			}
			else l=mid+1;
		}
	}
	cout << ans << '\n';
}

// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,mmx,avx,avx2")
#include "bits/stdc++.h"

#define     ll                long long
#define     ul                unsigned long long
#define     ld                long double
#define     rep(i, a, b)      for(int i=(a); i<(b); i++)
#define     repi(i, a, b)     for(int i=(a); i>(b); i--)
#define     all(x)            x.begin(), x.end()
#define     rall(x)           x.rbegin(), x.rend()
#define     db(x)             (cout<<#x<<":"<<(x)<<'\n')
#define     fastio            ios_base::sync_with_stdio(false), cin.tie(nullptr)
#define     gcd               _gcd
#define     lcm(a,b)          __detail::__lcm(a,b)
#define     goog(tno)         cout << "Case #" << tno <<": "
#define     pb                push_back
#define     endl              "\n"
#define     iceil(n, x)       (((n) + (x) - 1) / (x))

const ll mod = 1000000007;
const ld pi = 3.1415926535897932384626433832795;
const ll INF = 1e18;

using namespace std;

void solve()
{
	ll n;
	cin >> n;
	ll cnt = 0;
	for (ll i = 1; (i * (i - 1)) / 2 < n; i++)
	{
		ll start = (n - ((i * (i - 1)) / 2)) / i;
		if ((start * i + (i * (i - 1)) / 2) == n)
			cnt++;

	}
	cout << cnt * 2 << endl;
}

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