#include <bits/stdc++.h>
using namespace std;
#define range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r)-1; i >= (int)(l); (i) -= 1)
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) { a = (a > b ? a : b); }
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) { a = (a < b ? a : b); }
template <typename T1, typename T2> ostream &operator<<(ostream &os,const pair<T1,T2> &p) { os<<p.first<<' '<<p.second; return os;}
template <typename T> ostream &operator<<(ostream &os,const vector<T> &v) { range(i,0,v.size()) {os<<(i?" ":"")<<v[i];} return os;}
using ull = unsigned long long;
using ll = long long;
using Pll = pair<ll, ll>;
using P = pair<int, int>;
constexpr ll INF64 = INT64_MAX / 2;
constexpr int INF32 = INT32_MAX / 2;
constexpr int dy[] = {0,-1,1,0,-1,1,-1,1};
constexpr int dx[] = {-1,0,0,1,-1,-1,1,1};
constexpr int mod998244353 = 998244353;
constexpr int mod1000000007 = (int)1e9 + 7;
constexpr char newl = '\n';

int main() {
  int n,D,H;
  cin>>n>>D>>H;

  double ans=0.0;
  vector<P> dh(n);
  range(i,0,n){
    auto &[d,h]=dh[i];
    cin>>d>>h;
    chmax(ans,(double)(0-d)*(H-h)/(D-d) + h);
  }
  cout<<fixed<<setprecision(10);
  cout<<ans<<endl;
}

#include <bitset>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <valarray>

// alias, using declaration
using llint = long long; using ldouble = long double;
template <class T = llint> using vector = std::vector<T>;
template <class T = llint> using deque = std::deque<T>;
template <class T = llint, class U = llint, class... V> using map = std::map<T, U, V...>;
template <class T = llint, class... U> using set = std::set<T, U...>;
template <class T = llint, class U = llint> using umap = std::unordered_map<T, U>;
template <class T = llint> using uset = std::unordered_set<T>;
template <class T = llint, class U = T> using pair = std::pair<T, U>;
template <class T = llint> using varray = std::valarray<T>;
template <class T = llint, class... U> using pqueue = std::priority_queue<T, U...>;
using std::array; using std::bitset; using std::string; using std::tuple;

// constant
constexpr llint INF = 0x3FFFFFFFFFFFFFFF;
constexpr llint INVALID = 0x8000000000000000;

namespace io {
  // in
  template <class... T, size_t... S> auto in(std::index_sequence<S...>) {tuple<T...> t; (..., (std::cin >> std::get<S>(t))); return t;}
  template <class... T, size_t... S> auto in(std::index_sequence<S...>, size_t n) {tuple<vector<T>...> t{vector<T>(n)...}; for (size_t i = 0; i < n; i++) (..., (std::cin >> std::get<S>(t)[i])); return t;}
  template <size_t N, class T = llint, class... U> auto in() {static_assert(N >= 1); if constexpr (N > 1) return in<N - 1, T, T, U...>(); else return in<T, U...>(std::index_sequence_for<T, U...>());}
  template <size_t N, class T = llint, class... U> auto in(size_t n) {static_assert(N >= 1); if constexpr (N > 1) return in<N - 1, T, T, U...>(n); else return in<T, U...>(std::index_sequence_for<T, U...>(), n);}
  template <size_t N, class T = llint> auto in(size_t n, size_t m) {static_assert(N == 1); vector<vector<T>> v(n, vector<T>(m)); for (auto&& vi : v) for (auto&& vij : vi) std::cin >> vij; return std::make_tuple(v);}
  // out
  template <class T, class... U> void out(const T& a, const U&... b) {std::cout << a << (sizeof...(b) ? " " : "\n"); if constexpr (sizeof...(b)) out(b...);}
  template <class T, class U = const char*> void out(const vector<T>& a, U d = " ") {for (auto&& b : a) std::cout << b << (&b != &a.back() ? d : "\n");}
}

int main() {
  // input
  auto [a, b, c] = io::in<3>();

  // solve
  auto result = (7 - a) + (7 - b) + (7 - c);

  // output
  io::out(result);
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using pl = pair<ll, ll>;
const ll INF = ll(1e18);
const ll mod = ll(998244353);
const double pi = acos(-1);
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rnfor(i,a,b) for(ll (i) = (b) - 1; (i) >= (a); --(i))
#define pf(x) cout << (x) << endl
#define all(x) (x).begin(),(x).end()
#define yes pf("Yes")
#define no pf("No")
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; }
const int dx[8]={1,0,-1,0,1,1,-1,-1};
const int dy[8]={0,1,0,-1,1,-1,1,-1};

int multipf(vector<string>& s){
    cout << s[0];
    rep1(i, s.size() - 1)cout << " " << s[i];
    cout << endl;
    return 0;
}

int multipf(vector<ll>& n){
    cout << n[0];
    rep1(i, n.size() - 1)cout << " " << n[i];
    cout << endl;
    return 0;
}

ll gcd(ll a,ll b){
    if(a < b)swap(a, b);
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll ans = 1;
    rep1(i, n){
        ans *= i;
        ans %= mod;
    }
    return ans;
}

ll power(ll a, ll b){
    ll ans = 1;
    while(b) {
        if(b & 1LL) ans = ans * a % mod;
        ans %= mod;
        a = a * a;
        a %= mod;
        b >>= 1;
    }
    return ans % mod;
}

struct seg {
    ll n;
    vector<ll> dat;
    seg(ll m) : n(), dat(m * 4, 0) {
        int x = 1;
        while (m > x) {
            x *= 2;
        }
        n = x;
    }
    void update(ll i, ll x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;
            dat[i] = dat[i * 2 + 1] ^ dat[i * 2 + 2];
        }
    }

    ll query(ll a, ll b) { return query_sub(a, b, 0, 0, n); }
    ll query_sub(ll a, ll b, ll k, ll l, ll r) {
        if (r <= a || b <= l) {
            return 0;
        } else if (a <= l && r <= b) {
            return dat[k];
        } else {
            ll vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
            ll vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
            return (vl ^ vr);
        }
    }
};

//modの値の確認をすること
int main(){
    ll n,ans = 1e10;
    string s;
    cin >> n >> s;
    if(n == 1 && s[0] == '1'){
        pf(ans * 2);
        return 0;
    }
    if(n == 2 && s[0] == '1' && s[1] == '1'){
        pf(ans);
        return 0;
    }
    ll c = INF,cnt = 0;
    rep0(i, n)if(s[i] == '0'){
        c = i;
        ++cnt;
        break;
    }
    if(c > 2){
        ans = 0;
    }else{
        nfor(i, c + 1, n){
            if(s[i] == '0'){
                if(i - c != 3){
                    ans = 0;
                }
                c = i;
                ++cnt;
            }
        }
    }
    if(ans == 0){
        pf(0);
    }else if(s[n - 1] == '1'){
        pf(ans - cnt);
    }else{
        pf(ans - cnt + 1);
    }
    return 0;
}

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define DIV 1000000007 //10^9+7
#define INF LONG_MAX/3

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 dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

vector<pair<ll, ll> > CON[20];

ll dp[20][272144];

int main(){
	ll N, M;
	cin >> N >> M;
	rep(i, M) {
		ll x, y, z;
		cin >> x >> y >> z;
		x--;y--;
		CON[x].push_back(make_pair(y, z));
	}

	dp[0][0] = 1;
	rep(i, N) {
		rep(mask, (1LL<<N)) {
			if(dp[i][mask] == 0) continue;
			rep(next, N) {
				if((mask>>next)&1) continue;
				ll nmask = mask | (1LL<<next);

				dp[i+1][nmask] += dp[i][mask];
			}
		}

		rep(mask, (1LL<<N)) {
			bool ng = false;

			for(auto item: CON[i]) {
				ll y = item.first;
				ll z = item.second;
				ll num = 0;
				rep(bit, y+1) if((mask>>bit)&1) num++;
				if(num > z) {
					ng = true;
					break;
				}
			}

			if(ng) dp[i+1][mask] = 0;
		}
	}

	ll ans = 0;
	rep(mask, (1LL<<N)) {
		ans += dp[N][mask];
	}
	cout << ans << endl;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
  	int n, w;
  	cin >> n >> w;
  	cout << n / w;
	return 0;
}

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

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

#define pb                    push_back
#define ll                    long long
#define ld                    long double
#define sz(x)                 (ll)x.size()
#define vll                   vector<long long>

#define infi                  INT_MAX
#define infl                  LONG_LONG_MAX
#define infd                  LDBL_MAX
#define f(i,a,b)              for(ll i=a;i<b;i++)
#define fi(i,a,b)             for(ll i=(b-1);i>=a;i--)
#define F                     first
#define S                     second
#define G(a,b)                get<a>(b)
#define MP                    make_pair
#define MT                    make_tuple
#define pll                   pair<ll,ll>
#define endl                  "\n"
#define ALL(v)                v.begin(),v.end()
#define nl                    cout<<"\n";
#define pr(x)                 cout<<x;
#define pr1(x)                cout<<x<<" ";
#define pr2(x,y)              cout<<x<<" "<<y;
#define pr3(x,y,z)            cout<<x<<" "<<y<<" "<<z;
#define pr4(x,y,z,w)          cout<<x<<" "<<y<<" "<<z<<" "<<w;
#define deb                   cout<<"***************************************************************************************\n";
#define moshi                 cout<<"moshi moshi ! \n";
#define hi                    cout<<"hi ! \n";
#define bye                   cout<<"bye bye ! \n";
#define kawai                 cout<<"O kawai koto ! \n";
#define o_set                 tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define number_of_set_bits  __builtin_popcountll
#define eb                    emplace_back
const ld PI=3.1415926535897932384626433;

auto clk=clock();
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
        cout << name << " : " << arg1 <<"\n";
        //use cerr if u want to display at the bottom
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
        const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
#else
#define trace(...)
#endif

//**********************************************************  Code begins  ***********************************************

// infl=2^63-1
// cout.flush()

void solve()
{
  ll x,y;
  cin>>x>>y;
  ll ans=x/y;
  cout<<ans<<"\n";
}

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout<<fixed<<setprecision(8);

    ll test_cases=1;
    //cin>>test_cases;

    f(i,1,test_cases+1)
    {
      solve();
    }

    #ifdef rd
    cout<<endl<<endl<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
    #endif

    return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); ++ i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++ i)
#define foreach(itr, c) for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); ++ itr)

typedef long long LL;
typedef pair<int, int> pii;

int n;

int main()
{
    scanf("%d", &n);
    if (n == 3){
        printf("6 10 15\n");
        return 0;
    }
    for (int i = 1; i <= 10000; ++ i){
        if (n == 0) break;
        int cnt = 0;
        if (i % 2 == 0) cnt ++;
        if (i % 3 == 0) cnt ++;
        if (i % 5 == 0) cnt ++;
        if (cnt > 1) {
            printf("%d ", i);
            n --;
        }
    }

    printf("\n");

    return 0;
}

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define str to_string
#define endl "\n"
#define PI 3.141592653589
using namespace std;
using lint = long long;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

//AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC
int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int n,p=0,tmp;cin>>n;
    vector<int> vec(300000);
    for(int i=0;i<n;i++){
        cin>>tmp;
        vec[tmp]=1;
        while(true){
            if(vec[p])p++;
            else break;
        }
        cout<<p<<endl;
    }
}


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

int main() {
	long long N;
	cin >> N;
	vector<int> A(N);
	for (int i = 0; i < N; i++) cin >> A[i];
	sort(A.begin(), A.end());
	long long ans = 0;
	long long start = 0, end = 1;
	while (end < N) {
		if (A[start] != A[end]) {
			ans += (end-start)*(N - end);
			start = end;
			end = start + 1;
			continue;
		}
		end++;
	}
	cout << ans << endl;
	return 0;
}

