Under construction

Still being built. Things may change

ESC

Interview

Time limit1sMemory limit1024 MB

Summary
Given n, output a_n + b_n + c_n for the n-th derivative of e^x sin x cos x, written in the basis e^x sin^2 x, e^x cos^2 x, e^x sin x cos x.
Level

Medium4 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Let us differentiate some functions. For a differentiable function f(x)f(x), its derivative is written f′(x)f'(x). If f′(x)f'(x) is also differentiable, differentiating again gives f′′(x)f''(x). If f(x)f(x) can be differentiated many times, f(n)(x)f^{(n)}(x) is defined as f(x)f(x) differentiated nn times. Consider three functions. E(x)=exE(x) = e^x is differentiable with E′(x)=exE'(x) = e^x. S(x)=sin⁡xS(x) = \sin x is differentiable with S′(x)=cos⁡xS'(x) = \cos x. C(x)=cos⁡xC(x) = \cos x is differentiable with C′(x)=−sin⁡xC'(x) = -\sin x. Surprisingly, differentiating these three functions as many times as you like always yields differentiable functions. The product of all three, ESC(x)=exsin⁡xcos⁡x\text{ESC}(x) = e^x \sin x \cos x, is also differentiable any number of times. For example, ESC′(x)=exsin⁡xcos⁡x+excos⁡2x−exsin⁡2x\text{ESC}'(x) = e^x \sin x \cos x + e^x \cos^2 x - e^x \sin^2 x and ESC′′(x)=−2exsin⁡2x+2excos⁡2x−3exsin⁡xcos⁡x\text{ESC}''(x) = -2 e^x \sin^2 x + 2 e^x \cos^2 x - 3 e^x \sin x \cos x. Therefore ESC(n)(x)\text{ESC}^{(n)}(x) can be written as follows. ESC(n)(x)=anexsin⁡2x+bnexcos⁡2x+cnexsin⁡xcos⁡x\text{ESC}^{(n)}(x)=a_n e^x \sin^2 x + b_n e^x \cos^2 x + c_n e^x \sin x \cos x (where ana_n, bnb_n, and cnc_n are integers). Given nn, write a program that computes an+bn+cna_n + b_n + c_n.

Input

The first line contains an integer nn.

Output

On the first line, print the value of an+bn+cna_n + b_n + c_n.

Constraints

1≤n≤301 \le n \le 30

Examples2

  1. Example 1

    Input
    1
    
    Expected output
    1
    
  2. Example 2

    Input
    30
    
    Expected output
    -6890111163