{"raw_statement":[{"iden":"statement","content":"You have a function $f (x)$, and you want to figure out how the area under $f (x)$ from 0 to $C$. \n\nIn calculus, this value is called the $i n t e g r a l$ of $f (x)$. For some functions, taking its integral is relatively easy and uses a few simple rules. However, for many functions, it is impossible to find their integral exactly. However, you can make an approximation of the integral, and since you're writing a computer program, you can make a close approximation.\n\nOne way to approximate the integral of a function is to use the Rectangular Approximation Method, or RAM. This method approximates the function $f (x)$ as $n$ rectangles, each having an equal width, and having varying $y$-values depending on the value of $f (x)$ at that point. \n\nAs you can see, the example with $n$=4 ($f (x)$ was divided into four rectangles) was not perfect. However, as $n$ gets larger and larger, the approximations get more and more accurate.\n\nFormally, define the LRAM (Left Rectangular Approximation Method) approximation of the area under a function $f (x)$ from $0$ to $C$, using $n$ rectangles, as A, and the area of each rectangle as A1, A2 ... AN, as the following:\n\nA = $frac(A 1 * C, N)$ + $frac(A 2 * C, N)$ + $frac(A 3 * C, N)$+ ... + $frac(A N * C, N)$.\n\nThe area of each rectangle can be calculated using the standard formula A = $l$ x $w$. The width of each subrectangle is equal to $frac(C, n)$ (because there are $n$ rectangles with a total width of $C$). The length of each subrectangle is equal to $f (frac(k * c, n))$, where $k$ represents the index of the rectangle, ranging from $0$ to $n -1$, inclusive.\n\nSince your answer must be a relatively close approximation, but your program should fit inside of the 10 second time limit (longer than usual for this problem), you should *set $N$ equal to 50000*.\n\nThe only line of input contains a calculus equation. The equation will consist of the variable $x$, exponents, parentheses, and multiplication, division, addition, and subtraction operations. For example, $frac(x^2 -3, x^3 -x + 5)$ would be a valid input, but $c o s (x)$ would be not.\n\nOutput a single decimal number: the area under $f (x)$ from $x$=$0$ to $x$=$C$. Your number should be close to the actual answer, but it doesn't have to be exact. *Using eval() or similar commands in your program is not allowed.*\n\nIn the first sample case, $6. 663$ would be judged as correct, but $7$ would be judged as incorrect.\n\n"},{"iden":"input","content":"The only line of input contains a calculus equation. The equation will consist of the variable $x$, exponents, parentheses, and multiplication, division, addition, and subtraction operations. For example, $frac(x^2 -3, x^3 -x + 5)$ would be a valid input, but $c o s (x)$ would be not."},{"iden":"output","content":"Output a single decimal number: the area under $f (x)$ from $x$=$0$ to $x$=$C$. Your number should be close to the actual answer, but it doesn't have to be exact. *Using eval() or similar commands in your program is not allowed.*"},{"iden":"examples","content":"Inputx^3 + x^2\n2\nOutput6.666426668800027\nInput(x^2 + x + 3) / (x^3 + x^2 + 5x)\n7\nOutput0.9806709605550483\nInputx^2\n5\nOutput41.66541667500017\n"},{"iden":"note","content":"In the first sample case, $6. 663$ would be judged as correct, but $7$ would be judged as incorrect."}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ f: \\mathbb{R} \\to \\mathbb{R} $ be a rational function defined by a symbolic expression in $ x $, involving only $ +, -, \\times, \\div, \\text{exponents}, \\text{and parentheses} $.  \nLet $ C \\in \\mathbb{R}^+ $ be the upper bound of integration.  \nLet $ n = 50000 $.  \n\n**Constraints**  \n1. $ f(x) $ is defined and continuous on $ [0, C] $.  \n2. $ C > 0 $.  \n3. The expression for $ f(x) $ contains no transcendental functions (e.g., $ \\sin, \\cos, \\log $).  \n\n**Objective**  \nCompute the Left Rectangular Approximation Method (LRAM) estimate of $ \\int_0^C f(x)\\,dx $:  \n$$\nA = \\sum_{k=0}^{n-1} f\\left( \\frac{k \\cdot C}{n} \\right) \\cdot \\frac{C}{n}\n$$","simple_statement":"Approximate the area under a function f(x) from 0 to C using 50000 left rectangles. Input is a math expression with x, +, -, *, /, ^, and parentheses. Output the area as a decimal.","has_page_source":false}