#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
using namespace std;

#define pq_max          priority_queue<ll>
#define pq_min          priority_queue<ll,vi,greater<ll>>
#define iint int
#define f(i,a,b)        for(ll i=a;i<b;i++)
#define f0(i,n)         f(i,0,n)
#define fr(i,a,b)       for(ll i=a;i>=b;i--)
#define for1(i,n)       for(ll i=1;i<=n;i++)
#define pb              push_back
#define tc(t)           int t;cin >>t;while(t--)
#define lol             std::ios::sync_with_stdio(false); cin.tie(NULL);
#define endl            "\n"
#define ss              second
#define ff              first
#define ll              long long
#define lld             long double
#define int             long long
#define pii             pair< int,int >
#define pll             pair< ll,ll >
#define sz(a)           a.size()
const long long  inf = 1e18;
#define all(a)          a.begin(),a.end()
#define rall(a)         a.rbegin(),a.rend()
#define arr(a,n)        int a[n];f0(i, n) cin >> a[i];
#define ini(a,n)        memset(a,n,sizeof(a))
#define printArr(a,n)   f0(i,n) cout<<a[i]<<" ";
// #define in              cin>>
#define rr              return 0;
#define vi              vector< int >
#define vs              vector<string>
#define l_b             lower_bound
#define u_b             upper_bound
#define mod             1000000007
#define pi              3.141592653589793238
#define fmap(m)         for(auto it:m)
#define deb(args...)    { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define debarr(arr,a,b) for(int i=(a);i<(b);i++) cout<<(arr[i])<<" ";cout<<endl;
#define long_max        numeric_limits<ll>::max()
vs tokenizer(string str, char ch) {std::istringstream var((str)); vs v; string t; while (getline((var), t, (ch))) {v.pb(t);} return v;}

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

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

int dx4[4] = { +1 , -1 , +0 , +0};
int dy4[4] = { 0  , 0 , +1 , -1};

int dx2[2] = {0, 1};
int dy2[2] = {1, 0};

const int N = 1e6 + 1;

void solve()
{

    int n;
    cin >> n;
    arr(a, n);
    map<int, int>m;
    f0(i, n)
    m[a[i]]++;
    int ans = 0 ;
    for (int i = 0; i < n - 1; i++)
    {
        int element = n - i - m[a[i]];
        // deb(element);
        m[a[i]]--;

        ans += max(0ll , element);
    }
    cout << ans << "\n";
}

signed main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    lol;

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


//#include <tourist>
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
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;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//g++ yarudake.cpp -std=c++17 -I .
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    if(n%2){
        cout<<"Black"<<"\n";
    }
    else{
        cout<<"White"<<"\n";
    }
}

#include<iostream>
using namespace std;
int main()
{
	int n,day;
	cin>>n;
	day=1;
	day=day+n;
	if(day%2==1)cout<<"White";
	else cout<<"Black";
	return 0;

}


#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

const ll INF=1e19;

const ll mod = 1e9+7;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(ll n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (ll i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (ll i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(ll n, ll k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
  mint p(ll n, ll k) {
    return fact[n]*ifact[n-k];
  }
} c(1000005);

int main(){
    ll h,w;
    cin >> h >> w;
    vector<string> s(h);
    vector<vector<ll>> a(h,vector<ll>(w)),b(h,vector<ll>(w));
    vector<vector<ll>> num(h,vector<ll>(w));
    rep(i,h){
        cin>> s[i];
    }
    ll k=0;
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='.') k++;
        }
    }
    rep(i,h){
        ll cnt=0;
        rep(j,w){
            if(s[i][j]=='.') cnt++;
            else cnt=0;
            a[i][j]=cnt;
        }
        ll now=0;
        bool none=true;
        for(ll j=w-1;j>=0;j--){
            if(a[i][j]!=0 && none){
                now=a[i][j];
                none=false;
            }
            if(a[i][j]==0){
                none=true;
                now=0;
            }
            a[i][j]=now;
        }
    }

    rep(i,w){
        ll cnt=0;
        rep(j,h){
            if(s[j][i]=='.') cnt++;
            else cnt=0;
            b[j][i]=cnt;
        }
        ll now=0;
        bool none=true;
        for(ll j=h-1;j>=0;j--){
            if(b[j][i]!=0 && none){
                now=b[j][i];
                none=false;
            }
            if(b[j][i]==0){
                none=true;
                now=0;
            }
            b[j][i]=now;
        }
    }

    rep(i,h){
        rep(j,w){
            num[i][j]=a[i][j]+b[i][j]-1;
            //cout << num[i][j] << endl;
        }
    }
    mint two=2;
    mint ans=0;
    rep(i,h){
        rep(j,w){
            if(s[i][j]=='#') continue;
            mint x=num[i][j];
            mint y=k;
            y-=x;
            mint z=two.pow(x.x);
            mint u=two.pow(y.x);
            z-=1;
            mint tot=z*u;
            ans+=tot;
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll=long long;
using ld=long double;
using pll=pair<ll, ll>;
//using mint = modint1000000007;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo 2e18
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
//priority_queue<ll, vector<ll>, greater<ll>> Q;
/*
bが入ったら、aの、それ未満を上書き。　それ以上は関係ない
aが入ったら、bの未満を上書き
BIT2つかな

*/
// BIT,index = 1 ~ (0を投げるととまる）
// https://atcoder.jp/contests/abc174/submissions/21572028
//indexにする・・・？ちょうたいへん

#define M 200010
ll dat1[M], dat2[M], dat3[M], dat4[M]; //34=累積いれとく？

void add(ll i, ll x, ll id){
  if (id==1)
    for(; i<M; i += i&-i) dat1[i] += x;
  if (id==2)
    for(; i<M; i += i&-i) dat2[i] += x;
  if (id==3)
    for(; i<M; i += i&-i) dat3[i] += x;
  if (id==4)
    for(; i<M; i += i&-i) dat4[i] += x;
}

ll sum(ll i, ll id){
  ll res = 0;
  if (id==1)
    for(; i>0; i -= i&-i) res += dat1[i];
  if (id==2)
    for(; i>0; i -= i&-i) res += dat2[i];
  if (id==3)
    for(; i>0; i -= i&-i) res += dat3[i];
  if (id==4)
    for(; i>0; i -= i&-i) res += dat4[i];
  return res;
}

ll rangesum(ll L, ll R, ll id){
  return sum(R, id) - sum(L-1, id);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  ll n, m, q;
  cin >> n >> m >> q;
  ll used[3][200010]; //t, x
  rep(i, 3) rep(j, 200010) used[i][j]=1;
  ll ans = n*m;
  add(1, n, 1); //1->0
  add(1, m, 2);
  add(1, n, 3); //1->0
  add(1, m, 4);
  //34が累積和
  ll T[200010];
  ll X[200010];
  ll Y[200010];
  map<ll, ll> mp1; // val->id
  map<ll, ll> mp2; // id->val
  set<ll> se;
  se.insert(1);
  rep(i, q){
    cin >> T[i] >> X[i] >> Y[i];
    Y[i]++;
    se.insert(Y[i]);
  }
  ll cnt = 1;
  for(auto v: se){
    mp1[v] = cnt++;
  }
  cnt=1;
  for(auto v: se){
    mp2[cnt++]=v;
  }
  rep(i, q){
    ll t=T[i];
    ll x=X[i];
    ll y=Y[i];
    ll z=used[t][x]; //val
    //まず除く
    ll zz=mp1[z];//id
    ans -= z*sum(zz, t^3); // もとあった値をなかったことに
    ans += sum(zz, (t^3)+2); // なかった場合の復元
    add(zz, -1, t);
    add(zz, -z, t+2);//累積
    used[t][x]=y;
    ll yy=mp1[y]; //id
    ans -= sum(yy, (t^3)+2);
    ans += y*sum(yy, (t^3));
    add(yy, 1, t);
    add(yy, y, t+2);
    cout << ans -n*m<< endl;
  }
}


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

using ll  = long long;
using ull = unsigned ll;
using ld  = long double;
using pi  = pair<int, int>;
using pii = pair<ll, ll>;
using vi  = vector<int>;
using vii = vector<ll>;
using vip = vector<pair<int, int>>;

const int MAX_N = 1e5 + 1;
const ll mod = 1e9 + 7;
const ll INF = 1e9;

#define PI           3.141592653589793238
#define fir          first
#define sec          second
#define all(x)       (x).begin(),(x).end()
#define rall(x)      (x).rbegin(),(x).rend()
#define pb           push_back
#define mp           make_pair
#define loop(i,n,x)  for(int i=n;i<x;i++)
#define sz(a)        ((int) (a).size())
#define For(n,x)     for(int i=1;i<=x;i++)
#define ite          iterator it
#define fast         ios_base::sync_with_stdio(false);cin.tie(NULL);
#define test         ll t;cin>>t; while(t--){solve();}
#define in           insert

void oj()
{

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

}
ll lcm(ll a, ll b)
{
	return (a / __gcd(a, b)) * b;
}
ll power(ll x)

{
	ll res = 1;
	for (int i = 1; i <= x; i++)
	{
		res *= 2;
	}
	return res;
}

void solve()
{
	int n;
	cin >> n;
	int ans = 0;
	loop(i, 0, n)
	{
		int x;
		cin >> x;
		if (x > 10)
			ans += (x - 10);
	}
	cout << ans << endl;

}

int main()
{

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

	oj();

	//test;
	solve();

}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    int ans=0;
    cin>>n;
    int A[n];
    for(int i=0;i<n;i++)
    {
    	cin>>A[i];
    	if(A[i]>10)
    	{
    		ans+=(A[i]-10);
		}
	}
	cout<<ans;
	return 0;
}


#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
    #include <atcoder/all>
    using namespace atcoder;
#endif

using namespace std;
using Graph = vector<vector<int>>;
using vst= vector<string>;
using vin= vector<int>;
using ll=long long;
using ull=unsigned long long;
using vll= vector<ll>;
using P=pair<int ,int>;
using pqi=priority_queue<int, vector<int>, greater<int>>;
using pqp=priority_queue<P, vector<P>, greater<P>>;

//const long double pi=acos(-1);
#define ft first
#define sd second
#define fn front
#define pb push_back
#define eb emplace_back
#define it insert
#define vvi vector<vector<int>>
#define si(v) int((v).size())
#define pq priority_queue
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rell(i,n) for (ll i=0; i< (ll)(n); i++)
#define sot(x) sort(x.begin(), x.end())
#define rese(x) reverse(x.begin(), x.end())
#define gsot(x) sort(x.begin(), x.end(), greater<ll>());
#define vnn(x,y,s,name) vector<vector<int>> name(x, vector<int>(y,s))
#define mse(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(),(x).end()
#define mii(x,y,z) min(x,min(y,z))
#define maa(x,y,z) max(x,max(y,z))
#define cps CLOCKS_PER_SEC
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define cset(x) cout<<fixed<<setprecision(x)

//const int INF=1001001001;
//const ll INF=1e18;
//998244353  1000000007

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int a,b,c;

    cin>>a>>b>>c;
    if(a*a+b*b<c*c) yes;
    else no;
}

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

int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if (A*A + B*B < C*C) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


#include <iostream>
using namespace std;

int main() {
  int x, y;
  cin >> x >> y;
  cout << ((y % x == 0)?"Yes":"No");
  return 0;
}

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

using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> pair;

#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

int main(void){
  int m,h;
  cin >> m >> h;

  if(h%m==0) puts("Yes");
  else puts("No");
}


#pragma GCC optimize("Ofast")

#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007LL

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

struct UF {
	vector<int> par; // 親のインデックスを記憶する配列
	vector<int> sz; // サイズを記憶する。
	vector<map<int, int> > value;
	// 初期化
	UF(int n):par(n),sz(n),value(n){
		for(int i = 0; i < n; i++){
			par[i] = i;sz[i] = 1;
		}
	}
	// 親を求める
	int find(int x) {
		if (par[x] == x) return x;
		else return par[x] = find(par[x]);
	}
	// xとyの属する集合を併合
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y) return;
		if(sz[x] > sz[y])swap(x, y);
		par[x] = y;
		sz[y] += sz[x];
		// マージデクはここでやる(x -> y)
		for(pair<int, int> const &ele: value[x]) {
			value[y][ele.FI] += ele.SE;
		}
	}
	// xとyが同じ集合ならtrue
	bool same(int x, int y) { return find(x) == find(y); }
	// 素の集合のサイズを求める
	int size(int n){return sz[find(n)];}
};

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

	int N, Q;cin >> N >> Q;
	UF uf(N);

	REP(i, N) {
		int c;cin >> c;c--;
		uf.value[i][c]++;
	}

	REP(i, Q) {
		int type, a, b;cin >> type >> a >> b;
		a--;b--;
		if(type == 1) {
			a = uf.find(a);
			b = uf.find(b);
			if(uf.same(a, b))continue;
			uf.unite(a, b);
		}
		else {
			a = uf.find(a);
			cout << uf.value[a][b] << endl;
		}
	}

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vl>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for(ll i = (ll)(m); i < (ll)(n); i++)
#define rep_inv(i, n, m) for(ll i = (ll)(n); i > (ll)(m); i--)

