#include <bits/stdc++.h>

using namespace std;

//begin of def

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define endl '\n'

using lli = long long int;
using ulli = unsigned long long int;
using Ld = long double;
using pii = pair<int, int>;
using pll = pair<lli, lli>;
using pld = pair<Ld, Ld>;
#define X first
#define Y second

#define rep(I, S, E) for(int I = (S); I < (E); I++)
#define repq(I, S, E) for(int I = (S); I <= (E); I++)

#define pb push_back
#define epb emplace_back

#define ALL(X) X.begin(), X.end()

//end of def

map<lli, int> st[2];

int main(){
    fastio;
    int n;
    cin >> n;
    vector<lli> a(n), b(n);
    rep(i, 0, n)
        cin >> a[i];
    st[0][a[0]]++;

    b[0] = a[0];
    rep(i, 1, n){
        b[i] = a[i] - b[i - 1];
        st[i & 1][b[i]]++;
    }

    lli m = 0, res = 0;
    rep(i, 0, n){

        int ct = 0;
        if(i & 1)
            ct = st[0][m] + st[1][-m];
        else
            ct = st[0][-m] + st[1][m];
        st[i & 1][b[i]]--;
        res += ct;
        m = b[i];
    }
    cout << res;
    return 0;
}

#include<bits/stdc++.h>
#include<vector>
#include<string>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
bool flag[2510];
int dx[4];
int dy[4];
int t[51][51];
int p[51][51];
string direction = "UDLR";
int nx,ny;
int mx;
int sm,maxsum;
bool is_legal_action(int nx,int ny,bool *flag){
	if(0<=nx&&nx<50&&0<=ny&&ny<50&&flag[t[nx][ny]]==0){
		return true;
	}else{
		return false;
	}
}
int legallistlength(int x,int y,bool *flag){
  	int k=0;
  	rep(i,4){
      	nx = x + dx[i];
		ny = y + dy[i];
      	if(is_legal_action(nx,ny,flag)){
          	k++;
        }
    }
    return k;
}
void dfs(int x,int y,bool *flag,int depth){
  	flag[t[x][y]]=1;
  	sm+=p[x][y];
  	//sm++;
  	rep(i,4){
		nx = x + dx[i];
		ny = y + dy[i];
		if(depth>=1&&is_legal_action(nx,ny,flag)){
          	//cout << x <<" " <<  y <<" " << i << endl;
          	dfs(nx,ny,flag,depth-1);
        }
    }
  	if(depth==0||legallistlength(x,y,flag)==0){
      	if(maxsum<sm){
          	maxsum=sm;
          	//cout << maxsum << endl;
        }

    }
  	sm-=p[x][y];
  	//sm--;
  	flag[t[x][y]]=0;
  	return;
}
void func(int x,int y,bool *flag,vector<char>& route){
	flag[t[x][y]]=1;
	int s=-1;
	int nxt=-1;
	rep(i,4){
		nx = x + dx[i];
		ny = y + dy[i];
		if(is_legal_action(nx,ny,flag)){
			/*if(s<=p[nx][ny]){
				s=p[nx][ny];
				nxt=i;
			}*/
          	sm=0;
          	maxsum=-1;
          	dfs(nx,ny,flag,22);
          	if(maxsum>=s){
              	s=maxsum;
              	nxt=i;
            }
          	//cout << i << " " << maxsum <<endl;

		}
      	//cout <<x<<" " << y <<direction[i]<< nxt << endl;
	}
  	flag[t[x][y]]=1;
	if(nxt==-1){
		for (auto i: route){
			cout << i;
		}
		cout << "\n";
	}else{
		route.push_back(direction[nxt]);
		func(x + dx[nxt],y + dy[nxt],flag,route);
		route.pop_back();
	}
	flag[t[x][y]]=0;
	return;
}
int main(){
	int si,sj;
	scanf("%d %d",&si,&sj);
	int M=0;
	rep(i,50)rep(j,50){
		cin >> t[i][j];
		if(M<t[i][j])M=t[i][j];
	}
	M++;
	rep(i,50)rep(j,50) scanf("%d", &p[i][j]);
	rep(i,2500)flag[i]=0;
	vector<char> route;
	dx[0] = -1;
	dx[1] = 1;
	dx[2]=0;
	dx[3]=0;
	dy[0]=0;
	dy[1]=0;
	dy[2]=-1;
	dy[3]=1;
	func(si,sj,flag,route);
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int T;
	cin>>T;
	while(T--){
		map<int,bool>cnt;
		int n;cin>>n;
		for(int i=0;i<n;i++){
			int x;cin>>x;
			cnt[x]^=1;
		}
		if(n&1)puts("Second");
		else {
			bool f=false;
			for(auto& i:cnt)f|=i.second;
			puts(f?"First":"Second");
		}
	}
}

//Code by Ritik Agarwal
    #include<bits/stdc++.h>
    using namespace std;
    #define sz(x) (int)(x).size()
    #define int long long int
    #define loop(i,a,b) for(int i=a;i<b;i++)
    #define scan(arr,n) for (int i = 0; i < n; ++i) cin >> arr[i]
    #define vi vector<int>
    #define si set<int>
    #define pii pair <int, int>
    #define sii set<pii>
    #define vii vector<pii>
    #define mii map <int, int>
    #define pb push_back
    #define ff first
    #define ss second
    #define all(aa) aa.begin(), aa.end()
    #define rall(a) a.rbegin() , a.rend()
    #define read(a,b) int a,b;  cin>>a>>b
    #define readt(a,b,c) int a,b,c; cin>>a>>b>>c
    #define readf(a,b,c,d) int a,b,c,d; cin>>a>>b>>c>>d;
    #define print(v) for(auto x:v) cout<<x<<" ";cout<<endl
    #define printPair(res) for(pair<int,int>& p:res) cout<<p.first<<" "<<p.second<<endl;
    #define faster ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
    //*****  Constants  *****
    const int mod = 1000000007; /* 1e9 + 7*/
    const int MAXN = 1000005; /*1e6 +5 */
    const int mod1= 998244353;
     int vis[MAXN]={0};
    int fac[300001];
    void fact(int m){fac[0]=1;for(int i=1;i<=300000;i++) fac[i]=(fac[i-1]%m * i%m)%m;}
    /* Iterative Function to calculate (x^y)%p in O(log y)*/
     long long power( long long x,  int y, int p){   long long res = 1;
     x = x % p; while (y > 0) { if (y & 1)  res = (res * x) % p;  y = y >> 1; x = (x * x) % p;} return res;}
    // Returns n^(-1) mod p
     long long modInverse( long long n, int p) {  return power(n, p - 2, p); }
     long long nCr( long long n,int r, int p) { if (r == 0) return 1; if(n<r) return 0;
      return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; }

     int binarySearch(vi arr, int l, int r, int x) {
       if (r >= l) { int mid = l + (r - l) / 2; if (arr[mid] == x) return mid;
       if (arr[mid] > x)  return binarySearch(arr, l, mid - 1, x);
       return binarySearch(arr, mid + 1, r, x); } return -1; }

    const int NAX=3E5+5;
    int BIT[NAX];
    int getSum( int index)
    {
        int sum=0;
        while(index>0)
        {
            sum+=BIT[index];
            index -=index & (-index);
        }
        return sum;
    }

    void update(int  n , int index , int val)
    {
        while(index<=n)
        {
            BIT[index]+=val;
            index += index & (-index);
        }
    }

    void convert(int arr[], int n)
{
    // Create a copy of arrp[] in temp and sort the temp array
    // in increasing order
    int temp[n];
    for (int i=0; i<n; i++)
        temp[i] = arr[i];
    sort(temp, temp+n);

    // Traverse all array elements
    for (int i=0; i<n; i++)
    {
        // lower_bound() Returns pointer to the first element
        // greater than or equal to arr[i]
        arr[i] = lower_bound(temp, temp+n, arr[i]) - temp + 1;
    }
}

    void solve(int test)
    {
        int n;cin>>n;
        vi arr(n);
        scan(arr,n);
        sort(all(arr));
        if(n&1) cout<<"Second\n";
        else
        {
            int f=0;
            for(int i=-0;i<n;i+=2)
            {
                if(arr[i]!=arr[i+1])
                    f=1;
            }
            if(f==1)
                cout<<"First\n";
            else
                cout<<"Second\n";
        }
    }

    int32_t main()
    {
        #ifndef ONLINE_JUDGE
            freopen("input.txt", "r", stdin);
            freopen("output.txt", "w", stdout);
        #endif
        faster;//fact(mod1);
        int t=1;
        cin>>t;
        for(int test=1;test<=t;test++)
        {
            solve(test);
        }
    }


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

struct Node{
  vector<Node*> nodes;
  long long val;
  int depth;
};
vector<Node> node;

void depth_dfs(Node& a, int d){
  a.depth = d;
  for (auto& next:a.nodes)
    if(next->depth==-1)
      depth_dfs(*next, d+1);
}

void imos_dfs(Node& a, long now){
  now += a.val;
  a.val = now;
  for (auto& next:a.nodes)
    if(next->depth > a.depth)
      imos_dfs(*next, now);
}

int main(){
  int N;
  cin >> N;
  int a[N], b[N];
  node.resize(N);

  for (int i = 0; i < N; i++)node[i].val = 0;
  for (int i = 0; i < N; i++)node[i].depth = -1;
  for (int i = 0; i < N-1; i++){
    cin >> a[i] >> b[i];
    a[i]--;b[i]--;
    node[a[i]].nodes.push_back(&node[b[i]]);
    node[b[i]].nodes.push_back(&node[a[i]]);
  }
  depth_dfs(node[0],0);
  int Q;
  cin >> Q;
  for (int i = 0; i < Q; i++){
    int t, e, x, u, v;
    cin >> t >> e >> x;
    e--;
    u = a[e]; v = b[e];
    if(t==2)swap(u,v);
    if(node[u].depth > node[v].depth)
      node[u].val += x;
    else{
      node[0].val += x;
      node[v].val -= x;
    }
  }
  imos_dfs(node[0],0);
  for (int i = 0; i < N; i++)
    cout << node[i].val << endl;
}

/* In the name of Allah, The Most Gracious, The Most Merciful!

   Iffat Sanzida
   JU CSE48

   ❀(◕‿◕)❀

*/
#include<bits/stdc++.h>
#define ll long long int
#define pi acos(-1)
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;

//ll mod=1000000007;
//bool sortBysec(pair<ll,ll>a,pair<ll,ll>b)
//{
//    return a.second>b.second;
//}
//
//bool prime[2000000];
//vector<ll>vv;
//void SieveOfEratosthenes(ll n)
//{
//
//    prime[2]=true;
//    memset(prime, true, sizeof(prime));
//    for(ll i=4; i<=n; i+=2)
//    {
//        prime[i]=false;
//    }
//
//    for (ll p=3; p*p<=n; p+=2)
//    {
//
//        if (prime[p] == true)
//        {
//
//            for (ll i=p*p; i<=n; i +=(2*p))
//                prime[i] = false;
//        }
//    }
//    vv.push_back(2);
//    for(ll i=3; i<=n; i+=2)
//    {
//        if(prime[i])
//        {
//            vv.push_back(i);
//        }
//    }
//
//}
////
////ll phi[10000000];
////void EulerTotientFunction(ll n)
////{
////    for(ll i=1; i<=n; i++)
////    {
////        phi[i]=i;
////    }
////    for(ll i=2; i*i<=n; i++)
////    {
////        if(phi[i]==i)
////        {
////            for(ll j=i; j<=n; j+=i)
////            {
////                phi[j]/=i;
////                phi[j]*=(i-1);
////            }
////        }
////    }
////}
//
//
//ll binExp(ll a,ll n)
//{
//    ll res=1;
//    while(n)
//    {
//        if(n%2==1)
//        {
//            res=(res*a)%mod;
//            n--;
//        }
//        else
//        {
//            a=(a*a)%mod;
//            n=n/2;
//        }
//    }
//    return res;
//}
//
//ll ncr(ll n,ll r)
//{
//    if(r>n-r)
//    {
//        r=n-r;
//    }
//    ll i,j,ans=1;
//    for(i=n,j=1; j<=r; j++,i--)
//    {
//        ans=((ans*i)%mod);
//        ans=ans/j;
//        //ans=(ans*binExp(j,mod-2))%mod;
//    }
//    return ans;
//}
//
//ll power(ll n,ll m)
//{
//    ll ans=1;
//    while(m)
//    {
//        ans*=n;
//        m--;
//    }
//    return ans;
//}
//
//ll digsum(ll n)
//{
//    ll sum=0;
//    while(n)
//    {
//        sum+=n%10;
//        n=n/10;
//    }
//    return sum;
//}
//ll fac[2000006];
//void fact(ll n)
//{
//
//    fac[1]=1;
//    fac[0]=1;
//    for (ll i=1; i<=n; i++)
//    {
//        fac[i]=((fac[i-1]%mod)*(i%mod))%mod;
//    }
//
//}
//
//ll npr(ll n,ll r)
//{
//    ll ans=1;
//    for(ll i=n,j=1; j<=r; j++,i--)
//    {
//        ans=((ans%mod)*(i%mod))%mod;
//    }
//    return ans;
//}
//
//
//ll bigmod(ll a,ll b)
//{
//    ll ans=1;
//    for(ll i=1; i<=b; i++)
//    {
//        ans*=a;
//
//    }
//    return ans;
//}
//bool sortbysecTuple(const tuple<int, int, int>& a, const tuple<int, int, int>& b)
//{
//    return (get<1>(a) < get<1>(b));
//}
//
//ll ex_gcd(ll a,ll b,ll &x, ll &y)
//{
//    if(b==0)
//    {
//        x=1;
//        y=0;
//        return a;
//    }
//    ll x1,y1;
//    ll d=ex_gcd(b,a%b,x1,y1);
//    x=y1;
//    y=x1-y1*(a/b);
//    return d;
//}
//ll cntdig(ll n)
//{
//    ll cnt=0;
//    while(n)
//    {
//        cnt++;
//        n=n/10;
//    }
//    return cnt;
//}

