{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\"text/css\"\u003e\r\nh1,h2,h3,h4,h5,h6{margin-bottom:0;}div.textBG p{margin: 0 0 0.0001pt;}\u003c/style\u003e\r\n\u003cp\u003e\r\n\t\u003cspan style\u003d\"float:right\"\u003e\u003ca href\u003d\"http://uva.onlinejudge.org/external/111/11150.pdf\" target\u003d\"_blank\"\u003e\u003cimg alt\u003d\"Download as PDF\" border\u003d\"0\" height\u003d\"26\" src\u003d\"http://uva.onlinejudge.org/components/com_onlinejudge/images/button_pdf.png\" title\u003d\"Download as PDF\" width\u003d\"100\" /\u003e\u003c/a\u003e\u003c/span\u003e\u003cfont size\u003d\"6\"\u003eY\u003c/font\u003eou see the following special offer by the convenience store:\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003ci\u003e\u0026quot; A bottle of \u003cspan data-scayt_word\u003d\"Choco\" data-scaytid\u003d\"1\"\u003eChoco\u003c/span\u003e Cola for every 3 empty bottles returned \u0026quot;\u003c/i\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\tNow you decide to buy some (say \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e) bottles of cola from the store. You would like to know how you can get the most cola from them.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tThe figure below shows the case where \u003cb\u003e\u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e \u003d 8\u003c/b\u003e. \u003ci\u003eMethod 1\u003c/i\u003e is the standard way: after finishing your 8 bottles of cola, you have 8 empty bottles. Take 6 of them and you get 2 new bottles of cola. Now after drinking them you have 4 empty bottles, so you take 3 of them to get yet another new cola. Finally, you have only 2 bottles in hand, so you cannot get new cola any more. Hence, you have enjoyed 8 + 2 + 1 \u003d 11 bottles of cola.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tYou can actually do better! In \u003ci\u003eMethod 2\u003c/i\u003e, you first borrow an empty bottle from your friend (?! Or the storekeeper??), then you can enjoy 8 + 3 + 1 \u003d 12 bottles of cola! Of course, you will have to return your remaining empty bottle back to your friend.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cimg src\u003d\"http://uva.onlinejudge.org/external/111/p11150.gif\" /\u003e\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00001000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eInput\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tInput consists of several lines, each containing an integer \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e (1 \u0026le; \u003cb\u003e\u003ci\u003eN\u003c/i\u003e\u003c/b\u003e \u0026le; 200).\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00002000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eOutput\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tFor each case, your program should output the maximum number of bottles of cola you can enjoy. You may borrow empty bottles from others, but if you do that, make sure that you have enough bottles afterwards to return to them.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00004000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eSample Input\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\n8\r\n\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003ca name\u003d\"SECTION00004000000000000000\"\u003e\u003cfont color\u003d\"#550077\"\u003eSample Output\u003c/font\u003e\u003c/a\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\n12\r\n\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u003cb\u003eNote:\u003c/b\u003e Drinking too much cola is bad for your health, so... don\u0026#39;t try this at home!! :-)\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003chr /\u003e\r\n\u003caddress\u003e\r\n\tIdea from a traditional IQ challenge question.\u003cbr /\u003e\r\n\tSpecial Thanks: Jonathan \u003cspan data-scayt_word\u003d\"Mak\" data-scaytid\u003d\"2\"\u003eMak\u003c/span\u003e\u003c/address\u003e"}}]}