bool compare2nd(vl a, vl b){
  if(a[1] <= b[1])
    return true;
  else
    return false;
}

bool pair_same(vl a, vl b){
  if(((a[1] == b[1]) && (a[2] == b[2])) || ((a[1] == b[2]) && (a[2] == b[1])))
    return true;
  else
    return false;
}

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

  vvl xy(N, vl(3));
  rep(i, N){
    cin >> xy[i][0] >> xy[i][1];
    xy[i][2] = i;
  }

  vvl xy1(N, vl(3));
  vvl xy2(N, vl(3));

  stable_sort(xy.begin(), xy.end());
  copy(xy.begin(), xy.end(), xy1.begin());

  stable_sort(xy.begin(), xy.end(), compare2nd);
  copy(xy.begin(), xy.end(), xy2.begin());

  /*
  cout << "x : \n";
  rep(i, N){
    cout << xy1[i][0] << ' ' << xy1[i][1] << ' ' << xy1[i][2] << "\n";
  }

  cout << "y : \n";
  rep(i, N){
    cout << xy2[i][0] << ' ' << xy2[i][1] << ' ' << xy2[i][2] << "\n";
  }
  */

  vvl cands;

  // x の max - min, max2nd - min, max - min2nd をインデックスと一緒に格納
  cands.push_back({xy1[N - 1][0] - xy1[0][0], xy1[N - 1][2], xy1[0][2]});
  cands.push_back({xy1[N - 1][0] - xy1[1][0], xy1[N - 1][2], xy1[1][2]});
  cands.push_back({xy1[N - 2][0] - xy1[0][0], xy1[0][2], xy1[N - 2][2]});

  // y の max - min, max2nd - min, max - min2nd をインデックスと一緒に格納
  cands.push_back({xy2[N - 1][1] - xy2[0][1], xy2[N - 1][2], xy2[0][2]});
  cands.push_back({xy2[N - 1][1] - xy2[1][1], xy2[N - 1][2], xy2[1][2]});
  cands.push_back({xy2[N - 2][1] - xy2[0][1], xy2[0][2], xy2[N - 2][2]});

  stable_sort(cands.begin(), cands.end(), greater<vl>());

  /*
  cout << "\n";
  cout << "cands\n";
  rep(i, cands.size()){
    cout << cands[i][0] << ' ' << cands[i][1] << ' ' << cands[i][2] << "\n";
  }
  */

  if(!pair_same(cands[0], cands[1]))
    cout << cands[1][0] << "\n";
  else
    cout << cands[2][0] << "\n";

  return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define REP(NAME, NUM) for (int NAME = 0; NAME < int(NUM); ++NAME)
#define BREP(NAME, NUM) for (int NAME = (NUM)-1; NAME >= 0; --NAME)
#define ALL(NAME) (NAME).begin(), (NAME).end()

#define cMOD 1000000007ULL
#define cINF ((1ll<<62)-1)
#define cINFINT ((1<<30)-1)

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

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

    ll n;
    cin>>n;
    priority_queue<pair<ll, string>> q;
    REP(i,n)
    {
        string s;
        ll t;
        cin>>s>>t;
        q.push({t,s});
    }
    q.pop();
    cout << q.top().second << endl;

    // ----------------------------------------------------------------
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n,k;
    long long res=0;
    cin>>n>>k;
    for (int i=1;i<=n;i++)
        for (int j=1;j<=k;j++)
    {
        res+=100*i+j;
    }
    cout<<res;
    return 0;
}


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

int main() {
  int N;
  long K;
  cin >> N;
  cin >> K;

  vector<vector<long> > t(N,vector<long>(N,0));

  for(int i = 0;i < N; ++i) {
      for (int j = 0;j < N; ++j) {
          cin >> t[i][j];
      }
  }

  vector<int> city(N-1,0);
  for (int i=0; i < N-1;++i) city[i] = i+1;

  long long ans = 0;
  do {
      vector<int> cityTmp(N+1,0);
      copy(city.begin(), city.end(), cityTmp.begin()+1);
      cityTmp[0] = 0;
      cityTmp[N] = 0;

      long long tmp = 0;
      for (int i = 0;i < N; ++i) {
          tmp += t[cityTmp[i]][cityTmp[i+1]];
      }

      if (tmp == K) ans++;
  } while(next_permutation(city.begin(), city.end()));

  cout << ans << endl;
  return 0;
}

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

int main(){
 int n,x; cin>>n>>x;
 int al=0;
 for(int i=1;i<n+1;++i){
  int v,p; cin>>v>>p;
  al+=v*p;
  if(al>100*x){
   cout<<i<<endl;
   return 0;
  }
 }
 cout<<-1<<endl;
 return 0;
}


#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)for(int i=0;i<(n);i++)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define int ll
#define each(i, a) for (auto &&i : (a))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using vvs = vector<vs>;
using vd = vector<ld>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using P = pair<int, int>;
using vp = vector<P>;
using int128 = __int128_t;//cin coutはできない
template <class T>
using greater_queue = priority_queue<T, vector<T>, greater<T>>;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a / gcd(a, b) * b;};
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

template <class T>
void CVEC(const T &v) {
	int c = v.size() - 1;
	for (int i = 0; i < c; i++) cout << v[i] << ' ';
	if (c > -1) cout << v[c];
	cout << '\n';
}

#pragma endregion header