int main()
{
    FAST();
    ll t=1,i=0,m,n,j,l,k,x,y,z,a,b,p,c,d,q,tt=0,r,s;

    //cin>>t;

    while(t--)
    {
        tt++;
        double D,H,di,hi,ans=0.0;
       // vector<double>d,h;
        cin>>n>>D>>H;
        for(i=0;i<n;i++)
        {
            cin>>di>>hi;
            ans=max(ans,H-((D*(H-hi))/(D-di)));
        }
        cout<<fixed<<setprecision(15)<<ans<<endl;

    }
    return 0;

}


/*pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define RFOR(i, a, n) for (ll i = (ll)n - 1; i >= (ll)a; i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define bra(first, second) '(' << first << ',' << second << ')'
//constexpr ll MOD = 1000000007;
constexpr ll MOD = 998244353;
ll INF = 1001001001001001001;
long double EPS = 1e-7;
long double PI = 3.141592653589793238;
template <typename T>
void remove(std::vector<T> &vector, unsigned int index)
{
   vector.erase(vector.begin() + index);
}

using Graph = vector<vector<ll>>;

// MOD確認

ll N,M,K;
ll A[110],B[110];
ll C[110],D[110];
ll E[110];

int main(){
   ll ans = 0;
   cin >> N >> M;
   rep(i,M) cin >> A[i] >> B[i];
   cin >> K;
   rep(i,K) cin >> C[i] >> D[i];
   rep(i,(1LL << K)){
      rep(j,105) E[j] = 0;
      rep(j,K){
         if(i & (1LL<<j)) E[C[j]]++;
         else E[D[j]]++;
      }
      ll cnt = 0;
      rep(j,M) if(E[A[j]] >= 1 && E[B[j]] >= 1) cnt++;
      ans = max(ans,cnt);
   }
   cout << ans << endl;
}

/*Name:- Prince Soni
College:- Jalpaiguri Government Engineering College*/

// this is how we declare a constant value
// const int xyz=2500000;

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

#define ll long long int
#define fio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define fr(i,n) for(ll i=0;i<n;i++)
#define fr1(i,n) for(ll i=1;i<=n;i++)
#define endl "\n"
#define mp make_pair
#define inf 1000000009

int main()
{
    fio;
    ll n;
    cin>>n;
    ll a[n];
    fr(i,n)
    cin>>a[i];
    ll ans=0,res;
    for(int i=2;i<=1000;i++)
    {
        ll c=0;
        for(int j=0;j<n;j++)
        {
            if(a[j]%i==0)
            c++;
        }
        if(max(ans,c)==c)
        {
            ans=max(ans,c);
            res=i;
        }
    }
    cout<<res<<endl;
}


#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<iomanip>
#include<queue>
#include<cmath>
#include<stack>
#include<map>
#define ll                   long long
#define skip                 cin>>ws;
#define vll                  vector<ll>
#define vb                   vector<bool>
#define vpll                 vector<pair<ll,ll>>
#define vi                   vector<int>
#define vpi                  vector<pair<int, int>>
#define vvll                 vector<vector<ll>>
#define vvi                  vector<vector<int>>
#define vvvll                vector<vector<vector<ll>>>
#define pll                  pair<ll,ll>
#define vs                   vector<string>
#define vvpll                vector<vector<pair<ll, ll>>>
#define vvpi                 vector<vector<pair<int, int>>>
#define pb                   push_back
#define pob                  pop_back()
#define MOD                  (ll)(1e9 + 7)
#define MOD2                 (ll)(998244353)
#define INF                  (ll)(1e18 + 5)
#define count1(n)            __builtin_popcountll(n)
#define test                 ll t; cin>>t; while(t--)
#define all(x)               begin(x), end(x)

using namespace std;

void inline show(vll &a){for(ll e: a){if(e == INF) cout<<"INF ";else cout<<e<<" ";}cout<<"\n";}

template<typename T> void enter(vector<T> &a){ for(T &e: a) cin>>e; }

ll inline mo(ll a){ return a%MOD;}

ll inline po(ll x, ll y, ll p)
{
    ll res = 1; x = x % p;
    while (y > 0) { if (y & 1) res = (res * x) % p; y >>= 1; x = (x * x) % p; }
    return res%p;
}

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

    ll n;
    cin>>n;

    vector<pair<pll, ll>> a(n), ma;
    for(ll i=0;i<n;i++)
    {
        ll x ,y;
        cin>>x>>y;
        a[i] = {{x, y}, i};
    }

    sort(all(a));

    ma.pb({
        {min(a[0].second, a[n-1].second), max(a[0].second, a[n-1].second)}
        , a[n - 1].first.first - a[0].first.first});

    ma.pb({
        {min(a[0].second, a[n-2].second), max(a[0].second, a[n-2].second)}
        , a[n - 2].first.first - a[0].first.first});

    ma.pb({
        {min(a[1].second, a[n-1].second), max(a[1].second, a[n-1].second)}
        , a[n - 1].first.first - a[1].first.first});

    sort(all(a), [&](pair<pll, ll> a, pair<pll, ll> b){
        return a.first.second < b.first.second;
    });

    ma.pb({
        {min(a[0].second, a[n-1].second), max(a[0].second, a[n-1].second)}
        , a[n - 1].first.second - a[0].first.second});

    ma.pb({
        {min(a[0].second, a[n-2].second), max(a[0].second, a[n-2].second)}
        , a[n - 2].first.second - a[0].first.second});

    ma.pb({
        {min(a[1].second, a[n-1].second), max(a[1].second, a[n-1].second)}
        , a[n - 1].first.second - a[1].first.second});

    sort(all(ma), [&](pair<pll, ll> a, pair<pll, ll> b){
        return a.second > b.second;
    });

    for(ll i=1;i<ma.size();i++)
    {
        if(ma[i].first != ma[i - 1].first)
        {
            cout<<ma[i].second<<"\n";
            return 0;
        }
    }

    return 0;
}

#pragma GCC optimize(3)
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <queue>
#include <algorithm>
#define maxn 200010
using namespace std;
int read()
{
	int x=0,w=1;
	char ch=getchar();
	while((ch>'9'||ch<'0')&&(ch!='-')) ch=getchar();
	if(ch=='-')
	{
		w=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')
	{
		x=(x<<1)+(x<<3)+ch-'0';
		ch=getchar();
	}
	return x*w;
}
int n;
struct Code
{
	int l,r,num;
}code[maxn];
struct Heap
{
	int l,r,num;
}heap[maxn];
priority_queue <int> q;
int ans,res;
bool cmpl(Code x,Code y)
{
	return x.l<y.l;
}
bool cmpr(Heap x,Heap y)
{
	return x.r<y.r;
}
int main()
{
	n=read();
	for(register int i=1;i<=n;i++)
	{
		code[i].l=read();
		code[i].r=read();
		code[i].num=i;
		heap[i].l=code[i].l;
		heap[i].r=code[i].r;
		heap[i].num=i;
	}
	sort(code+1,code+n+1,cmpl);
	sort(heap+1,heap+n+1,cmpr);
	if(code[n].l-code[1].l>code[n].r-code[1].r) q.push(code[n].l-code[1].l);
	if(code[n-1].l-code[1].l>code[n-1].r-code[1].r) q.push(code[n-1].l-code[1].l);
	if(code[n].l-code[2].l>code[n].r-code[2].r) q.push(code[n].l-code[2].l);
	if(heap[n].r-heap[1].r>=heap[n].l-heap[1].l) q.push(heap[n].r-heap[1].r);
	if(heap[n-1].r-heap[1].r>=heap[n-1].l-heap[1].l) q.push(heap[n-1].r-heap[1].r);
	if(heap[n].r-heap[2].r>=heap[n].l-heap[2].l) q.push(heap[n].r-heap[2].r);
	q.pop();
	cout<<q.top();
    return 0;
}


#include<cstring>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<queue>
#include<map>
#define l(x) (x<<1)
#define r(x) ((x<<1)|1)
#define IL inline
#define reg register
#define LL long long
#define INF 0x3f3f3f3f
using namespace std;

LL b,c,x,y,ans;

IL LL Min(LL a,LL b){return (a<b)?a:b;}
IL LL Max(LL a,LL b){return (a>b)?a:b;}

IL LL read(){
	LL p=0,f=1;	char	c=getchar();
	while (c<48||c>57)	{if (c=='-')	f=-1;	c=getchar();}
	while (c>=48&&c<=57)	p=(p<<1)+(p<<3)+c-48,c=getchar();
	return p*f;
}

int main(){
	#ifdef __Marvolo
	freopen("zht.in","r",stdin);
	freopen("zht.out","w",stdout);
	#endif
	b=read();	c=read();
	if (!c)	{
		puts("1");
		return 0;
	}
	if (!b){
		ans=c/2+(c-1)/2+1;
		cout<<ans<<endl;
		return 0;
	}
	if (b>0){
		if (2*b<=c)	ans=1;	// 0
		ans+=Min(c/2+1,b);
		ans+=Min((c-1)/2+1,b);
		c--;
		if (!c)	{
			cout<<ans<<endl;
			return 0;
		}
		ans+=c/2;
		ans+=(c-1)/2;
		cout<<ans<<endl;
	}	else {
		b=-b;	c--;
		if (2*b<=c)	ans=1;	// 0
		ans++;
		ans+=Min(c/2+1,b);
		ans+=Min((c-1)/2+1,b);
		if (!c)	{
			cout<<ans<<endl;
			return 0;
		}
		ans+=c/2;
		ans+=(c-1)/2;
		cout<<ans<<endl;
	}
	return 0;
}

/*  CREATED BY
    STREAM_CIPHER
    june-2021
*/
#include<bits/stdc++.h>
using namespace std;
void __print(long long x) {cerr << x;}void __print(unsigned long long x) {cerr << x;}void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define int long long int
#define double long double
#define fix_precision(n) cout<<fixed<<setprecision(n)
#define all(a) a.begin(),a.end()
const double pi=acos(-1.0);
int inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
// const int mod=998244353;
const int mx=5*1000000;//5*64M bit ->5*8M byte ->40MB size for long long int (64 bit)
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        // freopen("output.txt","w",stdout);
    #endif
        double a,b;
        cin>>a>>b;
        cout<<(b/100.00)*a<<endl;
}


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

//yukicoder@cpp14
//coder:luckYrat(twitter:@luckYrat_)
//競技プログラミングから逃げるな
//https://www.youtube.com/watch?v=z_B9iJ8r4ic

//せんげん！
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <bitset>

#include <cctype>
#include <utility>
#include <climits>

//なまえくーかん！
using namespace std;
using ll = long long;
using P = pair<ll,ll>;

//てーすう！
const int mod = 1000000007;
const int inf = (1<<30)-1;
const ll linf = (1LL<<62LL)-1;
const double EPS = (1e-10);

//でふぁいん！
#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)

//みじかく！
#define pb push_back
#define mkp make_pair
#define fir first
#define scn second
#define ednl endl

//いぇすのー！
#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")

//きんぼーnほーこー！！
P ar4[4] = {mkp(0,1),mkp(0,-1),mkp(1,0),mkp(-1,0)};
P ar8[8] = {mkp(-1,-1),mkp(-1,0),mkp(-1,1),mkp(0,-1),mkp(0,1),mkp(1,-1),mkp(1,0),mkp(1,1)};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる

