#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; template < class T > vector< vector< T > > bicoef_table(int N) { vector< vector< T > > table(N + 1, vector< T >(N + 1)); table[0][0] = 1; for(int i = 1; i <= N; i++) { table[i][0] = 1; for(int j = 1; j <= N; j++) { table[i][j] = table[i - 1][j - 1] + table[i - 1][j]; } } return table; } int main(){ cin.tie(0); ios::sync_with_stdio(0); // popcnt(n) = x int x; cin >> x; if(x == 0) { cout << "1 0\n"; return 0; } if(x > 31) { cout << "0 0\n"; return 0; } auto comb = bicoef_table(31); ll cnt = comb[31][x]; ll sum = comb[30][x - 1] * ((1LL << 31) - 1); cout << cnt << " " << sum << "\n"; return 0; }