signed main(){
    vector<int> a(3);
	rep(i,3)cin >> a[i];
	sort(ALL(a));
	if((a[2] - a[1]) == (a[1] - a[0])) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

int main(){
  int a, b, c; cin >> a >> b >> c;
  if((a+b==2*c)||(a+c == 2*b)||(b+c==2*a)){
    cout << "Yes" << endl;
  }
  else cout << "No"<< endl;
}


#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define PB push_back
#define fi first
#define se second
#define MP make_pair
const int P = 998244353;
const int V = 5100;
const int N = 5000;
const int M = 15;
int C[V][V];
int dp[M + 1][V];
int pt[30], n, m;
int main() {
    pt[0] = 1;
    for (int i = 1; i < 20; ++i) pt[i] = pt[i - 1] * 2;
    for (int i = 0; i <= N; ++i) {
        C[i][0] = C[i][i] = 1;
        for (int j = 1; j < i; ++j) {
            C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % P;
        }
    }
    while (~scanf("%d%d", &n, &m)) {
        memset(dp, 0, sizeof(dp));
        dp[M][m] = 1;
        for (int i = M; i > 0; --i) {
            for (int j = 0; j <= m; ++j) {
                if (dp[i][j] == 0) continue;
                for (int k = 0; k * pt[i - 1] <= j && k <= n; k += 2) {
                    dp[i - 1][j - k * pt[i - 1]] += (LL) dp[i][j] * C[n][k] % P;
                    dp[i - 1][j - k * pt[i - 1]] %= P;
                }
            }
        }
        printf("%d\n", dp[0][0]);
    }
    return 0;
}

/*
5 20
10 5
3141 2718
*/

#include<iostream>

using namespace std;

typedef long long ll;

const int MOD = 998244353;
ll dp[5010];
ll f[5010];
int n , m;

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

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

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

int main(){
    cin >> n >> m;
    if(m & 1){
        puts("0");
        return 0;
    }
    init();
    dp[0] = 1;
    for(int i = 2 ; i <= m ; i += 2){
        for(int j = 0 ; 2 * j <= i ; j ++){
            dp[i] = (dp[i] + f[2 * j] * dp[(i - 2 * j) / 2] % MOD) % MOD;
        }
    }
    cout << dp[m] << endl;
    return 0;
}


#include<bits/stdc++.h>
#include<tuple>
typedef long long ll;
#define INF 99999999999999
#define mod 1000000007
#define eps 1e-9
using namespace std;
typedef pair<ll,ll>du;
ll n,x,c,y,l=0,r=0;
long double ans;
int main(){
    ios::sync_with_stdio(0);
    cin>>n;
    for(ll i=1;i<n;i++)
        ans+=(long double)n/(n-i);
    cout<<setprecision(9)<<fixed<<ans<<endl;
}

#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

int main()
{
	LL N;
	in >> N;

	LL ans = N;
	std::map<LL, LL>flag;
	for (LL a = 2; a * a <= N; ++a)
	{
		if (flag[a] == 1) continue;
		LL m = a * a;
		do
		{
			--ans;
			flag[m] = 1;
			m *= a;
		} while (m <= N);
	}

	out << ans << std::endl;
}


#pragma GCC optimize ("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i=(a); i<(b); i++)
#define FORD(i, a, b) for (int i=(a); i>(b); i--)
#define PPC(x) __builtin_popcount(x)
#define MSB(x) (63 - __builtin_clzll(x))
#define SZ(x) ((int)(x).size())
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define ithBit(m, i) ((m) >> (i) & 1)
#define ft first
#define sd second
#define kw(a) ((a) * (a))
#ifdef DEBUG
#include "debug.h"
#else
#define dbg(...) 0
#endif
using namespace std;

const int maxN = 1 << 18, mod = 998244353, maxK = 302;

template <typename T1, typename T2> inline void addMod(T1& a, T2 b) { a = (a + b) % mod; }
template <typename T1, typename T2> inline void multMod(T1& a, T2 b) { a = a * b % mod; }
template <typename T1, typename T2> inline void subMod(T1& a, T2 b) { a = (a + mod - b%mod) % mod; }

long long qpow(long long a, long long b)
{
	long long ret = 1ll;
	for (; b != 0; b /= 2)
	{
		if (b & 1)	multMod(ret, a);
		multMod(a, a);
	}
	return ret;
}

long long S[maxK], cf[maxK][maxK];
int T[maxN];

void solve()
{
	int n, k;
	scanf ("%d%d", &n, &k);

	cf[0][0] = 1ll;
	FOR(i, 1, k+1)
	{
		cf[i][0] = 1ll;
		FOR(j, 1, i+1)
			cf[i][j] = (cf[i-1][j-1] + cf[i-1][j]) % mod;
	}

	FOR(i, 1, n+1)
	{
		scanf ("%d", T+i);
		long long p = 1ll;
		FOR(j, 0, k+1)
		{
			addMod(S[j], p);
			multMod(p, T[i]);
		}
	}

	long long pow2 = 2;

	FOR(x, 1, k+1)
	{
		long long res = 0;
		FOR(i, 0, x+1)
		{
			long long temp = cf[x][i];
			multMod(temp, S[i]);
			multMod(temp, S[x-i]);
			addMod(res, temp);
		}
		subMod(res, S[x] * pow2);
		multMod(res, qpow(2, mod-2));
		printf("%lld\n", res);
		multMod(pow2, 2);
	}
}

int main()
{
	int t = 1;
	//scanf ("%d", &t);
	FOR(tid, 1, t+1)
	{
		//printf("Case #%d: ", tid);
		solve();
	}
	return 0;
}


#include<bits/stdc++.h>
#define re register
using namespace std;
inline int read(){
	re int t=0;re char v=getchar();
	while(v<'0')v=getchar();
	while(v>='0')t=(t<<3)+(t<<1)+v-48,v=getchar();
	return t;
}
const int M=998244353;
inline void add(re int &x,re int y){
	(x+=y)>=M?x-=M:x;
}
int n,m,ans,a,b,c,d;
int main(){
	a=read(),b=read(),c=read(),d=read();
	if(a+b==c+d||a+c==b+d||a+d==b+c||a==b+c+d||b==a+c+d||c==a+b+d||d==a+b+c)puts("Yes");
	else puts("No");
}

/*
* @author:  codancer
* @createTime:  2021-01-30, 20:01:13
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const ll mod = 1e9+7;
#define pb push_back
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define fep(i,a,b) for(int i=(a);i>=(b);i--)
#define deb(x) cerr<<#x<<" = "<<(x)<<"\n"
typedef vector<int> VI;
typedef vector<ll> VII;
typedef pair<int,int> pii;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll Rand(ll B) {
	return (ull)rng() % B;
}
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(c==0){
		if(a<=b){
			cout<<"Aoki"<<endl;
		}else{
			cout<<"Takahashi"<<endl;
		}
	}else{
		if(a>=b){
			cout<<"Takahashi"<<endl;
		}else{
			cout<<"Aoki"<<endl;
		}
	}
	return 0;
}


#include <iostream>
using namespace std;

void sol(int m, int h){
    if(h%m==0)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}

int main() {
	int m,h;
	cin>>m>>h;
	sol(m, h);
	return 0;
}

#include<bits/stdc++.h>
//#include <atcoder/all>

#define rep(i,n)for(int i=0;(i)<(int)(n);i++)
#define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define fi first
#define se second
#define sz(x) ((int)x.size())

using namespace std;
//using namespace atcoder;
using ld = long double;
using ll = long long;
using P = pair<ll, ll>;

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

const ll ZER = 0;
const ll MOD = 998244353;
const ll INF = 1e18;

int main(){
    int m, h;
    cin >> m >> h;
    cout << (h % m ? "No" : "Yes") << endl;
}


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

typedef long long ll;

#define F0R(i, x, y) for (int i = x; i < y; i++)
#define FOR(i, n) F0R(i, 0, n)
#define F0RD(i, x, y) for (int i = y - 1; i >= x; i--)
#define FORD(i, n) F0RD(i, 0, n)

#define F first
#define S second

int mp(int x, int c) {
    return 1000 * c + x;
}

vector<int> adj[2005];
bool vis[2005];

void dfs(int v) {
    vis[v] = true;
    for (int to : adj[v]) {
        if (!vis[to]) dfs(to);
    }
}

int main() {
#ifdef mikey
    freopen("a.in", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m; cin >> n >> m;
    auto ad = [&] (int a, int b, int c, int d) {
        adj[mp(a, b)].push_back(mp(c, d));
        adj[mp(c, d)].push_back(mp(a, b));
    };
    auto add = [&] (int a, int b, int c, int d) {
        adj[mp(a, b)].push_back(mp(c, d));
    };
    FOR(i, m) add(i, 1, 0, 0);
    FOR(i, m) add(i, 1, n - 1, 0);
    FOR(i, n) add(i, 0, 0, 1);
    FOR(i, n) add(i, 0, m - 1, 1);
    FOR(i, n) {
        string s; cin >> s;
        FOR(j, m) {
            if (s[j] == '#') {
                ad(i, 0, j , 1);
            }
        }
    }
    int rcc = 0;
    FOR(i, n) {
        if (!vis[mp(i, 0)]) {
            dfs(mp(i, 0));
            ++rcc;
        }
    }
    memset(vis, false, sizeof(vis));
    int ccc = 0;
    FOR(i, m) {
        if (!vis[mp(i, 1)]) {
            dfs(mp(i, 1));
            ++ccc;
        }
    }
    cout << min(rcc - 1, ccc - 1) << '\n';
}

#include<bits/stdc++.h>
using namespace std;
int n,m,fa[2005],t1[2005],t2[2005],s1,s2;
char a[1005][1005];
int find(int x){
	if (x==fa[x]) return x;
	else return fa[x]=find(fa[x]);
}
void Union(int x,int y){
	fa[find(x)]=find(y);
}
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n+m;i++) fa[i]=i;
	for (int i=1;i<=n;i++){
		for (int j=1;j<=m;j++){
			a[i][j]=getchar();
			while (a[i][j]!='#'&&a[i][j]!='.') a[i][j]=getchar();
			if (a[i][j]=='#') Union(i,j+n);
		}
	}
	Union(1,n+1);
	Union(1,n+m);
	Union(n,n+1);
	Union(n,n+m);
	for (int i=1;i<=n;i++) t1[find(i)]=1;
	for (int i=n+1;i<=n+m;i++) t2[find(i)]=1;
	for (int i=1;i<=n+m;i++) s1+=t1[i];
	for (int i=1;i<=n+m;i++) s2+=t2[i];
	cout<<min(s1,s2)-1;
}


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

string solve(ll n, ll w, vector<ll> s, vector<ll> t, vector<ll> p) {
    vector<ll> a(2 * pow(10, 5) + 1, 0);

    for(ll i = 0; i < n; i++) {
        a[s[i]] += p[i];
        a[t[i]] -= p[i];
    }
    if(a[0] > w) {
        return "No";
    }
    for(ll i = 1; i < (ll)a.size(); i++) {
        a[i] += a[i - 1];
        if(a[i] > w) {
            return "No";
        }
    }

    return "Yes";
}

int main() {
    ll n, w;
    cin >> n >> w;
    vector<ll> s(n), t(n), p(n);
    for(ll i = 0; i < n; i++) {
        cin >> s[i] >> t[i] >> p[i];
    }
    cout << solve(n, w, s, t, p);
}

#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;

inline bool valid(int x, int n) {
    return 0 <= x && x < n;
}

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

template <typename T>
inline T pop(queue<T>& q) {
    T front = q.front();
    q.pop();
    return front;
}

template <typename T>
inline T gcd(T a, T b) {
    for (; b; a %= b, swap(a, b));
    return a;
}

template <typename T>
tuple<T, T, T> xgcd(T a, T b) {
    if (b == 0) return {1, 0, a};
    T x, y, g;
    tie(x, y, g) = xgcd(b, a%b);
    return {y, x-(a/b)*y, g};
}

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

    ll N, W; cin >> N >> W;
    vvi query(N*2);
    for (int i = 0; i < N; i++) {
        int S, T, P; cin >> S >> T >> P;
        query[i*2] = vi{S, P};
        query[i*2+1] = vi{T, -P};
    }
    sort(query.begin(), query.end());

    ll sub = 0;
    for (int i = 0; i < N*2; i++) {
        sub += query[i][1];
        if (sub > W) {
            cout << "No";
            return 0;
        }
    }
    cout << "Yes";
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
 char s,t;

 cin>>s>>t;

 if(s == 'Y')
 {
  if(t == 'a'|| t == 'A')
     cout<<'A';
  else if(t == 'b'|| t == 'B')
     cout<<'B';
  else if(t == 'c'|| t == 'C')
     cout<<'C';
 }
 else if(s == 'N')
 {
   cout<<t;
 }

return 0;
}

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O0")
typedef long long int ll;
typedef long double ld;
const ll mod = 1e9+7;
const ll INF = 1e18;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define Rep(i,a,n) for (ll i = (a); i < (n); ++i)
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)
using Graph = vector<vector<ll>>;
using V = vector<ll>;
using P = pair<ll,ll>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  chrono::system_clock::time_point start,end;
  start = chrono::system_clock::now();

  char s,t;
  cin >> s >> t;
  if (s == 'Y') cout << char(toupper(t)) << '\n';
  else cout << t << '\n';

  end = chrono::system_clock::now();
  auto elapsed = chrono::duration_cast< chrono::milliseconds >(end - start).count();
  cerr << elapsed << "ms" << '\n';
}


#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i:x){cout << i << " ";} cout << endl;}
#define isin(x,l,r) ((l)<=(x) && (x)<(r))
using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
template<typename T>bool chmin(T&x,const T&y) {if(x>y){x=y;return true;} else return false;}
template<typename T>bool chmax(T&x,const T&y) {if(x<y){x=y;return true;} else return false;}

int main() {
    int N;
    cin >> N;
    vector<pii> A;
    int ans = 0;
    rep(i, N) {
        int a;
        cin >> a;
        int left = i;
        while (sz(A) && A.back().first >= a) {
            chmax(ans, (i - 1 - A.back().second + 1) * A.back().first);
            chmax(ans, (i - A.back().second + 1) * a);
            chmin(left, A.back().second);
            A.pop_back();
        }
        A.emplace_back(a, left);
    }
    for (auto [a, i] : A) {
        chmax(ans, a * (N-i));
    }
    cout << ans << '\n';
    return 0;
}

#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
#define srt(v)  if(!v.empty())sort(v.begin(),v.end())
#define rev(v)  if(!v.empty())reverse(v.begin(),v.end())
#define PI 3.141592653589793238
#define pqr priority_queue<ll,vector<ll>,greater<ll>()>
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
     string s;
     cin>>s;
     ll ans=0;

     ll n=s.size();

     ll a[n+1];

     for(ll i=0;i<n;i++){
         a[i+1]=(ll)(s[i]-'a');
     }

    ll cnt[26]={0};

    for(ll i=n;i>0;i--){
        if(i>n-2){
            cnt[a[i]]++;
            continue;
        }

        if(a[i]==a[i+1]){
            cnt[a[i+1]]--;
            ans+=n-i;
            ans--;
            ans-=cnt[a[i]];
            for(ll j=0;j<26;j++)
            cnt[j]=0;

            cnt[a[i]]=n-i+1;
        }
        else
        {
            cnt[a[i]]++;
        }
    }

    cout<<ans<<endl;
}
int main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);

//Start from Here.

  ll t;
  t=1;
// cin>>t;
  while(t--)
  solve();

//Good Bye!
    return 0;
}


/*
 * author : rits1272
 */

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

#define int long long
#define print(x) cerr << "[" << #x << ": " << x << "]";
#define println(x) cerr << "[" << #x << ": " << x << "]\n";
#define show(v) for(int i = 0; i < (int)v.size(); i++) cout << v[i] << (i == (int)v.size()-1 ? "\n" : " ");
#define deb(v) for(int i = 0; i < (int)v.size(); i++) {print(i) println(v[i])}
#define pb push_back
#define INF 1e18 + 5
const int MOD = 1e9 + 7;

const int N = 1e5 + 5;
vector<vector<int>> adj[N];
vector<bool> vis(N);
int n, m, x, y;

int wait(int t, int k){
	if(t == 0 || t%k == 0) return 0;
	return k - t%k;
}

int32_t main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin >> n >> m >> x >> y;
	--x, --y;
	vis.resize(n);
	for(int i = 0; i < m; i++){
		int a, b, t, k; cin >> a >> b >> t >> k;
		--a, --b;
		adj[a].pb({b, t, k}); // city, time, departure
		adj[b].pb({a, t, k});
	}
	priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> pq;
	pq.push({0ll, x}); // time city
	vector<int> mn(n, INF);
	mn[x] = 0;
	while(pq.size()){
		int cur_city = pq.top().second, t = pq.top().first;
		//print(cur_city) println(t)
		pq.pop();
		for(auto x: adj[cur_city]){
			int nxt_city = x[0], T = x[1], k = x[2];
			if(t + T + wait(t, k) < mn[nxt_city]){
				mn[nxt_city] = t + T + wait(t, k);
				pq.push({mn[nxt_city], nxt_city});
			}
		}
	}
	cout << (mn[y] == INF ? -1 : mn[y]) << "\n";
	return 0;
}

