PROBLEM LINK:Div1, Div2 DIFFICULTY:Easy PREREQUISITES:None PROBLEM:You are given the initial price $p$ of a product. You need to first increase the price of this recipe by $x\%$ (from $p$) and then offer a discount of $x\%$. You need to compute the loss which occured to you as a result of this process, for $N$ items. EXPLANATION:Original price of the product = $p$. $\Rightarrow$ Final price = $p.\left(1\left(\frac{x}{100}\right) ^2\right)$ Since, the final price is less than original price: $\Rightarrow$ Loss = $p  p.\left(1\left(\frac{x}{100}\right) ^2\right)$ $\Rightarrow$ Loss = $p.\left(\frac{x}{100}\right) ^2$ Coming back to original problem, we can use the formula for loss computed above to find loss for each recipe individually. Hence, Time Complexity:$O(N)$ AUTHOR'S AND TESTER'S SOLUTIONS
This question is marked "community wiki".
asked 11 Mar, 16:57

What is wrong? Please help! answered 13 Mar, 15:03