計算量は変わらないが楽できるシリーズ
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる
*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}
int main(){
  int n;cin>>n;
  cout << n-1 << endl;
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _SCL_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <limits>
#include <numeric>
#include <valarray>
#include <fstream>
#include <array>
#include <random>
#include <unordered_set>
#include <unordered_map>

using namespace std;
using uint = uint32_t;
using LL = int64_t;
using ULL = uint64_t;
using PP = pair<LL, LL>;
template <typename T> using PriorityQ = priority_queue<T, vector<T>, greater<T> >;
#define REP(i, a, n) for(LL i = (a), i##_max_ = (n); i < i##_max_; ++i)
#define REM(i, a, n) for(LL i = (LL)(n) - 1, i##_min_ = (a); i >= i##_min_; --i)
#define FLOAT fixed << setprecision(16)
#define SPEEDUP { cin.tie(NULL); ios::sync_with_stdio(false); }
const int INF = 0x3FFFFFFF;
const LL INFLL = 0x3FFFFFFF3FFFFFFF;
const double INFD = 1.0e+308;
const double EPS = 1.0e-9;

void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
template <class T, class U> istream& operator>>(istream& ist, pair<T, U>& right) { return ist >> right.first >> right.second; }
template <class T, class U> ostream& operator<<(ostream& ost, const pair<T, U>& right) { return ost << right.first << ' ' << right.second; }
template <class T, class TCompatible, size_t N> void Fill(T(&dest)[N], const TCompatible& val) { fill(dest, dest + N, val); }
template <class T, class TCompatible, size_t M, size_t N> void Fill(T(&dest)[M][N], const TCompatible& val) { for (int i = 0; i < M; ++i) Fill(dest[i], val); }
template <class T> T Next() { T buf; cin >> buf; return buf; }
istream& Ignore(istream& ist) { string s; ist >> s; return ist; }
bool Inside(int i, int j, int h, int w) { return i >= 0 && i < h && j >= 0 && j < w; }

#ifdef ONLY_MY_ENVIR
#include "Accumulator.h"
#include "Algebraic.h"
#include "BinaryMatrix.h"
#include "BinaryTree.h"
#include "Bipartite.h"
#include "BIT.h"
#include "Compressor.h"
#include "Decompositions.h"
#include "DiscreteLog.h"
#include "DominatorTree.h"
#include "DynamicMod.h"
#include "Exponential.h"
#include "Factorization.h"
#include "FFT.h"
#include "Field.h"
#include "FlatTree.h"
#include "FlowSolver.h"
#include "Geometric2D.h"
#include "Geometric2DFloat.h"
#include "Geometric3D.h"
#include "Geometric3DFloat.h"
#include "Graph.h"
#include "GraphUtil.h"
#include "HLD.h"
#include "Interpolation.h"
#include "IntMod.h"
#include "KDTree.h"
#include "LazySegmentTree.h"
#include "LCA.h"
#include "LIS.h"
#include "List.h"
#include "Math.h"
#include "MathUtil.h"
#include "Matrix.h"
#include "MinCostFlowSolver.h"
#include "MinMax.h"
#include "Numbers.h"
#include "Optimize.h"
#include "Permutation.h"
#include "Polynomial.h"
#include "Position.h"
#include "Quadratic.h"
#include "Random.h"
#include "Range.h"
#include "Rational.h"
#include "RollingHash.h"
#include "RuntimeMod.h"
#include "SafeInt.h"
#include "SegmentTree.h"
#include "SegmentTree2D.h"
#include "Sets.h"
#include "Shortest.h"
#include "SlidingWindow.h"
#include "SpanningTree.h"
#include "StringSearching.h"
#include "SuffixArray.h"
#include "SwitchList.h"
#include "Timer.h"
#include "Tree.h"
#include "TreeUtil.h"
#include "UnionFind.h"
#include "Util.h"
#include "VectorUtil.h"
#endif

#ifdef __GNUC__
typedef __int128 LLL;
istream& operator>>(istream& ist, __int128& val) { LL tmp; ist >> tmp; val = tmp; return ist; }
ostream& operator<<(ostream& ost, __int128 val) { LL tmp = val; ost << tmp; return ost; }
#endif

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;

	int mx = -INF;
	for (int x : {a, b}) {
		for (int y : {c, d}) {
			mx = max(mx, x - y);
		}
	}
	cout << mx << endl;
	return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    cout<<b-c<<endl;
}


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

int main() {
  double N, D, H, maxi;
  cin >> N >> D >> H;
//  cout << " N " << N << " D " << D << " H " << H;
  vector<double> d(N), h(N);
  double a = H/D, ans;
//  cout << " a " << a << " ans " << ans <<endl;
  for(int i = 0; i < N; i++){
    cin >> d.at(i) >> h.at(i);
    if (a > (H-h.at(i))/(D-d.at(i))){
      maxi = i;
      a = (H-h.at(i))/(D-d.at(i));
//      cout << " a " << a << " i " << i << " maxi " << maxi << endl;
    }
  }
  ans = H - D * a;
  cout << ans << endl;
}

/*	author:  Kite_kuma
	created: 2021.01.23 20:57:55 */

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

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

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

	int n, m, k;
	cin >> n >> m >> k;
	vector<int> furidashi_ni_modoru(n + m + 1);

	{
		vector<int> a;
		rep(_, k) {
			int b;
			cin >> b;
			furidashi_ni_modoru[b] = 1;
			a.push_back(b);
		}

		rep(i, k - m + 1) {
			if(a[i + m - 1] - a[i] == m - 1) {
				cout << -1 << endl;
				return 0;
			}
		}
	}

	// x := dp[i] ( = answer)
	// dp[i] = a[i] * x + b[i]
	vector<double> a(n + m + 1), b(n + m + 1);
	double a_sum = 0, b_sum = 0;

	for(int i = n - 1; i >= 0; i--) {
		if(furidashi_ni_modoru[i]) {
			a[i] = 1;
		} else {
			a[i] = a_sum / m;
			b[i] = 1.0 + b_sum / m;
		}
		a_sum += a[i] - a[i + m];
		b_sum += b[i] - b[i + m];
	}

	// x == a[0] * x + b[0]
	cout << b[0] / (1.0 - a[0]) << '\n';

	return 0;
}


#include <iostream>
#include <math.h>
#include <vector>
#include <string>
#include <numeric>
#include <unordered_set>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <map>
using namespace std;

int main(){
    int n,k,m; cin >> n >> k >> m;
    vector<int> a(n-1);
    for(int i=0;i<n-1;i++) cin >> a[i];
    int sum=0;
    for(int i=0;i<n-1;i++) sum += a[i];
    int goal = m * n;
    if( goal > sum + k ) cout << -1 << endl;
    else cout << max(0,goal - sum) << endl;

}

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

int main(){
    int n,k,m;
    while( cin >> n >> k >> m ){
        int arr[n];
        int sum = 0;
        for( int i = 0; i < n-1; i++ ){
            int a;
            cin >> a;
            sum += a;
        }
        bool flag = false;
        for( int i = 0; i <= k; i++ ){
            int temp = sum+i;
            if( temp/n >= m ){
                cout << i << endl;
                flag = true;
                break;
            }
        }
        if( flag == false ){
            cout << "-1\n";
        }
    }
}


//#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>
#include<set>
#include<math.h>

#define DIV 998244353
#define INF 1e15
using namespace std;
using ll = long long;
using ldb = long double;

vector<string> s(3);
map<char, char> mp;
bool chk() {
	vector<ll> N(3);
	for (int i = 0; i < s[0].size(); i++) {
		if (i == 0 && mp[s[0][i]] == '0')return false;
		N[0] *= 10;
		N[0] += mp[s[0][i]] - '0';
	}

	for (int i = 0; i < s[1].size(); i++) {
		if (i == 0 && mp[s[1][i]] == '0')return false;
		N[1] *= 10;
		N[1] += mp[s[1][i]] - '0';
	}

	for (int i = 0; i < s[2].size(); i++) {
		if (i == 0 && mp[s[2][i]] == '0')return false;
		N[2] *= 10;
		N[2] += mp[s[2][i]] - '0';
	}

	//cout << N[0] << endl;
	//cout << N[1] << endl;
	//cout << N[2] << endl;
	if (N[0] + N[1] == N[2]) {
		cout << N[0] << endl;
		cout << N[1] << endl;
		cout << N[2] << endl;
		return true;
	}
	else return false;
}

