#include #include using namespace std; using ll = long long; int main() { int x; cin >> x; if (x > 31) { cout << 0 << " " << 0 << endl; return 0; } vector> dp(32); dp[0] = {1, 0}; for (int i = 0; i <= 30; i++) { vector> after(32); for (int j = 0; j <= 31; j++) { after[j].first += dp[j].first, after[j].second += dp[j].second * 2; if (j > 0) { after[j].first += dp[j - 1].first, after[j].second += dp[j - 1].second * 2 + dp[j - 1].first; } } dp = after; } cout << dp[x].first << " " << dp[x].second << endl; return 0; }