{"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\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":"\u003cp\u003eEach evening after the dinner the SIS\u0027s students gather together to play the game of Sport Mafia. \u003c/p\u003e\u003cp\u003eFor the tournament, Alya puts candies into the box, which will serve as a prize for a winner. To do that, she performs $$$n$$$ actions. The first action performed is to put a single candy into the box. For each of the remaining moves she can choose from two options:\u003c/p\u003e\u003cul\u003e \u003cli\u003e the first option, in case the box contains at least one candy, is to take \u003cspan class\u003d\"tex-font-style-bf\"\u003eexactly one candy out and eat it\u003c/span\u003e. This way the number of candies in the box decreased by $$$1$$$; \u003c/li\u003e\u003cli\u003e the second option is to put candies in the box. In this case, Alya will put $$$1$$$ more candy, than she put in the previous time. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThus, if the box is empty, then it can only use the second option.\u003c/p\u003e\u003cp\u003eFor example, one possible sequence of Alya\u0027s actions look as follows:\u003c/p\u003e\u003cul\u003e \u003cli\u003e put one candy into the box; \u003c/li\u003e\u003cli\u003e put two candies into the box; \u003c/li\u003e\u003cli\u003e eat one candy from the box; \u003c/li\u003e\u003cli\u003e eat one candy from the box; \u003c/li\u003e\u003cli\u003e put three candies into the box; \u003c/li\u003e\u003cli\u003e eat one candy from the box; \u003c/li\u003e\u003cli\u003e put four candies into the box; \u003c/li\u003e\u003cli\u003e eat one candy from the box; \u003c/li\u003e\u003cli\u003e put five candies into the box; \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThis way she will perform $$$9$$$ actions, the number of candies at the end will be $$$11$$$, while Alya will eat $$$4$$$ candies in total.\u003c/p\u003e\u003cp\u003eYou know the total number of actions $$$n$$$ and the number of candies at the end $$$k$$$. You need to find the total number of sweets Alya ate. That is the number of moves of the first option. It\u0027s guaranteed, that for the given $$$n$$$ and $$$k$$$ the answer always exists.\u003c/p\u003e\u003cp\u003ePlease note, that during an action of the first option, Alya takes out and eats exactly one candy.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two integers $$$n$$$ and $$$k$$$ ($$$1 \\le n \\le 10^9$$$; $$$0 \\le k \\le 10^9$$$)\u0026nbsp;— the total number of moves and the number of candies in the box at the end. \u003c/p\u003e\u003cp\u003eIt\u0027s guaranteed, that for the given $$$n$$$ and $$$k$$$ the answer exists.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint a single integer\u0026nbsp;— the number of candies, which Alya ate. Please note, that in this problem there aren\u0027t multiple possible answers\u0026nbsp;— the answer is unique for any input data. \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\u003e1 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e9 11\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e5 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","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\u003e3 2\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\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\u003eIn the first example, Alya has made one move only. According to the statement, the first move is always putting one candy in the box. Hence Alya ate $$$0$$$ candies.\u003c/p\u003e\u003cp\u003eIn the second example the possible sequence of Alya\u0027s actions looks as follows: \u003c/p\u003e\u003cul\u003e \u003cli\u003e put $$$1$$$ candy, \u003c/li\u003e\u003cli\u003e put $$$2$$$ candies, \u003c/li\u003e\u003cli\u003e eat a candy, \u003c/li\u003e\u003cli\u003e eat a candy, \u003c/li\u003e\u003cli\u003e put $$$3$$$ candies, \u003c/li\u003e\u003cli\u003e eat a candy, \u003c/li\u003e\u003cli\u003e put $$$4$$$ candies, \u003c/li\u003e\u003cli\u003e eat a candy, \u003c/li\u003e\u003cli\u003e put $$$5$$$ candies. \u003c/li\u003e\u003c/ul\u003e \u003cp\u003eThis way, she will make exactly $$$n\u003d9$$$ actions and in the end the box will contain $$$1+2-1-1+3-1+4-1+5\u003d11$$$ candies. The answer is $$$4$$$, since she ate $$$4$$$ candies in total.\u003c/p\u003e"}}]}