int main() {
	cin >> s[0] >> s[1] >> s[2];

	vector<char> c;
	map<char, bool> b;
	for (int i = 0; i < s[0].size(); i++) {
		if (!b[s[0][i]]) {
			c.push_back(s[0][i]);
			b[s[0][i]] = true;
		}
	}

	for (int i = 0; i < s[1].size(); i++) {
		if (!b[s[1][i]]) {
			c.push_back(s[1][i]);
			b[s[1][i]] = true;
		}
	}

	for (int i = 0; i < s[2].size(); i++) {
		if (!b[s[2][i]]) {
			c.push_back(s[2][i]);
			b[s[2][i]] = true;
		}
	}

	int kind = b.size();
	if (kind > 10) {
		cout << "UNSOLVABLE" << endl;
		return 0;
	}

	vector<int> P(10);
	for (int i = 0; i < 10; i++) { P[i] = i; }

	do {
		for (int i = 0; i < kind; i++) {
			mp[c[i]] = P[i] + '0';
		}

		if (chk()) {
			return 0;
		}
	} while (next_permutation(P.begin(), P.end()));

	cout << "UNSOLVABLE" << endl;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF = 1LL<<60;
const double PI = acos(-1.0);
/*const double PI = atan2(0.0,-1.0)*/
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i,aa,n) for(int i = aa; i <= (int)(n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define ar_init(aa,val) rep(i,aa.size()) aa[i]=val;

using pii = pair<ll,ll>;
using vec2d = vector<vector<ll>>;
ll mo=998244353;

ll gg(ll N,ll n){

if(n==0) return 1;
ll pp,hh;
pp=n/2;
hh=n%2;
int tt=gg(N,n/2);
if(hh==0)return tt%mo*tt%mo;
else {return tt%mo*tt%mo*N%mo;}
}

int main(){
//cout<<fixed<<setprecision(15);

ll nn,mm,kk;
cin>>nn>>mm>>kk;
if(nn==1&&mm==1){
cout<<kk<<endl;
return 0;
}
if(nn==1){
cout<<gg(kk,mm)<<endl;
return 0;
}
if(mm==1){
cout<<gg(kk,nn)<<endl;
return 0;
}

ll sd=0;
vector<ll> df1(kk+1);
df1[0]=0;
rep1(i,1,kk){
sd+=df1[i-1];
df1[i]=gg(i,nn)-gg(i-1,nn);
}

ll ans=0;
rep1(i,1,kk){
ans+=df1[i]*gg(kk-i+1,mm)%mo;
ans%=mo;
}

cout<<(ans+mo)%mo<<endl;

}


#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define coy cout<<"Yes"<<endl
#define con cout<<"No"<<endl
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7
#define LINF 1e18+10
using ll = long long;

using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair<double, double>;
using PPI = pair<P, int>;
using PIP = pair<int, P>;
using Ps = pair<int, string>;

using vi = vector<int>;
using vl = vector<ll>;
using vc = vector<char>;
using vd = vector<double>;
using vs = vector<string>;
using vp = vector<P>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvd = vector<vector<double>>;
using vvc = vector<vector<char>>;
using vvp = vector<vector<P>>;
using vvb = vector<vector<bool>>;
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; }

//const ll mod=998244353;
const ll mod = 1e9 + 7;
const ll MAX = 300000;
template <typename T>
T abs(T a) { if (a < 0)return -a; else return a; }//2020/09/30 stdlib has abs(long) abs(long long) error

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

int main(){
  int n;
  cin>>n;
  vl x(n);
  rep(i,n)cin>>x[i];

  ll a,b,c;

  a=0;
  rep(i,n)a+=abs(x[i]);
  b=0;
  rep(i,n)b+=x[i]*x[i];
  c=-1;
  rep(i,n)chmax(c,abs(x[i]));
  cout<<a<<endl;
  printf("%.10lf\n",sqrt(b));
  cout<<c<<endl;

  return 0;
}

///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>
using namespace std;
#define                          ll                          long long int
ll gcd(int a,int b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}

#define                          in(x)                       scanf("%lld",&x)
#define                          in2(x,y)                    scanf("%lld %lld",&x,&y)
#define                          in3(x,y,z)                  scanf("%lld %lld %lld",&x,&y,&z)
#define                          out(x)                      printf("%lld\n",x)
#define                          cy                          printf("YES\n")
#define                          cn                          printf("NO\n")
#define                          inf                         1e18
#define                          neg                         -1e18
#define                          mxx                          2111111
#define                          fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define                          fi                          first
#define                          si                          second
#define                          ce                          cout<<endl
#define                          pb                          push_back
#define                          vc(x)                       x.begin(),x.end()
#define                          pb                          push_back
#define                          pi                          pair<ll,ll>
#define                          debug                       printf("ok\n");
#define                          pg                          pair<ll,ll>,vector<pair<ll,ll> >,greater<pair<ll,ll> >
#define                          mod                         1000000007

int main(){

        ll i,j,s=0,n,mx=-999999999;
        double sum=0.0,ans=0.0;
        in(n);
        ll a[n+9];
        for(i=0;i<n;i++){
           cin>>j;
           s+=abs(j);
           sum+=abs(j*j) ;
           mx=max(mx,abs(j));

        }
        ans=sqrt(sum);
        cout<<s<<endl;
       cout<<setprecision(15)<<fixed <<ans<<endl;
        cout<<mx<<endl;

 }


#include<bits/stdc++.h>
#define LL long long
#define rint register int
#define LB lower_bound
#define UB upper_bound
#define MS(x,y) memset(x,y,sizeof(x))
#define rep(i,a,b) for(rint i=a,i##end=b;i<=i##end;++i)
#define drep(i,a,b) for(rint i=a,i##end=b;i>=i##end;--i)
#define cms printf("%.2lf\n",(&o2-&o1)/1024.0/1024);
using namespace std;bool o1;
char IO;
inline int Rd(){
	int _s_=0;bool _f_=0;
	while(!isdigit(IO=getchar()))
		(IO=='-')&&(_f_=1);
	do _s_=(_s_<<1)+(_s_<<3)+(IO^48);
	while(isdigit(IO=getchar()));
	return _f_?-_s_:_s_;
}
const int P=1e9+7,n2=5e8+4;
int n,m,k,n2m,a1,b1,in[104];
void cmod(int &x){
	x>=P&&(x-=P);
}
int ksm(int x){
	int rst=1;
	for(rint y=P-2;y;y>>=1,x=1ll*x*x%P)
		(y&1)&&(rst=1ll*rst*x%P);
	return rst;
}
struct node{
	int a[105][105];
	node(){MS(a,0);}
	node operator * (const node &_) const{
		node rst;
		rep(i,1,n)
			rep(j,1,n)
				rep(l,1,n)
					cmod(rst.a[i][j]+=1ll*a[i][l]*_.a[l][j]%P);
		return rst;
	}
}st,nw;
bool o2;int main(){
	n=Rd(),m=Rd(),k=Rd();
	n2m=1ll*ksm(m)*n2%P;
	rep(i,1,n)
		st.a[1][i]=Rd();
	rep(i,1,m){
		in[a1=Rd()]++,in[b1=Rd()]++;
		nw.a[a1][b1]=nw.a[b1][a1]=n2m;
	}
	rep(i,1,n)
		cmod(nw.a[i][i]=P+1-1ll*in[i]*n2m%P);
	rep(i,0,29){
		if(k&(1<<i))
			st=st*nw;
		nw=nw*nw;
	}
	rep(i,1,n)
		printf("%d\n",st.a[1][i]);
	return 0;
}

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

using ll = long long int;

const ll INF = (ll)(1e10 + 5);

const ll MAX = (ll)(2e5 + 5);
const ll mult = (ll)(1e4);

double xd, yd, rd;

ll x, y, r;

bool check(ll next, ll width_2_pow) {
  return next * next <= width_2_pow;
}

ll mod_floor(ll right, ll mod) {
  if (right >= 0) {
    return right - (right % mod);
  } else {
    return right - (right % mod) - ((right % mod) == 0LL ? 0LL : mod);
  }
}

ll mod_ceil(ll left, ll mod) {
  if (left >= 0) {
    return left - (left % mod) + ((left % mod) == 0LL ? 0LL : mod);
  } else {
    return left - (left % mod);
  }
}

ll count_for(ll length) {
  ll width_2_pow = r * r - length * length;

  ll ok = 0LL;
  ll ng = MAX * mult;

  while (abs(ok - ng) > 1) {
    ll next = (ok + ng) / 2LL;
    if (check(next, width_2_pow))
      ok = next;
    else
      ng = next;
  }

  ll left = mod_ceil(x - ok, mult);
  ll right = mod_floor(x + ok, mult);

  return (right - left) / mult + 1LL;
}

int main(void) {
  // Here your code !
  scanf("%lf %lf %lf", &xd, &yd, &rd);

  x = (ll)(round(xd * (double)(mult)));
  y = (ll)(round(yd * (double)(mult)));
  r = (ll)(round(rd * (double)(mult)));

  ll bottom = (ll)(ceil(yd - rd)) * mult;
  ll top = (ll)(floor(yd + rd)) * mult;

  // printf("%lld, %lld\n", bottom, top);

  ll ans = 0LL;

  for (ll i = bottom; i <= top; i += mult) {
    // printf("i: %lld - ", i);
    ans += count_for(abs(y - i));
  }

  printf("%lld\n", ans);

  return 0;
}


#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
//#define mod 998244353
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
template<class T> using V=vector<T>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline void out(T a){ cout << a << '\n'; }
void YN(bool ok){if(ok) cout << "Yes" << endl; else cout << "No" << endl;}
//void YN(bool ok){if(ok) cout << "YES" << endl; else cout << "NO" << endl;}

const ll INF=1e18;
const int mx=200005;
//abc197
struct edge{
    int to;
    char C;
};

int main(){
    //オーバーフローは大丈夫ですか？？
    cin.tie(0);ios::sync_with_stdio(false);
    int n,m;
    cin>>n>>m;
    V<V<edge>> G(n);
    rep(i,m){
        int a,b;
        char c;
        cin>>a>>b>>c;
        a--;b--;
        G[a].pb({b,c});
        G[b].pb({a,c});
    }
    V<V<ll>> dp(n,V<ll>(n,INF));
    /*function<ll(int,int,int,int)> rec=[&](int u,int v,int p1,int p2){
        //cout<<u<<' '<<v<<endl;
        if(u==v){
            //cout<<"="<<endl;
            dp[u][v]=dp[v][u]=0;
            return 0LL;
        }
        int f=0;
        for(edge e:G[v]){
            if(e.to==u) f=1;
        }
        if(f){
            dp[u][v]=dp[v][u]=1;
            return 1LL;
        }
        ll &res=dp[u][v];
        if(res<INF) return res;
        for(edge e1:G[u]){
            for(edge e2:G[v]){
                if(e1.C==e2.C){
                    if(!(e1.to==p1&&e2.to==p2))res=min(res,2LL+rec(e1.to,e2.to,u,v));
                    //res=min(res,2LL+dp[e2.to][e1.to]);
                }
            }
        }
        //dp[v][u]=res;
        return res;
    };
    ll ans=rec(0,n-1,-1,-1);
    if(ans==INF) ans=-1;
    out(ans);*/
    rep(i,n){
        for(edge e1:G[i]){
            for(edge e2:G[i]){
                if(e1.C==e2.C){
                    dp[e1.to][e2.to]=2;
                    dp[e2.to][e1.to]=2;
                }
            }
        }
    }
    rep(i,n) dp[i][i]=0;
    rep(i,n){
        for(edge e:G[i]) dp[i][e.to]=dp[e.to][i]=1;
    }
    priority_queue<pair<ll,P>,V<pair<ll,P>>,greater<pair<ll,P>>> que;
    rep(i,n){
        rep(j,n){
            if(dp[i][j]<INF) que.push({dp[i][j],{i,j}});
        }
    }
    while(que.size()){
        pair<ll,P> p=que.top();
        que.pop();
        int u=p.sc.ft;
        int v=p.sc.sc;
        for(edge e1:G[u]){
            for(edge e2:G[v]){
                if(e1.C==e2.C){
                    if(dp[e1.to][e2.to]>dp[u][v]+2){
                        dp[e1.to][e2.to]=dp[u][v]+2;
                        que.push({dp[e1.to][e2.to],{e1.to,e2.to}});
                    }
                }
            }
        }
    }
    ll ans=dp[0][n-1];
    if(ans==INF) ans=-1;
    out(ans);
}
//ペナルティ出しても焦らない　ACできると信じろ！！！
//どうしてもわからないときはサンプルで実験　何か見えてくるかも
//頭で考えてダメなら紙におこせ！！

#include <bits/stdc++.h>

using namespace std;

void solve() {
    int n, m;
    cin >> n >> m;
    vector<vector<vector<int>>> adj_list(n, vector<vector<int>>(26));
    vector<pair<int, int>> edges(m);
    for (int i = 0; i < m; ++i) {
        int a, b;
        char cc;
        cin >> a >> b >> cc;
        int c = (int) (cc - 'a');
        --a;
        --b;
        adj_list[a][c].push_back(b);
        adj_list[b][c].push_back(a);
        edges[i] = {a, b};
    }
    vector<int> dist(n*n, -1);
    queue<pair<int, int>> q;
    q.push({0, n - 1});
    dist[0 * n + (n - 1)] = 0;
    while (!q.empty()) {
        auto [u, v] = q.front();
        q.pop();
        int d = dist[u * n + v];
        for (int c = 0; c < 26; ++c) {
            for (int u1 : adj_list[u][c]) {
                for (int v1 : adj_list[v][c]) {
                    int w = u1 * n + v1;
                    if (dist[w] == -1) {
                        dist[w] = d + 1;
                        q.push({u1, v1});
                    }
                }
            }
        }
    }
    int best = numeric_limits<int>::max();
    for (int i = 0; i < n; ++i) {
        if (dist[i * n + i] != -1) {
            best = min(best, dist[i * n + i] * 2);
        }
    }
    for (auto [u, v] : edges) {
        if (dist[u * n + v] != -1) {
            best = min(best, dist[u * n + v] * 2 + 1);
        }
        if (dist[v * n + u] != - 1) {
            best = min(best, dist[v * n + u] * 2 + 1);
        }
    }
    if (best != numeric_limits<int>::max()) {
        cout << best << "\n";
    } else {
        cout << "-1\n";
    }
}

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


// Powered by CP Editor (https://cpeditor.org)

//a+b = (a^b) + 2*(a&b)
//b^c = (a^b)^(a^c)
//gcd(x,y) = gcd(x-y,y)
//if n = 5000 then complexity cannot be (n^2*log(n)) means no map ,no sets
//check for long long overflow if input is large
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define int long long
#define mod 1000000007
// #define mod 998244353
#define pb push_back
#define ll long long
#define fi first
#define se second
#define vi vector<int>
#define pii pair<int,int>
#define mii map<int,int>
#define loop(i,n) for(int i=0;i<n;i++)
#define pp  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define fill(a,b) memset(a, b, sizeof(a))
#define all(x) (x).begin(), (x).end()

#define en cout<<"\n"

#define trace(x) cout<<#x<<": "<<x<<" "<<endl
#define trace2(x,y) cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x,y,z) cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a,b,c,d) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl

using namespace __gnu_pbds;
using namespace std;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set
const long long INF = 2000000000000000000;

long long power(long long a,long long b){
    long long ans=1;
    while(b>0){
        if(b&1){ans=(ans*a)%mod;}
                a=(a*a)%mod;
                b>>=1;
        }
    return ans;
}
#define M 2000005
int fact[M],fact_inv[M];
void pre(){
    fact[0]=1;
    fact_inv[0]=1;
    for(int i=1;i<M;i++){
        fact[i]=fact[i-1]*i;
        fact[i]%=mod;
        fact_inv[i]=power(fact[i],mod-2);
    }
}
long long ncr(long long n,long long r){
    if(n<r){return 0;}
    if(n==r||r==0){return 1;}
    return (((fact[n]*fact_inv[n-r])%mod)*fact_inv[r])%mod;
    //return x;
}
void solve()
{
	int n,m,k;
	cin>>n>>m>>k;
	int ans = ncr(n+m,n);
	if(n>m+k)
	{
		cout<<0;
		return;
	}
	int x = ncr(n+m,m+k+1);
	cout<<(ans - x + mod)%mod;
}

int32_t main()
{
pp;
pre();
int test=1;
// cin>>test;
while(test--)
{
	solve();
	en;
}
return 0 ;
}

#include <algorithm>
#include <iostream>

using namespace std;

const int MD = 1000000007;

long long inv(int n) {
	return n == 1 ? 1 : inv(n - MD % n) * (MD / n + 1) % MD;
}

long long choose(int n, int k) {
	return n < k ? 0 : k == 0 ? 1 : choose(n - 1, k - 1) * n % MD * inv(k) % MD;
}

int main() {
	int n, m, k; cin >> n >> m >> k;
	if (n - m >= k + 1) {
		cout << "0\n";
		return 0;
	}
	int ans = choose(n + m, n) - choose(n + m, n + (k + 1 - (n - m)));
	if (ans < 0)
		ans += MD;
	cout << ans << '\n';
	return 0;
}


#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include <limits>
#include <iomanip>
#include <cassert>
#include <numeric>
#include <chrono>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define debug(x) cerr << #x << " = " << (x) << endl;
#define debug_pii(x) cerr << "(" << x.first << "," << x.second << ")";
#define rep(i, n) for(int i = 0;i < n;i++)
#define repr(i, n) for(int i = n-1;i >= 0;i--)
#define pb push_back
#define mp make_pair
#define F first
#define S second

const long double pi = 3.141592653589793;
const int mod = 1e9 + 7;

const int nmax = 18;
const int inf = 30;
int dp[1 << nmax];
int g[nmax][nmax];
int n, e, a, b;

bool fullc(int mask) {
  rep(i, n) {
    rep(j, n) {
      if(i == j) continue;
      int ii = mask & (1 << i);
      int jj = mask & (1 << j);
      if(ii > 0 && jj > 0) {
        if(g[i][j] == 0) {
          return false;
        }
      }
    }
  }
  return true;
}

void solve() {

  cin >> n >> e;
  rep(i, e) {
    cin >> a >> b;
    a--;
    b--;
    g[a][b] = g[b][a] = 1;
  }
  for(int mask = 1;mask < (1 << n);mask++) {
    if(fullc(mask)) {
      dp[mask] = 1;
      continue;
    }
    dp[mask] = inf;
    for(int j = mask;j > 0;j = (j-1) & mask) {
      dp[mask] = min(dp[j] + dp[mask ^ j], dp[mask]);
    }
  }
  cout << dp[(1 << n)-1] << endl;
}

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);
 // cout << fixed << setprecision(15);
 ios_base::sync_with_stdio(false);
 cin.tie(nullptr);
 int t = 1;
 // cin >> t;
 while (t--) {
   solve();
 }

 return 0;
}

