{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIn Pavlopolis University where Noora studies it was decided to hold beauty contest \"Miss Pavlopolis University\". Let\u0027s describe the process of choosing the most beautiful girl in the university in more detail.\u003c/p\u003e\u003cp\u003eThe contest is held in several stages. Suppose that exactly \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e girls participate in the competition initially. All the participants are divided into equal groups, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e participants in each group. Furthermore the number \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e is chosen arbitrarily, i. e. on every stage number \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e can be different. Within each group the jury of the contest compares beauty of the girls in the format \"each with each\". In this way, if group consists of \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e girls, then \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/dcc0673505d8bf3ea063a49497e993f9?v\u003d1725690263\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e comparisons occur. Then, from each group, the most beautiful participant is selected. Selected girls enter the next stage of the competition. Thus if \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e girls were divided into groups, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ex\u003c/i\u003e\u003c/span\u003e participants in each group, then exactly \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/06df5b49e9fcc59b7bf0ce340328ce68?v\u003d1725690263\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e participants will enter the next stage. The contest continues until there is exactly one girl left who will be \"Miss Pavlopolis University\"\u003c/p\u003e\u003cp\u003eBut for the jury this contest is a very tedious task. They would like to divide the girls into groups in each stage so that the total number of pairwise comparisons of the girls is as few as possible. Let \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ef\u003c/i\u003e(\u003ci\u003en\u003c/i\u003e)\u003c/span\u003e be the minimal total number of comparisons that should be made to select the most beautiful participant, if we admit \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e girls to the first stage.\u003c/p\u003e\u003cp\u003eThe organizers of the competition are insane. They give Noora three integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003el\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003er\u003c/i\u003e\u003c/span\u003e and ask the poor girl to calculate the value of the following expression: \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003csup class\u003d\"upper-index\"\u003e0\u003c/sup\u003e·\u003ci\u003ef\u003c/i\u003e(\u003ci\u003el\u003c/i\u003e) + \u003ci\u003et\u003c/i\u003e\u003csup class\u003d\"upper-index\"\u003e1\u003c/sup\u003e·\u003ci\u003ef\u003c/i\u003e(\u003ci\u003el\u003c/i\u003e + 1) + ... + \u003ci\u003et\u003c/i\u003e\u003csup class\u003d\"upper-index\"\u003e\u003ci\u003er\u003c/i\u003e - \u003ci\u003el\u003c/i\u003e\u003c/sup\u003e·\u003ci\u003ef\u003c/i\u003e(\u003ci\u003er\u003c/i\u003e)\u003c/span\u003e. However, since the value of this expression can be quite large the organizers ask her to calculate it modulo \u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e + 7\u003c/span\u003e. If Noora can calculate the value of this expression the organizers promise her to help during the beauty contest. But the poor girl is not strong in mathematics, so she turned for help to Leha and he turned to you.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first and single line contains three integers \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003et\u003c/i\u003e\u003c/span\u003e, \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003el\u003c/i\u003e\u003c/span\u003e and \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003er\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1 ≤ \u003ci\u003et\u003c/i\u003e \u0026lt; 10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e + 7, 2 ≤ \u003ci\u003el\u003c/i\u003e ≤ \u003ci\u003er\u003c/i\u003e ≤ 5·10\u003csup class\u003d\"upper-index\"\u003e6\u003c/sup\u003e\u003c/span\u003e).\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIn the first line print single integer — the value of the expression modulo \u003cspan class\u003d\"tex-span\"\u003e10\u003csup class\u003d\"upper-index\"\u003e9\u003c/sup\u003e + 7\u003c/span\u003e.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2 2 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e19\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eConsider the sample.\u003c/p\u003e\u003cp\u003eIt is necessary to find the value of \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/cee1066e3e39fd493c8d19fe10c97937?v\u003d1725690263\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e.\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ef\u003c/i\u003e(2) \u003d 1\u003c/span\u003e. From two girls you can form only one group of two people, in which there will be one comparison.\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ef\u003c/i\u003e(3) \u003d 3\u003c/span\u003e. From three girls you can form only one group of three people, in which there will be three comparisons.\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003ef\u003c/i\u003e(4) \u003d 3\u003c/span\u003e. From four girls you can form two groups of two girls each. Then at the first stage there will be two comparisons, one in each of the two groups. In the second stage there will be two girls and there will be one comparison between them. Total \u003cspan class\u003d\"tex-span\"\u003e2 + 1 \u003d 3\u003c/span\u003e comparisons. You can also leave all girls in same group in the first stage. Then \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/de320d496c26d58a46d0bdd725d361a4?v\u003d1725690263\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e comparisons will occur. Obviously, it\u0027s better to split girls into groups in the first way.\u003c/p\u003e\u003cp\u003eThen the value of the expression is \u003cimg align\u003d\"middle\" class\u003d\"tex-formula\" src\u003d\"CDN_BASE_URL/e4fc90f25f61db6c9d92df03db9a4e5f?v\u003d1725690263\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e.\u003c/p\u003e"}}]}