/*
 * Only write code when you are sure of the approach.
 * Do optimized thinking (Think which technique/observation can be used).
 * Do post analysis after the contest.
 * Upsolve the problems.
 * Learn a technique and solve some problems if its new to you.
 * DON'T GET STUCK ON ONE APPROACH
 */

#include <bits/stdc++.h>

template <class T>
T read() {
  T num = 0;
  T f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    num = num * 10 + ch - '0';
    ch = getchar();
  }
  return num * f;
}

constexpr int N = 1e5 + 7;
std::vector<std::tuple<int, int, int>> edge[N];
int n, m;
using ll = long long;
ll dist[N];
bool done[N];

void dijkstra(int s, int t) {
  memset(dist, 0x3f, sizeof(dist));
  std::priority_queue<std::pair<ll, int>, std::vector<std::pair<ll, int>>,
                      std::greater<std::pair<ll, int>>>
      que;
  que.push(std::make_pair(dist[s] = 0, s));
  while (!que.empty()) {
    auto p = que.top();
    que.pop();
    int u = p.second;
    if (done[u]) continue;
    done[u] = 1;
    for (auto [v, cost, k] : edge[u]) {
      ll new_dist = (dist[u] + k - 1) / k * k + cost;
      if (new_dist < dist[v]) {
        que.push(std::make_pair(dist[v] = new_dist, v));
      }
    }
  }
  printf("%lld\n", dist[t] == 0x3f3f3f3f3f3f3f3f ? -1 : dist[t]);
}

int main() {
  n = read<int>(), m = read<int>();
  int x = read<int>(), y = read<int>();
  for (int i = 0; i < m; i++) {
    int A = read<int>(), B = read<int>(), T = read<int>(), K = read<int>();
    edge[A].emplace_back(std::make_tuple(B, T, K));
    edge[B].emplace_back(std::make_tuple(A, T, K));
  }
  dijkstra(x, y);
  return 0;
}


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

int main() {
	int T,ans,m;
	string S;
	string S0;

	cin >> T ;

	S0="atcoder";

   	rep(k,T) {
		cin >> S;
		ans=-1;
		rep(i,S.size()){
			if ('a'!=S.at(i)){
				ans=i;
				break;
			}
		}
		if (ans<=0){
			cout << ans << endl;
			continue;
		}
		if (ans>1){
			if ('t'<S.at(ans))ans--;
			cout << ans << endl;
			continue;
		}
		if ('t'<S.at(1)){
			cout << 0 << endl;
			continue;
		}
		if ('t'>S.at(1)){
			cout << 1 << endl;
			continue;
		}
		ans=10;
		m=min(S.size(),S0.size());
		rep(i,m){
			if (S.at(i)!=S0.at(i)){
				if(S.at(i)>S0.at(i)) ans=0;
				else ans=1;
			}
		}
		if (ans<2){
			cout << ans << endl;
			continue;
		}
		if (S.size()>S0.size()) ans=0;
		else ans=1;
		cout << ans << endl;
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define T     \
    int t;    \
    cin >> t; \
    while (t--)
#define fast                          \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL)
#define PI 3.141592653589793238462643383
#define pb push_back
#define all(s) s.begin(), s.end()

bool check(string &t) {
    int n = t.length();
    return n >= 3 and (t[n - 1] == 'x' and t[n - 2] == 'o' and t[n - 3] == 'f');
}

int main() {
    fast;
    ll n;
    string s, t = "";
    cin >> n >> s;

    ll cnt = 0;

    for (int i = 0; i < n; i++) {
        t += s[i];
        if (check(t)) {
            t.pop_back();
            t.pop_back();
            t.pop_back();
            cnt++;
        }
    }

    cout << n - (3 * cnt) << endl;
}


using namespace std;
#include <bits/stdc++.h>
#define N 105
#define INF 1000000000
int n;
char str[N];
int a[N],b[N],c[N];
int main(){
	scanf("%d%s",&n,str+1);
	for (int i=0;i<=n;++i)
		scanf("%d",&a[i]);
	int k=INF;
	for (int i=1;i<=n;++i)
		if (str[i]=='<')
			k=min(k,a[i]-a[i-1]);
		else
			k=min(k,a[i-1]-a[i]);
//	for (int i=0;i<=n;++i){
//		b[i]=a[i]/k;
//		c[i]=a[i]-b[i]*(k-1);
//	}
	printf("%d\n",k);
	for (int i=1;i<=k;++i,printf("\n"))
		for (int j=0;j<=n;++j)
			printf("%d ",a[j]/k+(i<=a[j]%k?1:0));
//	for (int i=1;i<=k-1;++i,printf("\n"))
//		for (int j=0;j<=n;++j)
//			printf("%d ",b[j]);
//	for (int j=0;j<=n;++j)
//		printf("%d ",c[j]);
	return 0;
}

	//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;
	}


//
// Created by bytedance on 2020/4/10.
//

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

using namespace std;
const int maxn = 1e5 + 5;

int a[maxn], b[maxn];
vector<int> even, odd;

int main() {
    int n;
    scanf("%d", &n);
    long long sum = 0;
    for (int i = 0; i < n; i++) {
        scanf("%d", a + i);
        sum += a[i];
    }
    for (int i = 0; i < n; i++) {
        scanf("%d", b + i);
    }
    even.clear();
    odd.clear();
    for (int i = 0; i < n; i++) {
        if (i & 1) {
            odd.push_back(b[i] - a[i]);
        } else {
            even.push_back(b[i] - a[i]);
        }
    }
    sort(odd.begin(), odd.end());
    sort(even.begin(), even.end());
    for (int i = 0; i < odd.size(); i++) {
        if (odd[i] + even[i] > 0) {
            sum += odd[i] + even[i];
        }
    }
    printf("%lld\n", sum);

    return 0;
}

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

// Acknowledgement: Special thanks to kyomukyomupurin, who developed this
// template.
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

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

#ifdef LOCAL
#define debug(...) \
  std::cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}
using namespace std;
using int64 = long long;

int64 cnt_diff(string s, char c) {
  int64 res = 0;
  for (int i = 0; i < (int)s.size(); i++) {
    if (s[i] != c) res++;
  }
  return res;
}

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

  int N = s.size();
  string tmp = "";
  tmp += s.back();
  int atoha_onazi = N;
  char atoha_onazi_c = '*';
  int idx = N - 2;
  bool consective = false;
  int64 cnt = 0;

  while (idx >= 0) {
    if (s[idx] == atoha_onazi_c && consective == true) {
      atoha_onazi--;
      idx--;
      continue;
    }
    if (s[idx] == s[idx + 1]) {
      char tmp_c = s[idx];
      cnt += cnt_diff(tmp, tmp_c);
      debug(cnt_diff(tmp, tmp_c));
      if (tmp_c != atoha_onazi_c) cnt += N - atoha_onazi;
      atoha_onazi = idx;
      atoha_onazi_c = tmp_c;
      tmp = "";
      consective = true;
      debug(atoha_onazi_c, atoha_onazi, cnt);
    } else {
      tmp += s[idx];
      consective = false;
    }
    debug(tmp);
    idx--;
  }
  cout << cnt << '\n';
  return 0;
}


/*

    author: l_a_k_s_h_g

*/

#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define f(a,b) for(ll i=a;i<b;i++)
#define mod 1000000007
#define inf 1e9 + 1
#define all(x) (x).begin(),(x).end()
#define prDouble(x,dec) cout << fixed << setprecision(dec) << x
#define triplet pair<ll,pair<ll,ll> >
#define prCase(t) cout << "Case #" << t <<": "
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"

using namespace std;

