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

const int MAXN = 1e3 + 10; //dummy

class BinaryHeapLeaf{
	public:
	vector <int> maxDiff(int N){
		int mn = 0;
		int mx = 0;
		int curr2 = 1;
		int l = 0;
		int t = 2;
		while( curr2 <= N){
			curr2 += t;
			t *= 2;
			l++;
		}
        l--;
		vector<int> ans;
		mx = N - l;
		mn = (N + 1)/2;
        if( N == 2) mx = 1;
		ans.push_back(mn);
		ans.push_back(mx);
		return ans;
	}
};