#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll = long long; using ull = unsigned long long; using pll = pair<ll,ll>; const ll INF = 4e18;
void print0() {}
template<typename Head,typename... Tail> void print0(Head head,Tail... tail){cout<<fixed<<setprecision(15)<<head;print0(tail...);}
void print() { print0("\n"); }
template<typename Head,typename... Tail>void print(Head head,Tail... tail){print0(head);if(sizeof...(Tail)>0)print0(" ");print(tail...);}
// clang-format on

vector<ll> nodes(19);
vector<vector<ll>> nodesset((1ULL << 19) + 5);
ll n, m;

vector<ll> memo2(500000, -1);
// 確定済みを s とするbitDP
ll dfs2(ll s) {
    if (s == (1ULL << n) - 1) {
        return 0;
    }
    if (memo2[s] >= 0) {
        return memo2[s];
    }
    ll ans = INF;
    auto task = stack<ll>();
    for (ll u = 0; u < n; u++) {
        ll ub = (1ULL << u);
        if (ub & s) continue;
        task.push(ub);
    }

    set<ll> done;
    while (!task.empty()) {
        ll t = task.top();
        task.pop();
        if (done.count(t)) continue;
        done.insert(t);
        bool added = false;
        for (auto v : nodesset[t]) {
            ll vb = (1ULL << v);
            if (vb & s) continue;
            if (vb & t) continue;
            task.push(t | vb);
            added = true;
        }
        // 次の状態の探索は、拾える連結成分を全部拾ったときだけ
        if (!added) ans = min(ans, 1 + dfs2(t | s));
    }
    return memo2[s] = ans;
}

int main() {
    cin >> n >> m;

    for (ll i = 0; i < m; i++) {
        ll a, b;
        cin >> a >> b;
        a--;
        b--;
        nodes[a] |= (1ULL << b);
        nodes[b] |= (1ULL << a);
    }
    for (ll i = 0; i < (1ULL << n); i++) {
        for (ll j = 0; j < n; j++) {
            ll nd = nodes[j];
            if ((nd & i) == i) {
                nodesset[i].push_back(j);
            }
        }
    }
    print(dfs2(0));
}


#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define debug(x) cout << #x << ": " << (x) << endl
#else
#define debug(x)
#endif
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int maxn=1<<20,inf=0x3f3f3f3f,mod=1e9+7;

int f[maxn],cnt[maxn],pop[maxn];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin>>n>>m;
    for(int i=0,u,v;i<m;++i)
    {
        cin>>u>>v;
        u--;
        v--;
        for(int j=0;j<(1<<n);++j) if(j&(1<<u) && (j&(1<<v))) cnt[j]++;
    }
    for(int i=1;i<(1<<n);++i) pop[i]=pop[i>>1]+(i&1);
    memset(f,0x3f,sizeof(f));
    f[0]=0;
    for(int i=0;i<(1<<n);++i)
    {
        int c=pop[i];
        for(int j=i;j;j=(j-1)&i)
        {
            if(pop[j]*(pop[j]-1)/2==cnt[j]) f[i]=min(f[i],f[i^j]+1);
        }
    }
    cout<<f[(1<<n)-1]<<'\n';
    return 0;
}

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

template <class A, class B> bool cmin(A& a, B b) { return a > b && (a = b, true); }
template <class A, class B> bool cmax(A& a, B b) { return a < b && (a = b, true); }

class ChromaticrNumber {
public:
  int V;
  vector<int> adj;
  const static int MOD = 1000000007;
  ChromaticrNumber(int node_size) : V(node_size), adj(V, 0) {
    for (int i = 0; i < V; i++) {
      adj.at(i) = (1 << i);
    }
  }
  void add(int u, int v) {
    adj.at(u) |= (1 << v), adj.at(v) |= (1 << u);
  }
  int solve() {
    vector<int> t(1 << V, 0), I(1 << V, 0);
    t.at((1 << V) - 1) = I.at(0) = 1;
    for (int i = 1; i < (1 << V); i++) {
      int v = __builtin_ctz(i);
      I.at(i) = I.at(i ^ (1 << v)) + I.at(i & (~adj.at(v)));
      I.at(i) = (I.at(i) >= MOD) ? (I.at(i) - MOD) : I.at(i);
      t.at(i - 1) = (((V - __builtin_popcount(i - 1)) % 2) ? (MOD - 1) : 1);
    }
    for (int k = 1; k < V; k++) {
      long res = 0;
      for (int i = 0; i < (1 << V); i++) {
        res += (t.at(i) = (long) t.at(i) * I.at(i) % MOD);
      }
      if (res % MOD) return k;
    }
    return V;
  }
};

signed main() {
  cin.tie(nullptr)->sync_with_stdio(false);

  int N, M;
  cin >> N >> M;
  vector<pair<int, int>> V(M);
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b, a--, b--;
    if (a > b) swap(a, b);
    V.at(i) = {a, b};
  }

  set<pair<int, int>> SE;
  for (const auto& [a, b] : V) SE.insert({a, b});

  ChromaticrNumber CN(N);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < i; j++) {
      if (SE.count({j, i})) continue;
      CN.add(j, i);
    }
  }
  cout << CN.solve() << '\n';
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
	cin>>n;
    vector<double> a(n),b(n),c(n),d(n);
    for(int _=0; _<2; _++){
        for(int i=0;i<n;i++) cin>>a[i]>>b[i];
        int x=0,y=0;
        for(int i=0;i<n;i++){
            x+=a[i];
            y+=b[i];
            a[i]*=n;
            b[i]*=n;
        }
        for(int i=0;i<n;i++){
            a[i]-=x;
            b[i]-=y;
        }
        swap(a,c);
        swap(b,d);
    }
    for(int i=0;i<n;i++){
        if(a[i]!=0||b[i]!=0){
            swap(a[i],a[0]);
            swap(b[i],b[0]);
        }
    }
    string ans="No";
    const double eps=1e-6;
    for(int i=0;i<n;i++){
        double angle=atan2(d[i],c[i])-atan2(b[0],a[0]);
        bool flag=true;
        for(int j=0;j<n;j++){
            double A=a[j]*cos(angle)-b[j]*sin(angle);
            double B=a[j]*sin(angle)+b[j]*cos(angle);
            bool flag2=false;
            for(int k=0;k<n;k++){
                if(abs(A-c[k])<=eps&&abs(B-d[k])<=eps) flag2=true;
            }
            flag&=flag2;
        }
        if(flag) ans="Yes";
    }
    cout<<ans;
}

#include<bits/stdc++.h>
#define Woody
#define int long long
#define rep(n) for(int i=0;i<n;i++)
#define mp make_pair
#define eb emplace_back
#define F first
#define S second
#ifdef Woody
#define quick ios::sync_with_stdio(0);cin.tie(0);
#else
#define quick
#endif
#define INF INT64_MAX
#define PI 3.14159265
using namespace std;
const double eps=1e-3;
typedef pair<double,double> p;
bool ok(int n,vector<p> v1,vector<p> v2){
//	cout<<"OK\n";

	sort(v2.begin(),v2.end());
/*	rep(n){
		printf("%.5lf %.5lf\n",v1[i].F,v1[i].S);
	}//cout<<"\n";
	rep(n){
		printf("%.5lf %.5lf\n",v2[i].F,v2[i].S);
	}cout<<"\n";*/
	double disx=v1[0].F-v2[0].F;
	double disy=v1[0].S-v2[0].S;
	for(int i=1;i<n;i++){
		double dx=v1[i].F-v2[i].F;
		double dy=v1[i].S-v2[i].S;
		if(abs(disx-dx)>eps||abs(disy-dy)>eps) return false;
	}

	return true;
}
bool solve(){
	int n;
	cin>>n;
	vector<p> v1(n);
	vector<p> v2(n);
	rep(n){
		cin>>v2[i].F>>v2[i].S;
	}
	rep(n){
		cin>>v1[i].F>>v1[i].S;
	}
	sort(v1.begin(),v1.end());
	vector<p> v3(n);
	for(double d=0;d<=360;d+=0.0005){
		double s=sin(d*PI/180.0);
		double c=cos(d*PI/180.0);
		rep(n){
			double x=v2[i].F;
			double y=v2[i].S;
			v3[i].F=x*c+y*(-1)*s;
			v3[i].S=x*s+y*c;
		}
		if(ok(n,v1,v3)) return true;
	}
	return false;
}
signed main(){
	quick
	bool f=solve();
	if(f) cout<<"Yes\n";
	else cout<<"No\n";

}


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

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

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

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

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

int main()
{
    ll N;
    INX(N);
    ll N2 = (1 << N) - 1;

    vll chk(51, 51);
    for (ll i = 0; i <= 50; i++)
    {
        chk[i] = i;
    }
    for (ll i = 2; i <= 50; i++)
    {
        ll i2 = i;
        while(i2 <= 50)
        {
            chk[i2] = min(chk[i2], i);
            i2 += i;
        }
    }

    vll fact;
    for (ll i = 2; i <= 50; i++)
    {
        if(chk[i] == i) fact.ADD(i);
    }

    vll X(N);
    for (ll i = 0, ibit = 1; i < N; i++, ibit <<= 1)
    {
        INX(X[i]);
    }

    ll result = __LONG_LONG_MAX__;
    for (ll i = 1, endi = 1 << fact.size(); i < endi; i++)
    {
        ll candi = 1;
        for(ll j = 0, j2 = i; j2 > 0; j++, j2 >>= 1)
        {
            if(j2 & 1) candi *= fact[j];
        }

        bool isok = true;
        for (ll j = 0; j < N; j++)
        {
            if(gcd(X[j], candi) == 1)
            {
                isok = false;
                break;
            }
        }

        if(isok)
        {
            result = min(result, candi);
        }
    }
    OUTX(result);

    return 0;
}

#include<bits/stdc++.h>
#define fi first
#define se second
#define pii pair<double,double>
#define eps 1e-8
#define equals(a,b) fabs(a - b) < eps
using namespace std;

typedef long long ll;

ll rd(){
	ll x;
	scanf("%lld",&x);
	return x;
}

double dis(pii a,pii b){
	return sqrt((a.fi - b.fi) * (a.fi - b.fi) + (a.se - b.se) * (a.se - b.se));
}

pii c1,c2;

bool cmp1(pii a,pii b){
	return atan2(a.se - c1.se,a.fi - c1.fi) < atan2(b.se - c1.se,b.fi - c1.fi);
}

bool cmp2(pii a,pii b){
	return atan2(a.se - c2.se,a.fi - c2.fi) < atan2(b.se - c2.se,b.fi - c2.fi);
}

double cross(pii a,pii b){
	return a.fi * b.se - a.se * b.fi;
}

double dot(pii a,pii b){
	return a.fi * b.fi + a.se * b.se;
}

pii operator - (const pii &a,const pii &b){
	return make_pair(a.fi - b.fi,a.se - b.se);
}

int main(){
	int n = rd();
	double mi1 = 1e9;
	double mx1 = 0;
	double mi2 = 1e9;
	double mx2 = 0;
	vector<pii> p1,p2;
	vector<double> dis1,dis2;
	for(int i = 1;i <= n;i++){
		int a = rd();
		int b = rd();
		c1.fi += a;
		c1.se += b;
		p1.push_back(make_pair(a,b));
	}
	c1.fi /= n;
	c1.se /= n;
	if(n == 1) {
		puts("Yes");
		return 0;
	}
	for(int i = 1;i <= n;i++){
		int a = rd();
		int b = rd();
		c2.fi += a;
		c2.se += b;
		p2.push_back(make_pair(a,b));
	}
	c2.fi /= n;
	c2.se /= n;

	for(int i = 0;i < n;i++){
		p1[i].fi -= c1.fi;
		p1[i].se -= c1.se;
		p2[i].fi -= c2.fi;
		p2[i].se -= c2.se;
	}

	for(int i = 0;i < n;i++){
		if(p1[i].fi || p1[i].se) {
			swap(p1[0].fi,p1[i].fi);
			swap(p1[0].se,p1[i].se);
		}
	}

	bool flag = false;
	for(int i = 0;i < 1;i++){
		for(int j = 0;j < n;j++){
			double ang = atan2(p1[i].se,p1[i].fi) - atan2(p2[j].se,p2[j].fi);
			int cnt = 0;
			for(int k = 0;k < n;k++){
				bool f = 0;
				for(int kk = 0;kk < n;kk++){
					double x = cos(ang) * p2[kk].fi - sin(ang) * p2[kk].se;
					double y = sin(ang) * p2[kk].fi + cos(ang) * p2[kk].se;
					f |= (equals(x,p1[k].fi) && equals(y,p1[k].se));
				}
				if(!f) break;
				else cnt++;
			}
			flag |= (cnt == n);
		}
	}
	if(flag) puts("Yes");
	else puts("No");
}