int main(){
    fast

ll n;
ll x;
cin>>n>>x;
x *= 100;
ll k=0;
f(0,n){

    ll g,h;
    cin>>g>>h;

    k += g*h;

    if(k > x){
        cout<<i+1<<endl;
        break;
    }

}

if(k <= x){
    cout<<-1<<endl;
}

    return 0;

}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define FOR(i,n)  for(ll i=0;i<n;i++)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vld vector<ld>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define vvld vector<vector<ld>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)

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

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
ll pwr(ll x, ll y)
{
    ll res = 1;
    x = x ;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) ;
        y = y >> 1;
        x = (x * x) ;
    }
    return res;
}
ll modInverse(ll n, ll p)
{
    return power(n, p - 2, p);
}
ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);

}
ll fact(ll n)
{
    if (n <= 1)
        return 1;
    return n*fact(n-1);
}
ll nPr(ll n, ll r)
{
    return fact(n)/fact(n-r);
}
ll ceil(ll n, ll k)
{
    if(n%k==0)
        return n/k;
    else
        return n/k + 1;
}
int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    // cin>>t;
    t = 1;
    while(t-->0)
    {
        ll n, x, sum=0, i=0;
        cin>>n>>x;
        for(i=0; i<n; i++)
        {
            ll v,p;
            cin>>v>>p;
            sum+=(v*p);
            if(sum>x*100)
            {
                break;
            }
        }
        if(sum>x*100)
            d1(i+1);
        else
            d1(-1);
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const double PI = 4*atan(1);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const string YES = "Possible";
const string NO = "Impossible";
#define pb push_back
#define mp make_pair
#define eb emplace_back

const int MAX_N = 2e6+10;
ll a, b, c, d;

void solve()
{
	if(a == c && b == d){
		cout<<0<<'\n';
	}else if((abs(a-c)+abs(b-d)<=3)||(a+b==c+d)||(a-b==c-d)){
		cout<<1<<'\n';
	}else if((a+b)%2==(c+d)%2){
		cout<<2<<'\n';
	}else{
		for(int dx=-3;dx<=3;++dx)for(int dy=-3;dy<=3;++dy){
			if(abs(dx)+abs(dy)>3) continue;
			int x=a+dx, y=b+dy;
			if(abs(x-c)+abs(y-d)<=3||(x+y==c+d)||(x-y==c-d)){
				cout<<2<<'\n';
				return;
			}
		}
		cout<<3<<'\n';
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> a >> b >> c >> d;
	solve();
	return 0;
}

#include<bits/stdc++.h>
#define inf 0x3f3f3f3f3f3f3f3fll
typedef unsigned long long ull;
typedef long long ll;
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define nep(i,r,l) for(int i=r;i>=l;i--)
void sc(int &x){scanf("%d",&x);}
void sc(int &x,int &y){scanf("%d%d",&x,&y);}
void sc(int &x,int &y,int &z){scanf("%d%d%d",&x,&y,&z);}
void sc(ll &x){scanf("%lld",&x);}
void sc(ll &x,ll &y){scanf("%lld%lld",&x,&y);}
void sc(ll &x,ll &y,ll &z){scanf("%lld%lld%lld",&x,&y,&z);}
void sc(char *x){scanf("%s",x);}
void sc(char *x,char *y){scanf("%s%s",x,y);}
void sc(char *x,char *y,char *z){scanf("%s%s%s",x,y,z);}
void out(int x){printf("%d\n",x);}
void out(ll x){printf("%lld\n",x);}
void out(int x,int y){printf("%d %d\n",x,y);}
void out(ll x,ll y){printf("%lld %lld\n",x,y);}
void out(int x,int y,int z){printf("%d %d %d\n",x,y,z);}
void out(ll x,ll y,ll z){printf("%lld %lld %lld\n",x,y,z);}
using namespace std;
const int N=1005;
int n,m;
vector<int>e[26][N];
bool vis[N][N],updated[N][N];
int dp[N][N];
struct node
{
    int u,v,w;
    node(int u=0,int v=0,int w=0):u(u),v(v),w(w){}
    bool operator<(const node&o)const
    {
        return w>o.w;
    }
};
priority_queue<node>q;
int main()
{
    memset(dp,0x3f3f3f3f,sizeof(dp));
    //freopen("1.in","r",stdin);freopen("1.out","w",stdout);
    sc(n,m);
    rep(i,1,m)
    {
        int u,v;char c;
        scanf("%d %d %c",&u,&v,&c);
        e[c-'a'][u].push_back(v);
        e[c-'a'][v].push_back(u);
        vis[u][v]=vis[v][u]=true;
    }
    dp[1][n]=0;
    q.push(node(1,n,0));
    while(!q.empty())
    {
        int u=q.top().u,v=q.top().v;q.pop();
        if(updated[u][v]) continue;
        updated[u][v]=true;
        rep(i,0,25)
        {
            for(int x:e[i][u])
                for(int y:e[i][v])
            if(dp[x][y]>dp[u][v]+2)
            {
                dp[x][y]=dp[u][v]+2;
                q.push(node(x,y,dp[x][y]));
            }
        }
    }
    int ans=998244353;
    rep(i,1,n) ans=min(ans,dp[i][i]);
    rep(i,1,n)
        rep(j,1,n)
        if(vis[i][j]) ans=min(ans,dp[i][j]+1);
    if(ans==998244353) ans=-1;
    out(ans);
}


#include<bits/stdc++.h>
#define ll          long long
#define ld          long double
#define mod         998244353
#define INF         998244353
#define ull         unsigned long long
#define pb          push_back
#define	endl		'\n'
#define pi          acos(-1)
#define pii         pair<ll int,ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define SIZE(X)     ((int)((X).size()))
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define fo(i,s,n)  for(int i=s;i<n;i++)
#define FORE(i,s,n) for(int i=s;i<=n;i++)
#define rep(i,n) for(int i=0;i<(n);++i)
#define repf(i,a,b) for(int i=(a);i<=(b);++i)
#define ERASE(x)    x.erase(unique(x.begin(),x.end()),x.end()) //removes repeated element;
#define Fast        ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);

using namespace std;
const int N = 2*100010;
vector <ll> is_prime(N+1 , true);
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b){return (a.first > b.first);}
bool sortbysecdesc(const pair<int,int> &a,const pair<int,int> &b){return a.second>b.second;}
bool sortbysec(const pair<int,int> &a,const pair<int,int> &b) {return (a.second < b.second);}
ll powerm(ll a, ll k) { if (!k) {return 1;}ll b = powerm(a, k / 2);b = b * b % INF;if (k % 2) {return a * b % INF;} else {return b;}}
ll int power(ll int a , ll int b) { if(b == 1) return a; if(b == 0) return 1; ll int m1 = power(a,b/2); if(b%2) return m1*m1*a; return m1*m1; }
void seive_of_eras(ll n) { is_prime[0] = 0; is_prime[1] = 0; for(ll i=2;i*i<=n;i++) { if(is_prime[i]) { for(ll j=i*i;j<=n;j+=i) { is_prime[j] = false; } } } }
bool isprime (ll a) { if(a<=1) return false; if(a==2||a==3) return true; if(a%2==0||a%3==0) return false; for(ll i=5;i*i<=a;i=i+6) { if(a%i==0||a%(i+2)==0) return false; } return true;}

vector <ll> adj[N];
ll visited[N];
ll a[N] , b[N];
ll d = 0;

void dfs(ll u)
{
    //ll d = 0;
    for(ll i=0;i<adj[u].size();i++)
    {

        if(visited[adj[u][i]]==0)
        {
            d += b[adj[u][i]]-a[adj[u][i]];
            //cout<<" "<<adj[u][i]<<" "<<b[adj[u][i]]<<" "<<a[adj[u][i]]<<" "<<d<<endl;
            visited[adj[u][i]] = 1;
            dfs(adj[u][i]);
        }
    }
}

void codeit()
{
    ll n , m; cin>>n>>m;
    for(ll i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    for(ll i=1;i<=n;i++)
    {
        cin>>b[i];

    }
    for(ll i=0;i<m;i++)
    {
        ll c , d; cin>>c>>d;
        adj[c].pb(d);
        adj[d].pb(c);
    }
    for(ll i=1;i<=n;i++)
    {
        if(visited[i]==0)
        {
            visited[i] = 1;
            d = b[i]-a[i];
            dfs(i);
            if(d==0)
            {

            }
            else
            {
                cout<<"No"<<endl;
                //cout<<i<<" "<<d<<endl;
                return;
            }
        }
    }
    cout<<"Yes"<<endl;
    return;
}

int main()
{
    //Fast
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ll tt; tt = 1;
    //cin>>tt;
    for(ll i=0;i<tt;i++)
        codeit();
}

// dont stop until you reach there
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define rep(i,j,k) for(int i=j;i<k;i+=1)
#define rrep(i,j,k) for(int i=n-1;i>=0;i-=1)
#define sorti(v) sort(v.begin(),v.end())
#define sortd(v) sort(v.begin(),v.end(),greater<int>())
#define mm map<int,int>
#define vv vector<int>
#define tmm map<int,map<int,int>>
#define trav(a, x) for(auto& a : x)
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define all(v) v.begin(),v.end()
#define pb push_back
#define alot(x,y) memset(x,y,sizeof(x))
#define pii pair<int,int>
#define code ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int MOD=1e9+7;
const double pi=acos(-1.0);
//memset(array_name,value_to_be_intialized,sizeof(array_name));
// __builtin_popcount(n) count no of set bit in number n
//next_permutation(s.begin(),s.end());
/*int change(string g){
     int p=10;
     int ans=g[g.length()-1]-'0';
     for(int i=g.length()-2;i>=0;i--){
         int j=g[i]-'0';
         ans=p*ans+j;
     }
     return ans;
}
int binpow(int a,int b){
    int res=1;
    while(b>0){
        if(b&1)res*=a;
        a*=a;
        b>>=1;

    }
    return res;
}
// lower_bound==> if the element is present it return its first occurence else 1st element which is greater than
// upper_bound==> it will always return iterator to element which is greater than searched element
*/
int32_t main ()
{
     code;
    int tt;
    //cin>>tt;
    tt=1;
    while(tt--){
        int n,m;
        cin>>n>>m;
        vv a;
        vv b;
        rep(i,0,n){
            int p;
            cin>>p;
            a.pb(p);

        }
        rep(i,0,n){
            int p;
            cin>>p;
            b.pb(p);
        }
        int sum1=0,sum2=0;
        set<int>st;
        rep(i,0,m){
            int p,q;
            cin>>p>>q;
            p--;
            q--;
            st.insert(p);
            st.insert(q);
        }
        trav(x,st){
            sum1+=a[x];
            sum2+=b[x];
        }
        if(m==0){
            if(a==b)cout<<"Yes\n";
            else cout<<"No\n";
        }
        else if(sum1==sum2)cout<<"Yes\n";
        else cout<<"No\n";

    }
    return 0;

}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#define m_p make_pair
#define sz(x) (int)x.size()
#define line cerr<<"--------------------\n";
#define see(x) cerr<<x<<" "
#define seeln(x) cerr<<x<<endl
#define out(x) cerr<<#x<<" = "<<x<<" "
#define outln(x) cerr<<#x<<" = "<<x<<endl
#define outarr(x,l,r) cerr<<#x"["<<l<<"-"<<r<<"] = "; for (int _i=l;_i<=r;++_i) cerr<<x[_i]<<" ";cerr<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define gc() getchar()
//char buf[1<<23],*p1=buf,*p2=buf;
//#define gc() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
template <class T> void read(T &x)
{
    x=0; char c=gc(); int flag=0;
    while (c<'0'||c>'9') flag|=(c=='-'),c=gc();
    while (c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=gc();
    if (flag) x=-x;
}
template <class T> inline T _max(T a,T b){return a>b ? a : b;}
template <class T> inline T _min(T a,T b){return a<b ? a : b;}
template <class T> inline bool checkmax(T &a,T b){return b>a ? a=b,1 : 0;}
template <class T> inline bool checkmin(T &a,T b){return b<a ? a=b,1 : 0;}
int n,k,mod;
int Add(int x,int y){x+=y; return x>=mod ? x-mod : x;}
int Sub(int x,int y){x-=y; return x<0 ? x+mod : x;}
int Mul(int x,int y){return (ll)x*y%mod;}
void add(int &x,int y){x=Add(x,y);}
void sub(int &x,int y){x=Sub(x,y);}
void mul(int &x,int y){x=Mul(x,y);}
int dp[102][128000];
void init()
{
	read(n); read(k); read(mod);
	dp[0][0]=1;
	for (int i=1;i<=n;++i)
	{
		int tmp=_min(i,50);
		for (int r=0;r<=k;++r)
		{
			for (int j=r*i;j<=tmp*(tmp+1)/2*k;++j)
			{
				add(dp[i][j],dp[i-1][j-r*i]);
			}
		}
	}
}

int calc(int x)
{
	int tmp=_min(x-1,n-x);
	int ans=0;
	for (int i=0;i<=tmp*(tmp+1)/2*k;++i)
	{
		if (i) add(ans,Mul(Mul(dp[x-1][i],dp[n-x][i]),k+1));
		else add(ans,k);
	}
	return ans;
}

void solve()
{
	for (int i=1;i<=n;++i)
	{
		printf("%d\n",calc(i));
	}
}

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

#include<cstdio>
#include<cstring>
#define fo(x,a,b) for(int x=(a),_e=(b);x<=_e;x++)
#define fd(x,a,b) for(int x=(a),_e=(b);x>=_e;x--)
#define inc(a,b) (a=a+b-(a+b>=mo?mo:0))
#define ww printf
#define min(a,b) ((a)<(b)?(a):(b))

const int N=550006;
int f[101][N],top[101],n,ti,mo;
int main(){
	scanf("%d %d %d",&n,&ti,&mo);
	f[0][0]=1;
	fo(i,1,n) {
		memcpy(f[i],f[i-1],sizeof(f[i-1][0])*(top[i-1]+1));
		top[i]=top[i-1];
		fd(k,top[i],0) {
			fo(j,1,ti) inc(f[i][k+j*i],f[i][k]);
		}top[i]+=ti*i;
//		fo(j,0,top[i]) ww("%d ",f[i][j]);puts("");
	}

	long long ans;
	fo(i,1,n) {
		ans=0;
		fo(j,0,min(top[i-1],top[n-i])) ans+=1ll*f[i-1][j]*f[n-i][j]%mo*(ti+1)%mo;
		ans=(ans+mo-1)%mo;
		printf("%lld\n",ans);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll                      long long
#define pb                      push_back
#define rep(i,a,b,c)            for(ll i=(a);i<=(b);i+=(c))
#define repb(i,a,b,c)           for(ll i=(a);i>=(b);i-=(c))
#define MOD                     1000000007
#define inf                     3e18
#define ld                      long double
#define mp                      make_pair
#define vpll                    vector<pair<ll,ll> >
#define vll                     vector<ll>
#define vld                     vector<ld>
#define vvll                    vector<vector<ll>>
#define vvld                    vector<vector<ld>>
#define pll                     pair<ll,ll>
#define vvpll                   vector<vector<pair<ll,ll>>>
#define pqll                    priority_queue<ll>
#define mll                     map<ll,ll>
#define mlc                     map<ll,char>
#define um                      unordered_map
#define umll                    um<ll,ll>
#define umlc                    um<ll,char>
#define all(x)                  x.begin(),x.end()
#define fi                      first
#define se                      second
#define ln                      cout<<"\n";
#define endl                    "\n"
#define test                    ll T;cin>>T;while(T--)
#define isvowel(a)              (a == 'a' || a == 'e' || a == 'i' || a == 'o' || a == 'u')
#define fastIO                  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define show(w,size)            for(ll i=0;i<size;i++) cout<<w[i]<<" ";
#define prll(a)                 cout<<a<<"\n";
#define mset(dp,no)             memset(dp,no,sizeof(dp))
#define input(a,n)              rep(i,0,n-1,1) cin>>a[i];
#define countbit                __builtin_popcount                                           //Number of setbits in decimal notation
#define lb(v,cur)               lower_bound(all(v),cur)-v.begin()
#define ub(v,cur)               upper_bound(all(v),cur)-v.begin()
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
    const char* comma = strchr(names + 1, ',');
    cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
long long pows(long long a, long long b) {
  long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
ll powm(ll x,ll y,ll m=MOD){x=x%m;ll res=1;while(y){if(y&1)res=res*x;res%=m;y=y>>1;x=x*x;x%=m;}return res;}
ll modInverse(ll a, ll m=MOD){return powm(a,m-2,m);}
int main()
{
fastIO
ll n,m,i,j,k,x,y,z,t,e,f,p,q,g,l,r,o,w,h,count1=0,prod=1,ans=0,a,b,c,d,index,x1,x2,y1,y2,diff,sum=0,flag=0,flag1=0,flag2=0;
string s,s1,s2;
cin>>n;
ld ar[n];
ld sum1=0.0,sum2=0.0,sum3=0.0;
for(i=0;i<n;i++)
{
  cin>>ar[i];
  sum1+=abs(ar[i]);
  sum2+=(ar[i]*ar[i]);
  sum3=max(sum3,abs(ar[i]));
}
sum2=sqrt(sum2);
cout<<fixed<<setprecision(10)<<sum1<<"\n"<<sum2<<"\n"<<sum3;
}

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

int n;
long long k;

long long C(long long x){
	return x * (x + 1) / 2;
}

long long f(long long x){
	long long ans = 0;
	for(int i = 1; i <= n; i++){
		long long a = x - i;
		if(a < 2) continue;
		long long lim = min(1ll * n, a - 1);
		long long lim1 = min(1ll * n, (a + 1) / 2);
		ans += 2 * (C(lim1 - 1) + a * (lim - lim1) - C(lim) + C(lim1));
		ans += min(1ll * n, a / 2);
	}
	return ans;
}

void solve(int lo, long long k){
	int x = -1, y = -1;
	for(int i = 1; i <= n; i++){
		int a = lo - i;
		int l = a / 2 + 1;
		int r = min(a - 1, n);
		int here = 2 * max(0, r - l + 1) + (a % 2 == 0 and a / 2 <= n);
		if(k <= here){
			x = i;
			break;
		}
		k -= here;
	}
	lo -= x;
	for(int j = 1; j <= n; j++){
		int v = lo - j;
		if(1 <= v and v <= n){
			k--;
		}
		if(k == 0){
			y = j;
			break;
		}
	}
	printf("%d %d %d\n", x, y, lo - y);
}

int main(){
	cin >> n >> k;
	int lo = 3, hi = 3 * n;
	while(lo < hi){
		int mi = lo + (hi - lo) / 2;
		if(f(mi) < k) lo = mi + 1;
		else hi = mi;
	}
	k -= f(lo - 1);
	solve(lo, k);
	return 0;
}


#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <optional>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#ifdef ENVIRONMENT_LINKED_BOOST
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#endif

using namespace std;
using uint  = unsigned int;
using ll    = long long;
using ull   = unsigned long long;
using lpair = std::pair<ll, ll>;
#define REP(i, a, b)    for (ll i = a; i < b; ++i)
#define REPREV(i, a, b) for (ll i = a; i > b; --i)

const int _ = []() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);
    return 0;
}();

template <typename value_t>
void resize(value_t& v, const value_t& val) { v = val; }
template <typename vec_t, typename value_t, typename... arg_t>
void resize(std::vector<vec_t>& v, const value_t& val, int size, arg_t... arg) {
    v.resize(size);
    for (auto& c : v) resize(c, val, arg...);
}
template <typename A, typename B>
void chmin(A& a, const B& b) { a = min(a, static_cast<A>(b)); };
template <typename A, typename B>
void chmax(A& a, const B& b) { a = max(a, static_cast<A>(b)); };

int main() {
    int N, K;
    cin >> N >> K;
    vector<array<int, 3>> A;
    REP(i, 0, N) {
        REP(j, 0, N) {
            int a;
            cin >> a;
            A.push_back({a, (int)i, (int)j});
        }
    }
    sort(A.begin(), A.end(), greater<array<int, 3>>());
    vector<vector<int>> sum(N + 1, vector<int>(N + 1, 0));
    int l = -1;
    int r = N * N - 1;
    while (r - l > 1) {
        for (auto& v : sum) {
            for (int& x : v) x = 0;
        }
        int mid = l + (r - l) / 2;
        REP(i, 0, mid + 1) {
            auto [a, x, y] = A[i];
            int px         = max(0, x - K + 1);
            int py         = max(0, y - K + 1);
            sum[px][py] += 1;
            sum[px][y + 1] -= 1;
            sum[x + 1][py] -= 1;
            sum[x + 1][y + 1] += 1;
        }
        REP(i, 0, N + 1) {
            REP(j, 1, N + 1) {
                sum[i][j] += sum[i][j - 1];
            }
        }
        REP(i, 1, N + 1) {
            REP(j, 0, N + 1) {
                sum[i][j] += sum[i - 1][j];
            }
        }
        bool ok = false;
        REP(i, 0, N - K + 1) {
            REP(j, 0, N - K + 1) {
                if (sum[i][j] < K * K / 2 + 1) {
                    ok = true;
                    break;
                }
            }
            if (ok) break;
        }
        (ok ? l : r) = mid;
    }
    cout << A[r][0] << endl;
    return 0;
}

#include <cmath>
#include <cstdio>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define N 807
using namespace std;
typedef long long ll;

inline int rd() {
    int x = 0;
    bool f = 0;
    char c = getchar();
    for (; !isdigit(c); c = getchar()) f |= (c == '-');
    for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
    return f ? -x : x;
}

int n, k, lim, a[N][N], sum[N][N];

inline bool valid(int x) {
    memset(sum, 0, sizeof(sum));
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j) {
            if (a[i][j] <= x) ++sum[i][j];
            sum[i][j] += sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1];
            if (i >= k && j >= k) {
                if (sum[i][j] - sum[i - k][j] - sum[i][j - k] + sum[i - k][j - k] >= lim) return 1;
            }
        }
    return 0;
}

int main() {
    n = rd(); k = rd();
    for (int i = 1; i <= n; ++i)
        for (int j = 1; j <= n; ++j) a[i][j] = rd();
    lim = k * k / 2 + (k & 1);
    int l = 0;
    int r = (1 << 30);
    while (l < r) {
        int mid = (l + r) / 2;
        if (valid(mid)) r = mid;
        else l = mid + 1;
    }
    printf("%d\n", l);
    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007LL

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

ll key(vector<vector<P> > &dp, ll l, ll r) {
	if(l + 1 == r)return dp[l][r].FI;
	if(dp[l][r].SE != -1)return dp[l][r].FI;
	ll ret = dp[l][r].FI;
	for(ll i = l + 1;i < r;i++) {
		ret = max(ret, key(dp, l, i) + key(dp, i, r));
	}
	dp[l][r].SE = 0;
	return dp[l][r].FI = ret;
}

ll seica(vector<ll> &w, vector<P> &h) {
	ll n = w.size();
	vector<vector<P> > dp(n, vector<P>(n, MP(0, -1)));
	// cout << "in seica" << endl;
	// cout << "w: ";SHOW1d(w, n);
	REP(i, n) {
		ll now = w[i];
		for(ll j = i + 1;j < n;j++) {
			now += w[j];
			ll id = lower_bound(ALL(h), MP(now, 0LL)) - h.begin();
			if(id == 0)continue;
			// cout << i << " " << now << " " << id << " " << h[id].SE << endl;
			dp[i][j].FI = h[id-1].SE;
		}
	}
	ll ret = key(dp, 0, n-1);
	// cout << ret << endl;
	return ret;
}

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

	ll n, m;cin >> n >> m;
	vector<ll> w(n);
	REP(i, n)cin >> w[i];
	sort(ALL(w));
	vector<P> h(m);
	ll v_min = LLINF;
	REP(i, m) {
		cin >> h[i].SE >> h[i].FI;
		v_min = min(v_min, h[i].FI);
	}
	h.PB(MP(LLINF, 0));

	sort(ALL(h));
	REP(i, m) {
		h[i + 1].SE = max(h[i].SE, h[i+1].SE);
	}
	// REP(i, m + 1)cerr << "sorted: " << h[i].FI << " " << h[i].SE << endl;

	if(*max_element(ALL(w)) > v_min) {
		cout << -1 << endl;
		return 0;
	}

	ll ans = LLINF;
	ll cou = 1;
	for(ll i = 1;i <= n;i++)cou *= i;
	REP(i, cou) {
		ans = min(ans, seica(w, h));
		next_permutation(ALL(w));
	}

	if(ans == LLINF)cout << -1 << endl;
	else cout << ans << endl;

	return 0;
}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

template<class V, int ME> class BIT {
public:
	V bit[1<<ME],val[1<<ME];
	V operator()(int e) {if(e<0) return 0;V s=0;e++;while(e) s+=bit[e-1],e-=e&-e; return s;}
	void add(int e,V v) { val[e++]+=v; while(e<=1<<ME) bit[e-1]+=v,e+=e&-e;}
	void set(int e,V v) { add(e,v-val[e]);}
	int lower_bound(V val) {
		V tv=0; int i,ent=0;
		for(i=ME-1;i>=0;i--) if(tv+bit[ent+(1<<i)-1]<val) tv+=bit[ent+(1<<i)-1],ent+=(1<<i);
		return ent;
	}
};
BIT<int,20> TL,TR;;

int N,L;
int A[101010],B[101010];
int T[101010];
map<int,int> le,ri;
void solve() {
	int i,j,k,l,r,x,y; string s;

	cin>>N>>L;
	A[0]=B[0]=0;
	FOR(i,N) {
		cin>>A[i+1];
		A[i+1]-=i+1;
	}
	A[N+1]=B[N+1]=L-N;
	FOR(i,N) {
		cin>>B[i+1];
		B[i+1]-=i+1;
	}

	N+=2;

	FOR(i,N) if(ri.count(A[i])==0) ri[A[i]]=i;
	for(i=N-1;i>=0;i--) if(le.count(A[i])==0) le[A[i]]=i;

	FOR(i,N) {
		if(A[i]==B[i]) T[i]=i;
		if(A[i]<B[i]) {
			if(ri.count(B[i])==0) return _P("-1\n");
			T[i]=ri[B[i]];
			TR.set(T[i],1);
		}
		if(A[i]>B[i]) {
			if(le.count(B[i])==0) return _P("-1\n");
			T[i]=le[B[i]];
			TL.set(T[i],1);
		}
	}
	ll ret=0;
	FOR(i,N) {
		if(A[i]<B[i]) {
			ret++;
			ret+=TR(T[i]-1)-TR(i);
		}
		if(A[i]>B[i]) {
			ret++;
			ret+=TL(i-1)-TL(T[i]);
		}
	}

	cout<<ret<<endl;
}

int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


#include <bits/stdc++.h>
using namespace std;
/*
string r(string s){
  string r;

  for(int i=s.size()-1;i>=0;i--){
    r+=s.at(i);
  }

  return r;
}
    */

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

  string t;
  bool r=false;

  for(int i=0;i<s.size();i++){
    if(s.at(i)!='R'){
      if(!r){

      if(t=="" || t.at(t.size()-1)!=s.at(i)){
        t+=s.at(i);
      }else{
        t.erase(t.size()-1);
      }

      }else{

        if(t=="" || t.at(0)!=s.at(i)){
        t=s.at(i)+t;
      }else{
        t.erase(0,1);
      }

      }

    }else{
      r=!r;
    }
  }

  if(r){
    reverse(t.begin(),t.end());
    cout << t <<endl;
  }else{
    cout << t <<endl;
  }

}

// Problem: D - Message from Aliens
// Contest: AtCoder - ZONe Energy Programming Contest
// URL: https://atcoder.jp/contests/zone2021/tasks/zone2021_d
// Memory Limit: 1024 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define pi  3.141592653589793238462643383279
#define int long long
#define lld long double
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=(int)x; i<y; i++)
#define VI vector <int>
#define VVI vector <VI>
#define pii pair<int, int>
#define ppi pair<pii, int>
#define mii map<int, int>
#define mci map<char, int>
#define miv map<int, VI>
#define mis map<int, set<int>>
#define high_functioning_sociopath  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const unsigned int M = 998244353;
/*_____________________________THE GAME IS ON_____________________________*/
void solve()
{
      string s;
      cin >> s;
      int n = s.size();
      deque<char>dq;
      bool off = 0;
      for(int i=0;i<n;i++)
      {
      	  if(s[i]=='R')
      	  {
      	  	  off^=1;
      	  	  continue;
      	  }
      	  if(off==0)dq.push_front(s[i]);
      	  else dq.push_back(s[i]);
      }
      stack<int>st;
      while(!dq.empty())
      {
      	   if(off)
      	   {
      	   	  char x = dq.back();
      	      if(st.empty())st.push(x);
      	      else
      	      {
      	      	 if(st.top()==x)st.pop();
      	      	 else st.push(x);
      	      }dq.pop_back();
      	   }
      	   else
           {
      	         char x = dq.front();
      	         if(st.empty())st.push(x);
      	         else
      	         {
      	      	    if(st.top()==x)st.pop();
      	      	      else st.push(x);
      	         }dq.pop_front();
           }
      }
      vector<char>v;
      while(!st.empty())
      {
      	  v.pb(st.top());
      	  st.pop();
      }
      for(auto x : v) cout << x;
}
int32_t main()
{
   high_functioning_sociopath
   //pre();
   int t=1;
   //cin>>t;
   while(t--)
   {
      solve();
   }
}


