/* -*- coding: utf-8 -*- * * 420.cc: No.420 mod2漸化式 - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int BN = 31; /* typedef */ typedef long long ll; /* global variables */ ll dp0[BN + 1][BN + 1], dp1[BN + 1][BN + 1]; /* subroutines */ /* main */ int main() { dp0[0][0] = 1; for (int i = 0; i < BN; i++) for (int j = 0; j < BN; j++) if (dp0[i][j] > 0) { dp0[i + 1][j] += dp0[i][j]; dp1[i + 1][j] += dp1[i][j]; dp0[i + 1][j + 1] += dp0[i][j]; dp1[i + 1][j + 1] += dp1[i][j] + (1LL << i) * dp0[i][j]; } int x; cin >> x; if (x > BN) puts("0 0"); else printf("%lld %lld\n", dp0[BN][x], dp1[BN][x]); return 0; }