#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define sz 209
#define mx 10000000000008
#define mod 998244353
ll n,t,arr[sz][sz],brr[sz],crr[sz],a,k;
vector<ll>v[sz];
void bfs(ll node)
{
    a++;
    crr[node]=1;
    for(int i=0;i<v[node].size();i++)
    {
        ll x=v[node][i];
        if(!crr[x])
            bfs(x);
    }
    return;
}
int main()
{
    scanf("%lld %lld",&n,&k);
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
            scanf("%lld",&arr[i][j]);
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            ll cnt=0;
            for(int x=1;x<=n;x++)
            {
                if(arr[i][x]+arr[j][x]>k)
                    cnt++;
            }
            if(!cnt){
                v[i].push_back(j);
            v[j].push_back(i);
            //printf("%d %d\n",i,j);
            }
        }
    }
     for(int i=1;i<=n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            ll cnt=0;
            for(int x=1;x<=n;x++)
            {
                if(arr[x][i]+arr[x][j]>k)
                    cnt++;
            }
            if(!cnt){
                v[i+n].push_back(j+n);
            v[j+n].push_back(i+n);
           // printf("%d %d\n",i,j);
            }
        }
    }
    brr[0]=1;
    for(int i=1;i<=2*n;i++)
        brr[i]=(brr[i-1]*i)%mod;
    ll ans=1;
    for(int i=1;i<=2*n;i++)
    {
        if(!crr[i])
        {
            a=0;
            bfs(i);
            ans=((ans*(brr[a]))%mod);
        }
    }
    printf("%lld\n",ans);
  return 0;
}

//LYC_music yyds!
#include<bits/stdc++.h>
#define int long long
using namespace std;
int read()
{
	int pos=1,num=0;
	char ch=getchar();
	while (!isdigit(ch))
	{
		if (ch=='-') pos=-1;
		ch=getchar();
	}
	while (isdigit(ch))
	{
		num=num*10+(int)(ch-'0');
		ch=getchar();
	}
	return pos*num;
}
void write(int x)
{
	if (x<0)
	{
		putchar('-');
		write(-x);
		return;
	}
	if (x>=10) write(x/10);
	putchar(x%10+'0');
}
void writesp(int x)
{
	write(x);
	putchar(' ');
}
void writeln(int x)
{
	write(x);
	putchar('\n');
}
const int N=3e5+1;
int n,fa[N],a[N],ans;
int find(int x)
{
	if (fa[x]==x) return x;
	return fa[x]=find(fa[x]);
}
signed main()
{
	n=read();
	for (int i=1;i<N;i++)
		fa[i]=i;
	for (int i=1;i<=n;i++)
		a[i]=read();
	for (int i=1;i<n-i+1;i++)
	{
		int x=a[i],y=a[n-i+1];
		if (find(x)!=find(y))
		{
			ans++;
			fa[fa[x]]=fa[y];
		}
	}
	writeln(ans);
}


#include<iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<cmath>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include <bitset>
#include<cstring>

#define forn(i,a,n) for(int i=(a);i<(n);i++)
#define ford(i,a,d) for(int i=(a);i>(d);i--)
#define pb push_back

using namespace std;
const long long N=2e5+6;
const long long inf=0x3f3f3f3f;
typedef long long ll;

int a[N];
vector<int> adj[N];