#include<bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll mod=1000000007;
string S;
ll K;
ll comb[17][17];
ll Pow[17][250001];
void init(){
for(ll n=0;n<17;n++)comb[n][0]=1;
  for(ll n=1;n<17;n++)
    for(ll k=1;k<=n;k++)
      comb[n][k]=(n*comb[n-1][k-1])/k;
  for(ll i=0;i<17;i++)Pow[i][0]=1;
  for(ll k=1;k<250001;k++)
    for(ll n=1;n<17;n++){
    Pow[n][k]=(Pow[n][k-1]*n)%mod;
    }
}
ll Combb(ll y,ll N){
ll sum=0;
  for(ll i=0;i<K;i++){
  ll x=(Pow[K-i][N]*comb[y][i])%mod;
    if(i%2==0)sum=(sum+x)%mod;
    else sum=(sum-x+mod)%mod;
  }
return sum;
}

int main(){
  cin>>S>>K;ll N=S.size();init();
  ll ans=0;
  for(ll n=1;n<N;n++){
  ans=(ans+Combb(K-1,n-1)*15)%mod;
  }ans=(ans*comb[15][K-1])%mod;
  set<ll>SS;
  for(ll i=0;i<N;i++){
  ll a=S[i]-'0';
    if(!(0<=a&&a<=9))
      a=S[i]-'A'+10;
    ll Y=SS.size();
    for(ll j=0;j<a;j++){
      if(i==0 && j==0)continue;
    ll y=Y;if(!SS.count(j))y++;
      if(K<y)continue;
      y=K-y;
      ll x=Combb(y,N-1-i);
      ans=(ans+comb[16-K+y][y]*x)%mod;

    } SS.insert(a);
  }if(SS.size()==K)ans++;
  cout<<ans<<endl;
  return 0;
}


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

