{"trustable":false,"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\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003ePrakhar works at McDonalds. He loves eating junk food and today he has to put McNuggets in boxes for all the orders. To do this task, he performs n actions as defined below.\u003c/p\u003e\n\u003cp\u003eThe 1st action is to put one nugget in the box. For remaining actions he can choose from 2 options. \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFirst option\u003c/strong\u003e: If the number of nuggets in the box is at least 1, he may take it out and eat.\n\u003c/p\u003e\n\u003cp\u003e\n\u003cstrong\u003eSecond option\u003c/strong\u003e: In this case Prakhar will add one more nugget to the box than what he put in the previous turn.\n\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e: In the first turn he can only use the second option as the box is empty. For remaining turns he has to choose from the 2 options defined, he cannot skip a turn.\u003c/p\u003e\n\u003cp\u003e\nTo better understand the problem let’s take an example,\n\u003cul\u003e\n\u003cli\u003ePut one nugget (Current box capacity: 1)\u003c/li\u003e\n\u003cli\u003ePut two nuggets (Current box capacity: 3)\u003c/li\u003e\n\u003cli\u003eEat one nugget (Current box capacity: 2)\u003c/li\u003e\n\u003cli\u003eEat one nugget (Current box capacity: 1)\u003c/li\u003e\n\u003cli\u003ePut three nuggets (Current box capacity: 4)\u003c/li\u003e\n\u003cli\u003eEat one nugget (Current box capacity: 3)\u003c/li\u003e\n\u003cli\u003ePut four nuggets (Current box capacity: 7)\u003c/li\u003e\n\u003cli\u003eEat one nugget (Current box capacity: 6)\u003c/li\u003e\n\u003cli\u003eEat one nugget (Current box capacity: 5)\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\u003cp\u003eIn this example Prakhar performs \u003cspan class\u003d\"tex-span\"\u003e9\u003c/span\u003e actions and the final count of nuggets in box is \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e and he has eaten \u003cspan class\u003d\"tex-span\"\u003e5\u003c/span\u003e nuggets in total.\u003c/p\u003e\n\u003cp\u003e\nYou know the total number of actions (\u003ci\u003e\u003cstrong\u003en\u003c/strong\u003e\u003c/i\u003e) and the number of nuggets in the box at the end (\u003ci\u003e\u003cstrong\u003ek\u003c/strong\u003e\u003c/i\u003e) . You need to find the total number of nuggets Prakhar ate.\n\u003c/p\u003e\n\u003cp\u003eIt is guaranteed that for given values of n and k the answer always exists.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\nThe first line contains two integers \u003ci\u003e\u003cstrong\u003en\u003c/strong\u003e\u003c/i\u003e and \u003ci\u003e\u003cstrong\u003ek\u003c/strong\u003e\u003c/i\u003e (\u003cspan class\u003d\"tex-span\"\u003e 1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e ; 0 ≤ \u003ci\u003ek\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e\u003c/span\u003e) — the total number of moves and the number of nuggets in the box at the end.\n\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer — the number of nuggets, which Prakhar ate. \u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e1 1\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e0\u003c/pre\u003e\n \u003c/div\u003e\n\u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Explanation\n \u003c/div\u003e\n \u003cpre\u003e\nPrakhar has made one move only. According to the statement, the first move is always putting one nugget in the box. Hence he ate 0 nuggets.\n\u003c/pre\u003e\n \u003c/div\u003e\n\n\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e9 11\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e4\u003c/pre\u003e\n \u003c/div\u003e\n\u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Explanation\n \u003c/div\u003e\n \u003cpre\u003e\n\u003cul\u003e\n\u003cli\u003ePut 1 nugget (Current box capacity: 1)\u003c/li\u003e\n\u003cli\u003ePut 2 nuggets (Current box capacity: 3)\u003c/li\u003e\n\u003cli\u003eEat 1 nugget (Current box capacity: 2)\u003c/li\u003e\n\u003cli\u003eEat 1 nugget (Current box capacity: 1)\u003c/li\u003e\n\u003cli\u003ePut 3 nuggets (Current box capacity: 4)\u003c/li\u003e\n\u003cli\u003eEat 1 nugget (Current box capacity: 3)\u003c/li\u003e\n\u003cli\u003ePut 4 nuggets (Current box capacity: 7)\u003c/li\u003e\n\u003cli\u003eEat 1 nugget (Current box capacity: 6)\u003c/li\u003e\n\u003cli\u003ePut 5 nugget (Current box capacity: 11)\u003c/li\u003e\n\u003c/ul\u003e\nThis way, he will make exactly \u003cstrong\u003en\u003d9\u003c/strong\u003e actions and in the end the box will contain \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003e1+2−1−1+3−1+4−1+5\u003d11\u003c/i\u003e\u003c/span\u003e nuggets. The answer is \u003cspan class\u003d\"tex-span\u003e4\u003c/span\u003e, since he ate \u003cspan class\u003d\"tex-span\"\u003e4\u003c/span\u003e nuggets in total. \n\u003c/pre\u003e\n \u003c/div\u003e\n\n\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5 0\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e3\u003c/pre\u003e\n \u003c/div\u003e\n \n\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 2\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThere aren\u0027t multiple possible answers — the answer is unique for any input data.\u003c/p\u003e"}}]}