ESC
InterviewTime limit1sMemory limit1024 MB
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 , its derivative is written . If is also differentiable, differentiating again gives . If can be differentiated many times, is defined as differentiated times. Consider three functions. is differentiable with . is differentiable with . is differentiable with . Surprisingly, differentiating these three functions as many times as you like always yields differentiable functions. The product of all three, , is also differentiable any number of times. For example, and . Therefore can be written as follows. (where , , and are integers). Given , write a program that computes .
Input
The first line contains an integer .
Output
On the first line, print the value of .