void Main()
{
    int n;
    string s;
    cin >> n >> s;
    int i = 0;
    while (i < s.size()){
        if (s.substr(i, 3) == "fox") {
            s = s.substr(0, i) + s.substr(i+3);
            i = max(i-3,-1);
        }
        i += 1;
    }
    cout << s.size() << endl;
}

int main(int argc, char **argv)
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    Main();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector<char> vc;
typedef queue<ll> ql;
typedef deque<ll> dql;
typedef priority_queue<ll> pql;
typedef set<ll> sl;
typedef pair<ll, ll> pl;
typedef vector<vl> vvl;
typedef vector<pl> vpl;
#define rep(i, n) for(ll i = 0; i < ll(n); i++)
#define rep2(i, k, n) for(ll i = ll(k); i <= ll(n); i++)
#define rep3(i, n, k) for(ll i = ll(n); i >= ll(k); i--)
#define all(v) (v).begin(), (v).end()
ll mod(ll a, ll b) {if(b == 0) return 0; return (a % b + b) % b;}
bool chmin(ll &a, ll b) {if(b < a) {a = b; return 1;} return 0;}
bool chmax(ll &a, ll b) {if(b > a) {a = b; return 1;} return 0;}
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
const ll MAX = 1e3;
const ld eps = 1e-9;
const char newl = '\n';

vl parent(MAX), depth(MAX);

ll find(ll x) {if(parent[x]==x) return x; return parent[x] = find(parent[x]);}

void unite(ll x, ll y) {
  x = find(x);
  y = find(y);
  if (x==y) return;

  if(depth[x] < depth[y]) {
    parent[x] = y;
  }else {
    parent[y] = x;
    if(depth[x] == depth[y]) depth[x]++;
  }
}

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

  cout << fixed << setprecision(15);

  ll n;
  cin >> n;
  vl x(n), y(n);
  rep(i, n) cin >> x[i] >> y[i];

  ll ok=0, ng=40001;
  while(ng-ok>1) {
    ll RR = (ok+ng)/2;

    rep(i, n) {parent[i] = i; depth[i] = 0;}
    rep2(i, 200-99, 200+99) {parent[i] = 200; depth[i] = 0;}
    rep2(i, 400-99, 400+99) {parent[i] = 400; depth[i] = 0;}

    rep(i, n) {
      if((100+y[i])*(100+y[i]) < RR) unite(i, x[i]+200);
      if((100-y[i])*(100-y[i]) < RR) unite(i, x[i]+400);
    }

    rep(i, n-1) rep2(j, i+1, n-1) {
      ll dx = x[j]-x[i], dy = y[j]-y[i];
      if(dx*dx+dy*dy < RR) unite(i, j);
    }

    if(find(200)==find(400)) ng = (ok+ng)/2;
    else ok = (ok+ng)/2;
  }
  cout << sqrt(ok)/2 << newl;
  return 0;
}

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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using ll=long long;
using ld=long double;
using pii=pair<int, int>;
using vi=vector<int>;
using vii=vector<vector<int>>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const ll MOD=1e9+7;

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

struct Union_Find{
    vector<int> par, depth;
    Union_Find(int n){init(n);}
    void init(int n){
        par.resize(n); depth.resize(n);
        for(int i=0; i<n; i++){
            par[i]=i;
            depth[i]=0;
        }
    }

    int find(int x){
        if(par[x] == x) return x;
        return par[x]=find(par[x]);
    }

    void unite(int x, int y){
        x=find(x), y=find(y);
        if(x == y) return;

        if(depth[x] < depth[y]) par[x]=y;
        else{
            par[y]=x;
            if(depth[x] == depth[y]) depth[x]++;
        }
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }
};

int main(){
    int n; cin >> n;
    vi x(n), y(n);
    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i];
    }

    vector<vector<double>> dist(n+2, vector<double>(n+2));
    vector<double> d;
    for(int i=0; i<n; i++){
        for(int j=i+1; j<n; j++){
            int dx=x[i]-x[j], dy=y[i]-y[j];
            double val=sqrt(dx*dx+dy*dy);
            dist[i][j]=val;
            d.push_back(val);
        }
    }
    for(int i=0; i<n; i++){
        dist[i][n]=100-y[i];
        dist[i][n+1]=y[i]+100;
        d.push_back(100-y[i]);
        d.push_back(y[i]+100);
    }
    sort(all(d));

    for(auto ans : d){
        Union_Find uf(n+2);
        for(int i=0; i<n; i++){
            for(int j=i+1; j<n+2; j++){
                if(dist[i][j] <= ans) uf.unite(i, j);
            }
        }
        if(uf.same(n, n+1)){
            cout << fixed << setprecision(5);
            cout << ans/2 << endl;
            break;
        }
    }
    return 0;
}


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

#define rapid() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl '\n'
#define inf 1e36
#define pb push_back
#define mp make_pair
#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

typedef long long ll;

const ll dp=1e9+7;

int main(){
  rapid();
  //freopen("input.txt","r",stdin);
  //freopen("output.txt","w",stdout);
  ll n,cnt=0;
  cin>>n;
  vector<ll>vec(n);
  map<ll,ll>m;
  for(int i=0;i<n;i++){
  	cin>>vec[i];
  	m[vec[i]%200]++;
  }
  for(auto u:m){
  	cnt+=(u.second*(u.second-1))/2;
  }
  cout<<cnt<<endl;
  return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define REP1(i,a,b) for(int i=a;i<=(int)b;i++)
#define ll long long int
#define ld long double
#define nl endl
#define s(a) scanf("%d",&a)
#define p(a) printf("%d",a);
#define pb push_back

const double PI=acos(-1.0);

int main()
{
   #ifndef ONLINE_JUDGE
   freopen("F:/bla bla bal/sublime/input.txt","r",stdin);
   freopen("F:/bla bla bal/sublime/output.txt","w",stdout);
   #endif

  int n;cin>>n;
  int a[1001];
  int s=0;
  REP(i,n){
    cin>>a[i];
    if(a[i]>10)s+=(a[i]-10);
  }
  cout<<s<<nl;

   return 0;

}