{"problem":{"name":"H. Annuity Payment Scheme","description":{"content":"At the peak of the Global Economic Crisis BerBank offered an unprecedented credit program. The offering was so attractive that Vitaly decided to try it. He took a loan of s burles for m months with th","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":65536},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10125H"},"statements":[{"statement_type":"Markdown","content":"At the peak of the Global Economic Crisis BerBank offered an unprecedented credit program. The offering was so attractive that Vitaly decided to try it. He took a loan of s burles for m months with the interest rate of p percent. \n\nVitaly has to follow the scheme of annuity payments, meaning that he should make fixed monthly payments — x burles per month. Obviously, at the end of the period he will pay m·x burles to the bank in total.\n\nEach of the monthly payments is divided by BerBank into two parts as follows: \n\nFor example, if s = 100, m = 2, p = 50 then x = 90. For the first month a1 = s'·p / 100 = s·p / 100 = 50 and b1 = 90 - 50 = 40. For the second month a2 = (100 - 40)·50 / 100 = 30, so b2 = 90 - 30 = 60 and the debt is paid off completely. \n\nYour task is to help Vitaly and write a program that computes x given the values of s, m and p.\n\nThe single line of the input contains three integers s, m and p (1 ≤ s ≤ 106, 1 ≤ m ≤ 120, 0 ≤ p ≤ 100).\n\nOutput the single value of monthly payment x in burles. An absolute error of up to 10 - 5 is allowed.\n\n## Input\n\nThe single line of the input contains three integers s, m and p (1 ≤ s ≤ 106, 1 ≤ m ≤ 120, 0 ≤ p ≤ 100).\n\n## Output\n\nOutput the single value of monthly payment x in burles. An absolute error of up to 10 - 5 is allowed.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of cards, with $ 2 \\leq n \\leq 10^5 $.  \nLet $ V = (v_1, v_2, \\dots, v_n) $ be a sequence of integers, where $ 1 \\leq v_i \\leq 5000 $ for all $ i \\in \\{1, \\dots, n\\} $.  \n\n**Constraints**  \n- Initially, each card is a singleton set: $ \\{v_1\\}, \\{v_2\\}, \\dots, \\{v_n\\} $.  \n- In each move, two adjacent sets are merged into one.  \n- The game ends when only one set remains.  \n- After each merge, the score increases by the maximum value in each existing set.  \n\n**Objective**  \nMaximize the total score, defined as the sum of the maximum value over all current sets after each merge operation.  \n\n**Key Insight**  \nThe total score equals the sum over all cards of $ v_i \\cdot c_i $, where $ c_i $ is the number of times the value $ v_i $ is the maximum in a set during the merging process.  \nTo maximize the score, each $ v_i $ contributes as many times as the number of intervals (contiguous subarrays) in which it is the maximum.  \n\nThus, the maximum score is:  \n$$\n\\sum_{i=1}^{n} v_i \\cdot L_i \\cdot R_i\n$$  \nwhere:  \n- $ L_i $ is the number of consecutive elements to the left of $ v_i $ (including $ v_i $) that are $ \\leq v_i $,  \n- $ R_i $ is the number of consecutive elements to the right of $ v_i $ (including $ v_i $) that are $ \\leq v_i $,  \nand the product $ L_i \\cdot R_i $ gives the number of contiguous subarrays where $ v_i $ is the maximum.  \n\n**Note**: This is equivalent to the standard \"sum of maximums of all subarrays\" problem.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10125H","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}