int main()
{
//    ios::sync_with_stdio(false);
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);

    int n,m;
    cin>>n>>m;
    forn(i,1,n+1) cin>>a[i];
    forn(i,0,m)
    {
        int x,y;
        cin>>x>>y;
        adj[x].pb(y);
    }

    vector<int> dp(n+1,2e9);
    int ans=-2e9;
    forn(i,1,n+1)
    {
        ans=max(ans,a[i]-dp[i]);
        for(auto j:adj[i])
        {
            dp[j]=min(dp[j],dp[i]);
            dp[j]=min(dp[j],a[i]);
        }
    }
    cout<<ans;
    return 0;

}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (ll i=(ll)from; i<(ll)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (ll i=(ll)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const ll INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(ll x=pow(10,7)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { ll d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll modpow(ll x, ll p) { ll result = 1, now = 1, pm = x; while (now<=p) { if (p&now) { result = result * pm % MOD; } now*=2; pm = pm*pm % MOD; } return result; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

vector<vector<ll>> matsum(vector<vector<ll>> A, vector<vector<ll>> B) {
  if (A.size()!=B.size()||A[0].size()!=B[0].size()) return {{}};
  ll h = A.size(), w = A[0].size();
  vector<vector<ll>> result(h,vector<ll>(w,0));
  rep(i,h) rep(j,w) result[i][j] = (A[i][j]+B[i][j])%MOD;
  return result;
}

vector<vector<ll>> matdiff(vector<vector<ll>> A, vector<vector<ll>> B) {
  if (A.size()!=B.size()||A[0].size()!=B[0].size()) return {{}};
  ll h = A.size(), w = A[0].size();
  vector<vector<ll>> result(h,vector<ll>(w,0));
  rep(i,h) rep(j,w) result[i][j] = (MOD+(A[i][j]-B[i][j])%MOD)%MOD;
  return result;
}

vector<vector<ll>> matdot(vector<vector<ll>> A, vector<vector<ll>> B) {
  if (A[0].size()!=B.size()) return {{}};
  ll h = A.size(), w = B[0].size(), x = A[0].size();
  vector<vector<ll>> result(h,vector<ll>(w,0));
  rep(i,h) rep(j,w) rep(k,x) result[i][j] = (result[i][j] + A[i][k]*B[k][j]);
  return result;
}

vector<vector<ll>> matpow(vector<vector<ll>> A, ll n) {
  if (A.size()!=A[0].size()) return {{}};
  int N = A.size();
  vector<vector<ll>> result(N,vector<ll>(N,0)), now;
  copy(all(A),back_inserter(now));
  rep(i,N) result[i][i] = 1;
  ll p2 = 1;
  while (n>=p2) {
    if (n&p2) result = matdot(result,now);
    now = matdot(now,now); p2 *= 2;
  }
  return result;
}

// ----------------------------------------------------------------------
// ----------------------------------------------------------------------

int main() {
  ll N; cin >> N;
  ll X[N], Y[N]; rep(i,N) cin >> X[i] >> Y[i];
  ll M; cin >> M;
  ll op[M][2] = {}; rep(i,M) { cin >> op[i][0]; if (op[i][0]>=3) cin >> op[i][1]; }
  ll Q; cin >> Q;
  ll A[Q], B[Q]; rep(i,Q) { cin >> A[i] >> B[i]; B[i]--; }

  vector<vector<ll>> ope = { {1,0,0}, {0,1,0}, {0,0,1} };
  vector<vector<vector<ll>>> opmat(M+1); opmat[0] = ope;
  rep(i,M) {
    vector<vector<ll>> mulmat;
    if (op[i][0]==1) {
      mulmat = {
        {0,1,0},
        {-1,0,0},
        {0,0,1}
      };
    }
    else if (op[i][0]==2) {
      mulmat = {
        {0,-1,0},
        {1,0,0},
        {0,0,1}
      };
    }
    else if (op[i][0]==3) {
      mulmat = {
        {-1,0,2*op[i][1]},
        {0,1,0},
        {0,0,1}
      };
    }
    else if (op[i][0]==4) {
      mulmat = {
        {1,0,0},
        {0,-1,2*op[i][1]},
        {0,0,1}
      };
    }
    opmat[i+1] = matdot(mulmat,opmat[i]);
  }

  // rep(i,M+1) {
  //   for (auto x: opmat[i]) debug(all(x));
  //   cout << endl;
  // }

  rep(i,Q) {
    vector<vector<ll>> resmat = matdot(opmat[A[i]],{{X[B[i]]},{Y[B[i]]},{1}});
    cout << resmat[0][0] << " " << resmat[1][0] << endl;
  }
  return 0;
}


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

#define MAX( a , b )    ( a > b ) ? a : b
#define MIN( a , b )    ( a < b ) ? a : b

using ull = unsigned long long;
using ll = long long;
using ul = unsigned long;

ull Euclidean(ull a, ull b){
    if((a % b) == 0)
        return b;
    else
        return Euclidean(b , (a % b));
}

int main(){
    ull N;
    ull result = 1;
    ull sub[15] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47};
    bool count[15] = {false};
    ull c;
    ull z;
    bool r = false;

    cin >> N;
    vector<ull> x(N,0);
    for (ull i = 0; i < N; i++)
        cin >> x[i];

    for (ull j = 0; j < 15; j++){
        result *= sub[j];
    }

    for (ull i = 0; i < 32768; i++){
        z = i;
        c = 1;
        r = true;
        for (ull j = 0; j < 15; j++){
            if((z % 2) == 1)
                c *= sub[j];
            z /= 2;
        }
        for(ull k = 0; k < N; k++){
            if((Euclidean(MAX(c , x[k]) , MIN(c , x[k]))) == 1){
                r = false;
                break;
            }
        }
        if(r)
            result = MIN(result , c);
    }

    cout << result << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &x){
	x = 0; int f = 1; char ch = getchar();
	while (!isdigit(ch)) {if (ch == '-') f = -1; ch = getchar();}
	while (isdigit(ch)) {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}
inline void write(int x){if (x > 9) write(x/10); putchar(x%10+'0'); }

const int P = 998244353;
int n,a[105];

inline void upd(int &x,int v){ x = (x+v>=P)?(x+v-P):(x+v); }

int f[105][10005];
int s,fac[105],l;

inline void add(int n,int x){
	register int i,j,v;
	for (i = n; i ; --i) for (j = x; j <= s; ++j) upd(f[i][j],f[i-1][j-x]);
}

int main(){
	int i;
	cin >> n;
	for (fac[0] = i = 1; i <= 100; ++i) fac[i] = fac[i-1] * 1ll * i % P;
	for (i = 1; i <= n; ++i) cin >> a[i],s += a[i]; l = s/2;
	if (s % 2 == 1){ cout << 0 << '\n'; return 0; }
	f[0][0] = 1;
	for (i = 1; i <= n; ++i) add(i,a[i]);
	long long ans = 0;
	for (i = 0; i <= n; ++i){
		if (f[i][s / 2])
			ans = (ans + 1ll * f[i][s/2] * fac[i] % P * fac[n-i] % P) % P;
	}
	cout << ans << '\n';
	return 0;
}


#include<cstdio>
#include<vector>
#include<algorithm>
typedef long long ll;
ll m,a[45];
std::vector<ll> f,g;
inline ll read() {
	ll x=0,f=1;register char s=getchar();
	while(s>'9'||s<'0') {if(s=='-') f=-1;s=getchar();}
	while(s>='0'&&s<='9') {x=x*10+s-'0';s=getchar();}
	return x*f;
}
inline ll max(const ll &x,const ll &y) {return x>y? x:y;}
void dfs(int L,int R,ll sum,std::vector<ll> &x) {
	if(R==L) {x.push_back(sum);return;}
	dfs(L+1,R,sum,x);
	if(sum+a[L+1]<=m) dfs(L+1,R,sum+a[L+1],x);
}
int main() {
	int n=read(),mid=n>>1;
	ll res=0;m=read();
	for(register int i=1;i<=n;++i) a[i]=read();
	dfs(0,mid,0,f);dfs(mid,n,0,g);
	std::sort(f.begin(),f.end());
	std::sort(g.begin(),g.end());
	for(register int i=0;i<f.size();++i) {
		int pos=std::upper_bound(g.begin(),g.end(),m-f[i])-g.begin()-1;
		if(pos<0||g[pos]+f[i]>m) continue;
		res=max(res,f[i]+g[pos]);
	}//res+=std::upper_bound(g.begin(),g.end(),m-f[i])-g.begin();
	printf("%lld\n",res);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	string X;
	ll M;
	cin >> X >> M;
	int n = X.size();
	vector<ll> b(n);
	ll m = 0;
	for (int i = 0; i < n; i++) {
		b[i] = X[i] - '0';
		m = max(m, b[i]);
	}
	auto test = [&](ll N, ll k) {     //转 k 进制
		vector<ll> a(0);
		while (N > 0) {
			a.push_back((N % k));
			N /= k;
		}
		reverse(a.begin(), a.end());  //正过来
		if (a.size() < X.size())
			return false;
		else if (a.size() > X.size())
			return true;
		else {
			int i = 0;
			while (i<n&& a[i] == b[i]) {
				++i;
			}
			if (i == n)
				return true;
			else if (a[i] < b[i])
				return false;
			else
				return true;
		}
	};
	if (n == 1)
		cout << (b[0] <= M) ? '1': '0' ;
	else if (!(test(M, m + 1)))
		cout << 0 << endl;
	else {
		ll ok = m + 1;
		ll ng = M + 1;
		ll mid;
		while (ng - ok > 1) {
			mid = (ok + ng) / 2;
			if (test(M, mid))
				ok = mid;
			else
				ng = mid;
		}
		cout << ok - m << endl;
		return 0;
	}
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;

inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
ll dp[18][(1<<18)];
void solve()
{
  ll n;
  cin>>n;
  ar<ll,3>node[n+1];
  for(int i=0;i<n;i++)
  {
    cin>>node[i][0]>>node[i][1]>>node[i][2];
  }
  ll dis[n+1][n+1];
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
    {
          dis[i][j]=abs(node[i][0]-node[j][0])+abs(node[i][1]-node[j][1])+max(0LL,(node[j][2]-node[i][2]));
    }
  }
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<(1<<n);j++)
    {
       dp[i][j]=(ll)(1e18);
    }
  }
  dp[0][1]=0;
  for(int j=0;j<(1<<n);j++)
  {

     for(int i=0;i<(n);i++)
     {
       if(dp[i][j]==(ll)(1e18))
        continue;
      for(int k=0;k<n;k++)
      {
           if((j>>k)&1)
            continue;
          int x=(j|(1<<k));
          dp[k][x]=min(dp[k][x],dp[i][j]+dis[i][k]);
      }
     }
  }
  ll cost=LLONG_MAX;
  for(int i=1;i<n;i++)
  {
    cost=min(cost,dp[i][(1<<n)-1]+dis[i][0]);
  }
  cout<<cost<<endl;

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

}

#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

inline s64 dis(s64 x, s64 y, s64 z, s64 p, s64 q, s64 r)
{
    return abs(x - p) + abs(y - q) + max(s64(0), r - z);
}

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

    int n;
    cin >> n;

    vector<vs64> g(n, vs64(n));
    vs32 x(n), y(n), z(n);
    rep (i, n)
    {
        cin >> x[i] >> y[i] >> z[i];
    }

    rep (i, n) for (int j = i + 1; j < n; ++j)
    {
        s64 d1 = dis(x[i], y[i], z[i], x[j], y[j], z[j]);
        s64 d2 = dis(x[j], y[j], z[j], x[i], y[i], z[i]);
        g[i][j] = d1;
        g[j][i] = d2;
    }

    const s64 inf = 1e18;
    vector< vs64 > dp(1 << n, vs64(n, inf));

    dp[(1 << n) - 1][0] = 0;
    for (int s = (1 << n) - 2; s >= 0; --s)
    {
        rep (v, n)
        {
            rep (u, n)
            {
                if (!(s >> u & 1))
                {
                    dp[s][v] = min(dp[s][v], dp[s | (1 << u)][u] + g[u][v]);
                }
            }
        }
    }

    cout << dp[0][0] << "\n";
    return 0;
}


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

int pr[100009], sz[100009], d[100009];
vector<int> ch[100009];

void dfs(int n)
{
	vector<int> v;
	int s = 0;
	sz[n] = 1; d[n] = 1;
	for (int i = 0; i < ch[n].size(); i++) {
		int tn = ch[n][i];
		dfs(tn);
		sz[n] += sz[tn];
		d[n] += sz[tn] - d[tn];
		int t = 2 * d[tn] - sz[tn];
		if (sz[tn] & 1) v.push_back(t);
		else if (t < 0) d[n] += t;
		else s += t;
	}
	if (v.size() % 2 == 0) d[n] += s;
	sort(v.begin(), v.end());
	for (int i = 0; i < v.size(); i += 2)
		d[n] += v[i];
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n; cin >> n;
	for (int i = 2; i <= n; i++) {
		cin >> pr[i];
		ch[pr[i]].push_back(i);
	}
	dfs(1);
	cout << d[1] << '\n';
	return 0;
}

#include <bits/stdc++.h>

#define SIS std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define lowbit(x) (x & -x)
#define FOR(i,a,b)  for(int i=(a); i< (b); ++i)
#define RFOR(i,b,a) for(int i=(b);i>=(a);i--)
#define REP(i,a,b)  for(int i=(a); i<=(b); ++i)
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
template<typename T>
void PrArr(const T a[] , int len){
	for(int i = 0;i <= len; i++)cout << a[i] << " ";
	cout << endl;
}
template<typename T>
void PrVec(const vector<T> a){
	for(auto it : a)cout << it << " ";
	cout << endl;
}
const int MAX = 0x7ffffff;
const int MIN = 0xcf;
int test;
void slove()
{
	ll n, x = 1, t, len = 0;
	cin >> n;
	t = n;
	while(t >= 10){
		t /= 10;x *= 10;len ++;
	} len ++;
	ll ans = (n - x + 1) * ((len / 3) - (len % 3 == 0));

	t = 0, n = 1, len = 0;
	while(t <= x)
	{
		t = t * 10 + 9;
		len ++;
		if(t > x)break;
		ans += (t - n + 1)* ((len / 3) - (len % 3 == 0));
		//cout << t  << " " << n << " " << len << endl;
		n = n * 10;
	}

	cout << ans << endl;
}
int main()
{
#ifdef LOCAL
	auto start_time = clock();
	cerr << setprecision(3) << fixed; // 在iomanip中
#endif
	SIS;slove();
#ifdef LOCAL
	auto end_time = clock();
	cerr << "Execution time: " << (end_time - start_time) * (int)1e3 / CLOCKS_PER_SEC << " ms\n";
#endif
}


#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;
/*

*/
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  ll N, K;
  cin >> N >> K;
  ll ans = 0;
  for(ll i=1; i<=N; i++){
    for(ll k=1; k<=K; k++){
      ll tmp = 100*i + k;
      ans += tmp;
    }
  }
  cout << ans << endl;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#define re
#define X first
#define Y second
#define mp std::make_pair
#define pb push_back
#define ohh(hhh...) fprintf(stderr,hhh)
typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int,int> pii;
template<class T1> inline bool cmax(T1 &x,T1 y) {return x<y?(x=y,1):0;}
template<class T1> inline bool cmin(T1 &x,T1 y) {return x>y?(x=y,1):0;}
int read()
{
	int x=0,w=0;
	char ch=0;
	while(ch<'0'||ch>'9') w|=ch=='-',ch=getchar();
	while('0'<=ch&&ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
}
int main()
{
	re int n=read(),res=0;
	re int i=1;
	for(;res<n;i++) res+=i;
	printf("%d\n",i-1);
	return 0;
}


#include<bits/stdc++.h>
#define N 100005
#define Ms(a,b) memset(a,b,sizeof a)
#define db(x) cerr<<#x<<"="<<x<<endl;
#define db2(x,y) cerr<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define db3(x,y,z) cerr<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
using namespace std;
int rd(){
    int res=0,c,f=0;
    while(!isdigit(c=getchar()))f=c=='-';
    do res=(res<<1)+(res<<3)+(c^48);
    while(isdigit(c=getchar()));
    return f?-res:res;
}
int n;
int main(){
    n=rd();
    for(int i=1;i<=n;i++){
        int t=0,x=i;
        for(int j=2;1ll*j*j<=x;j++)while(x%j==0)x/=j,++t;
        if(x!=1)++t;
        printf("%d%c",t+1," \n"[i==n]);
    }
    return 0;
}

#include "iostream"
#include "algorithm"
#include "cstring"
#include "cstdio"
#include "cmath"
#include "vector"
#include "map"
#include "set"
#include "queue"
using namespace std;
#define MAXN 600006
//#define int long long
#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define all(x) (x).begin() , (x).end()
#define mem( a ) memset( a , 0 , sizeof a )
typedef long long ll;
int n , m;
char aa , ab , ba , bb;
const int P = 1e9 + 7;
void solve() {
	cin >> n;
	if( n <= 2 ) { puts("1"); return; }
	char ch[4];
	scanf("%s",ch); aa = ch[0];
	scanf("%s",ch); ab = ch[0];
	scanf("%s",ch); ba = ch[0];
	scanf("%s",ch); bb = ch[0];
	static int p2[MAXN] , F[MAXN];
	p2[0] = 1;
	rep( i , 1 , n ) p2[i] = p2[i - 1] * 2 % P;
	F[0] = F[1] = 1;
	rep( i , 2 , n ) F[i] = ( F[i - 1] + F[i - 2] ) % P;
	if( ab == 'B' ) {
		if( bb == 'B' ) return void( puts("1") );
		if( ba == 'A' ) return void( cout << p2[n - 3] << endl );
		cout << F[n - 2] << endl;
	} else {
		if( aa == 'A' ) return void( puts("1") );
		if( ba == 'B' ) return void( cout << p2[n - 3] << endl );
		cout << F[n - 2] << endl;
	}
}

signed main() {
//	freopen("5.in","r",stdin);
//	int T;cin >> T;while( T-- ) solve();
	solve();
}


//include <atcoder>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <tuple>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#define flush fflush(stdout)
#define endl '\n'
#define all(v) v.begin(), v.end()
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pl;
const int mod1 = (int)1e9 + 7, mod2 = (int)998244353;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
const int di[8] = {1, 0, -1, 0, 1, 1, -1, -1}, dj[8] = {0, 1, 0, -1, -1, 1, -1, 1};

#define rep0(i, n) for (i = 0; i < n; i++)
#define rep1(i, a, b) for (i = a; i < b; i++)

template <typename T>
T my_abs(T x){
    return (x >= 0)? x : -x;
}

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

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

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

// --------------------------------------------------------------------------------

int main(void){
    int i, j;
    ll n;

    cin >> n;

    ll ans;
    ll a, b, c;
    ans = LINF;
    rep0(b, 64){
        a = (n>>b);
        c = n - (a<<b);
        chmin(ans, a + b + c);
    }

    cout << ans << endl;

    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
const ll mod = 1e9+7;
const int N = 1e5+5;

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

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

//My tools
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,s,e)  for(int i=s;i<e;i++)
#define all(v)  (v).begin(),(v).end()

void solve(){
    int n;cin>>n;
    int a[n];
    rep(i,0,n){
        cin>>a[i];
    }
    sort(a,a+n);

    rep(i,1,n+1){
        if(a[i-1]!=i) {
            cout<<"No\n";
            return;
        }
    }
    cout<<"Yes\n";
}

signed main(){
    fastio;
    int t=1;
    //cin>>t;
    rep(i,1,t+1){
        solve();
    }
    return 0;
}

/*
1
0
*/


//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

const ll MOD = 1000000007;
const ll MAX = 2000001;

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

void nCrprep() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll nCr(ll n, ll r){
    if (n < r) return 0;
    if (n < 0 || r < 0) return 0;
    return fac[n] * (finv[r] * finv[n - r] % MOD) % MOD;
}

ll mod(ll a){
  return a % MOD;
}

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

vector<pair<ll,ll>> prime_factorize(ll n){
  vector<pair<ll,ll>> res;

  for(ll i=2; i*i <= n; i++){
    if(n % i != 0) continue;

    ll ex = 0;
    while(n % i == 0){
      ex++;
      n /= i;
    }

    res.push_back({i,ex});
  }

  if(n != 1) res.push_back({n,1});

  return res;

}

int main(){
  ll h,w; cin >> h >> w;

  vector<vector<char>> table(h,vector<char>(w));

  rep(i,h){
    rep(j,w) cin >> table[i][j];
  }

  vvl cnttable(h,vl(w));
  vvl hsum(h,vl(w));
  vvl wsum(h,vl(w));
  vvl dsum(h,vl(w));

  ll now = 2;

  rep(i,w){
    if(table[0][i] == '.'){
      if(i == 0 or i == 1){
        cnttable[0][i] = 1;
        hsum[0][i] = 1;
        dsum[0][i] = 1;
      }
      else{
        cnttable[0][i] = now;
        hsum[0][i] = now;
        dsum[0][i] = now;
        now *= 2;
        now = mod(now);
      }
    }
    else break;
  }

  now = 2;

  rep(j,h){
    if(table[j][0] == '.'){
      if(j == 0 or j == 1){
        cnttable[j][0] = 1;
        wsum[j][0] = 1;
        dsum[j][0] = 1;
      }
      else{
        cnttable[j][0] = now;
        wsum[j][0] = now;
        dsum[j][0] = now;
        now *= 2;
        now = mod(now);
      }
    }
    else break;
  }

  for(ll i=1; i < h; i++){
    for(ll j=1; j < w; j++){
      if(table[i][j] == '#') continue;

      cnttable[i][j] = hsum[i-1][j] + dsum[i-1][j-1] + wsum[i][j-1];
      cnttable[i][j] = mod(cnttable[i][j]);

      hsum[i][j] = hsum[i-1][j] + cnttable[i][j];
      wsum[i][j] = wsum[i][j-1] + cnttable[i][j];
      dsum[i][j] = dsum[i-1][j-1] + cnttable[i][j];

      hsum[i][j] = mod(hsum[i][j]); wsum[i][j] = mod(wsum[i][j]);
      dsum[i][j] = mod(dsum[i][j]);

      /*if(i == 2 and j == 1){
        cout << hsum[i-1][j] << dsum[i-1][j-1] << wsum[i][j-1] << hsum[i-1][j] + dsum[i-1][j-1] + wsum[i][w-1] << endl;
      }*/
    }
  }

  /*for(auto array : cnttable){
    for(ll x : array) cout << x;
    cout << endl;
  }

  cout << endl;

  for(auto array : hsum){
    for(ll x : array) cout << x;
    cout << endl;
  }

  cout << endl;

  for(auto array : wsum){
    for(ll x : array) cout << x;
    cout << endl;
  }

  cout << endl;

  for(auto array : dsum){
    for(ll x : array) cout << x;
    cout << endl;
  }*/

  cout << cnttable[h-1][w-1] << endl;

}

#include <bits/stdc++.h>

using namespace std;
#define ll int64_t

void solve()
{

    int n, m;
    cin >> n >> m;
    vector<int> f(n);
    for (int i = 0; i < m; i++)
    {
        int u, v;
        cin >> u >> v;
        v--, u--;
        f[v] |= (1 << u);
        f[u] |= (1 << v);
    }
    for (int i = 0; i < n; i++)
        f[i] |= (1 << i);
    int st = 1 << n;
    vector<int> flag(1 << n);
    for (int i = 0; i < st; i++)
    {
        int o = 0;
        vector<int> tmp;
        for (int j = 0; j < n; j++)
        {
            if ((i >> j) & 1)
                o |= (1 << j), tmp.push_back(j);
        }
        int ok = 1;
        for (int j : tmp)
        {
            if ((f[j] & o) != o)
                ok = 0;
        }
        if (ok)
        {
             flag[i] = 1;

        }

    }
    vector<int> dp((1<<n), n);
    dp[0] = 0;
    for (int i = 1; i < st; i++)
    {
        for (int j = i; j; j = (j - 1) & i)
        {
            if (flag[j])
            {
                dp[i] = min(dp[j^i] + 1, dp[i]);
            }
        }

    }
    cout << dp.back() << endl;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T = 1;

    while (T--)
    {
        solve();
    }
}


  #include <bits/stdc++.h>
  #define ll long long int
  #define ull unsigned long long int
  #define eb emplace_back
  #define mk make_pair
  using namespace std;
  void vec(vector<int> & v){

      for(int i = 0;i<v.size() ; i++){
          cout<<v[i]<< " ";
      }
      cout<<endl;
  }
  void vec_ll(vector<long long int> & v){

      for(int i = 0;i<v.size() ; i++){
          cout<<v[i]<< " ";
      }
      cout<<endl;
  }
  void vec_ull(vector<ull> & v){

      for(int i = 0;i<v.size() ; i++){
          cout<<v[i]<< " ";
      }
      cout<<endl;
  }
  int parsestring(string temp){
      int num= 0;
      int digs = temp.size() - 1;
      for(int i = 0 ;i<=digs;i++){
          num += pow(10 , digs -i)*(temp[i] - '0');
      }
      return num;
  }

  int main(){
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
      cout.tie(NULL);
      ll n,k;
      cin>>n>>k;
      bool poss =true;
      ll cur_pos = 0;
      vector<pair<ll ,ll >>v;
      for(ll i = 0;i<n;i++){
          ll a ,b;
          cin>>a>>b;
          v.eb(mk(a,b));
      }
      sort(v.begin() , v.end());
      for(int i = 0;i<n;i++){
          if(!poss)break;
          if(k >= v[i].first - cur_pos){
              k -= (v[i].first-cur_pos);
              cur_pos = v[i].first;
              k += v[i].second;
          }
          else{
              cur_pos += k;
              k = 0;
              poss = false;
              break;}
      }
      if(k)cur_pos += k;

      cout<<cur_pos<<endl;
  }

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

#define int long long
#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

using ll = long long;
using ld = long double;
using intp = pair<int, int>;
using intmap = map<int, int>;
using intset = set<int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

constexpr int MOD = 998244353;
constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 62;
inline int mod(ll a, int m = MOD) { return (a % m + m) % m; }
inline bool bit(ll b, ll i) { return b & (1 << i); }
inline ll ceiv(ll a, ll b) { return (a + b - 1) / b; }
template<class T> bool chmin(T &a, T b) {if(a > b){a = b; return 1;} return 0;}
template<class T> bool chmax(T &a, T b) {if(a < b){a = b; return 1;} return 0;}

signed main() {
    int sx, sy, gx, gy;
    cin >> sx >> sy >> gx >> gy;
    ld ans;
    ans = -sy * (sx-gx);
    ans /= (sy + gy);
    ans += sx;
    printf("%.15Lf\n", ans);
}


#include <iomanip>
#include <iostream>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

const int64_t mod = 1e9 + 7;
unordered_map<int64_t, int64_t> memo;

int64_t mod_pow(int64_t x, int64_t n) {
  int64_t key = x * 1e6 + n;
  if (memo.count(key)) return memo[key];
  int64_t ret = 1;
  while (n) {
    if (n % 2) {
      ret = (ret * x) % mod;
    }
    x = x * x % mod;
    n /= 2;
  }
  return memo[key] = ret;
}
int main(void) {
  ios::sync_with_stdio(false);
  int H, W;
  cin >> H >> W;
  vector<string> S(H);
  int K = 0;
  rep(i, H) {
    cin >> S[i];
    rep(j, W) {
      if (S[i][j] == '.') K++;
    }
  }

  vector<vector<int>> left(H, vector<int>(W));
  rep(i, H) {
    left[i][0] = (S[i][0] == '.') ? 1 : 0;
    for (int j = 1; j < W; ++j) {
      if (S[i][j] == '#') {
        left[i][j] = 0;
      } else {
        left[i][j] = left[i][j - 1] + 1;
      }
    }
  }
  vector<vector<int>> right(H, vector<int>(W));
  rep(i, H) {
    right[i][W - 1] = (S[i][W - 1] == '.') ? 1 : 0;
    for (int j = W - 2; j >= 0; --j) {
      if (S[i][j] == '#') {
        right[i][j] = 0;
      } else {
        right[i][j] = right[i][j + 1] + 1;
      }
    }
  }
  vector<vector<int>> up(H, vector<int>(W));
  rep(j, W) {
    up[0][j] = (S[0][j] == '.') ? 1 : 0;
    for (int i = 1; i < H; ++i) {
      if (S[i][j] == '#') {
        up[i][j] = 0;
      } else {
        up[i][j] = up[i - 1][j] + 1;
      }
    }
  }
  vector<vector<int>> down(H, vector<int>(W));
  rep(j, W) {
    down[H - 1][j] = (S[H - 1][j] == '.') ? 1 : 0;
    for (int i = H - 2; i >= 0; --i) {
      if (S[i][j] == '#') {
        down[i][j] = 0;
      } else {
        down[i][j] = down[i + 1][j] + 1;
      }
    }
  }

  int64_t answer = 0;
  rep(i, H) {
    rep(j, W) {
      if (S[i][j] == '#') continue;
      int lamps = up[i][j] + down[i][j] + left[i][j] + right[i][j] + 1 - 4;
      // cout << "i=" << i << " j=" << j << " lamps=" << lamps << endl;
      // cout << "up=" << up[i][j] << " down=" << down[i][j]
      //     << " left=" << left[i][j] << " right= " << right[i][j] << endl;
      int64_t add = mod_pow(2, lamps);
      add = (add - 1 + mod) % mod;
      int64_t mult = mod_pow(2, K - lamps);
      add = (add * mult) % mod;
      // cout << add << endl;
      answer = (answer + add) % mod;
    }
  }
  cout << answer << endl;
  return 0;
}

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, k; cin >> n >> k;
  vector<vector<int>> G(n);
  rep(i, n-1) {
    int u, v; cin >> u >> v;
    u--; v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  auto test = [&](int x) {
    int need = 0;
    vector<int> dist(n);
    auto dfs = [&](auto dfs, int cur, int par) -> void {
      vector<int> tmp;
      for(int ne: G[cur]) {
        if(ne != par) {
          dfs(dfs, ne, cur);
          chmax(dist[cur], dist[ne]+1);
          tmp.push_back(dist[ne]+1);
        }
      }
      if(tmp.empty()) return;
      sort(all(tmp));
      int mn = *tmp.begin();
      int mx = *tmp.rbegin();
      if(mn + mx < 0) {
        chmin(dist[cur], mn);
        return;
      }
      if(cur == 0 || dist[cur] == x) {
        need++;
        dist[cur] = -x-1;
      }
    };
    dfs(dfs, 0, -1);
    return need <= k;
  };
  auto bsearch = [&]() {
    int ok = n-1, ng = 0;
    while(ok-ng>1) {
      int mid = (ok+ng)/2;
      (test(mid) ? ok : ng) = mid;
    }
    return ok;
  };
  cout << bsearch() << endk;
  return 0;
}


#include <bits/stdc++.h>
#define MOD 100000000
#define MAX 2005

using namespace std;

void test_case(){
    long long n, m;
    cin>>n>>m;
    vector<long long> arr(n);
    for(int i=0; i<n; i++)cin>>arr[i];
    sort(arr.begin(), arr.end());
//    for(auto i:arr)cout<<i<<' ';
//    cout<<endl;
    int q;
    cin>>q;
    vector<long long> acc(n);
    acc[0] = arr[0];
    for(int i=1; i<n; i++)acc[i] = acc[i-1] ^ arr[i];
    for(int i=0; i<q; i++){
        long long l, r;
        cin>>l>>r;
        long long ret = 0;
        auto be = lower_bound(arr.begin(), arr.end(), l) - arr.begin();
        auto en = upper_bound(arr.begin(), arr.end(), r) - arr.begin();
        en--;
//        cout<<be<<' '<<en<<endl;
        if(be == 0)ret = acc[en];
        else ret = acc[en] ^ acc[be-1];
        if(ret <=l)cout<<'B';
        else cout<<'A';

//        cout<<reta<<' '<<l<<' '<<retb<<endl;
//        if(ret == 0)cout<<'B';
//        else cout<<'A';
    }
}

vector<int> color, ans;
vector<vector<int>> adj;
map<int, int> taken;

void solve(int x, int par = -1){
//    cout<<x<<' ';
    if(!taken[color[x]]){
        ans.push_back(x+1);
        taken[color[x]] ++;
        for(int i=0; i<adj[x].size(); i++){
            if(adj[x][i] == par)continue;
            solve(adj[x][i], x);
        }
        taken[color[x]] --;
    }
    else {
        for(int i=0; i<adj[x].size(); i++){
            if(adj[x][i] == par)continue;
            solve(adj[x][i], x);
        }
    }
}

int main() {
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n;
    cin>>n;
    color.resize(n);
    adj.resize(n);
    for(int i=0; i<n; i++)cin>>color[i];
    for(int i=0; i<n-1;i++){
        int x, y;
        cin>>x>>y;
        x--, y--;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    solve(0);
    sort(ans.begin(), ans.end());
    for(auto x:ans)cout<<x<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mp(a,b) make_pair(a,b)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
vector<int> G[100002];
int visited[100002]={};
int c[100002]={};
vector<int> cm(100002,0);
vector<int> ans={};
//今まで見ている点でどの色が何回出たか
void dfs(int now){
    //cout<<"今から"<<now+1<<"を探索"<<endl;
    // cout<<"もうある色"<<endl;
    // for(auto color:cm){
    //    cout<<color.first<<" ";
    // }
    //cout<<endl;
    visited[now]=1;
    if(cm[c[now]]==0){
        ans.push_back(now+1);
    }
    cm[c[now]]+=1;
    for(int j=0;j<G[now].size();j++){
        int child = G[now][j];
        if(!visited[child]){
            dfs(child);
        }
    }
    cm[c[now]]--;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;

    //vector<int> c(n);
    vector<int> a(n),b(n);
    int maxc=0;
    rep(i,n){
        cin>>c[i];
        c[i]--;
        maxc = max(c[i],maxc);
    }
    rep(i,n-1){
        cin>>a[i]>>b[i];
        a[i]--,b[i]--;
        G[a[i]].push_back(b[i]);
        G[b[i]].push_back(a[i]);
    }
    // for(int i=0;i<n;i++){
    //     cout << "G[" <<i <<"]={";
    //     for(int j=0;j<G[i].size();j++){
    //         cout<<G[i][j]<<" ";
    //     }
    //     cout<<"}"<<endl;
    // }

    // rep(i,maxc+1){
    //     cout<<cm[i]<<endl;
    // }
    dfs(0);
    all(ans);
    for(auto node: ans){
        cout<<node<<endl;
    }
    return 0;
}