#include #define REP(i,s,n) for(int i=s;i ll2; // dp[bitの↑から南蛮目か][bitのたてた数]:=総数,総和 ll2 dp[40][40]; int main() { int x; cin >> x; if( x > 31 ) { puts("0 0"); return 0; } dp[0][0] = ll2(1,0); dp[0][1] = ll2(1,1); rep(i,31) { rep(j,x+1) { rep(k,2) { if( j + k <= x ) { dp[i+1][j+k].first += dp[i][j].first; if( k ) { dp[i+1][j+k].second += ( dp[i][j].first + dp[i][j].second * 2LL ); } else { dp[i+1][j+k].second += ( dp[i][j].second * 2LL); } } } } } cout << dp[30][x].first << " " << dp[30][x].second << endl; return 0; }