{"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":"\u003cp\u003e\r\n\tOne Sunday \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"1\"\u003ePetr\u003c/span\u003e went to a bookshop and bought a new book on sports programming. The book had exactly \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e pages.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"2\"\u003ePetr\u003c/span\u003e decided to start reading it starting from the next day, that is, from Monday. \u003cspan data-scayt_word\u003d\"Petr\u0027s\" data-scaytid\u003d\"13\"\u003ePetr\u0026#39;s\u003c/span\u003e got a very tight schedule and for each day of the week he knows how many pages he will be able to read on that day. Some days are so busy that \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"3\"\u003ePetr\u003c/span\u003e will have no time to read whatsoever. However, we know that he will be able to read at least one page a week.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tAssuming that \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"4\"\u003ePetr\u003c/span\u003e will not skip days and will read as much as he can every day, determine on which day of the week he will read the last page of the book.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tThe first input line contains the single integer \u003cspan class\u003d\"tex-span\"\u003e\u003ci\u003en\u003c/i\u003e\u003c/span\u003e (\u003cspan class\u003d\"tex-span\"\u003e1\u0026thinsp;\u0026le;\u0026thinsp;\u003ci\u003en\u003c/i\u003e\u0026thinsp;\u0026le;\u0026thinsp;1000\u003c/span\u003e) \u0026mdash; the number of pages in the book.\u003c/p\u003e\r\n\u003cp\u003e\r\n\tThe second line contains seven non-negative space-separated integers that do not exceed \u003cspan class\u003d\"tex-span\"\u003e1000\u003c/span\u003e \u0026mdash; those integers represent how many pages \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"5\"\u003ePetr\u003c/span\u003e can read on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday correspondingly. It is guaranteed that at least one of those numbers is larger than zero.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tPrint a single number \u0026mdash; the number of the day of the week, when \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"6\"\u003ePetr\u003c/span\u003e will finish reading the book. The days of the week are numbered starting with one in the natural order: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"title\" style\u003d\"border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(136, 136, 136); font-family: arial; font-weight: bold; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n\tInput 1\u003c/div\u003e\r\n\u003cpre style\u003d\"white-space: pre-wrap; word-wrap: break-word; background-color: rgb(239, 239, 239); line-height: 1.25em; margin-top: 0px; margin-bottom: 0px; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n\u003cspan style\u003d\"line-height: 1.25em; color: rgb(34, 34, 34);\"\u003e100\r\n\u003c/span\u003e\u003cspan style\u003d\"line-height: 1.25em; color: rgb(34, 34, 34);\"\u003e15 20 20 15 10 30 45\u003c/span\u003e\u003c/pre\u003e\r\n\u003cdiv class\u003d\"title\" style\u003d\"border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(136, 136, 136); font-family: arial; font-weight: bold; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n\tInput 2\u003c/div\u003e\r\n\u003cpre style\u003d\"white-space: pre-wrap; word-wrap: break-word; background-color: rgb(239, 239, 239); line-height: 1.25em; margin-top: 0px; margin-bottom: 0px; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n\u003cspan style\u003d\"line-height: 1.25em; color: rgb(34, 34, 34);\"\u003e2\r\n\u003c/span\u003e\u003cspan style\u003d\"line-height: 1.25em; color: rgb(34, 34, 34);\"\u003e1 0 0 0 0 0 0\u003c/span\u003e\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"title\" style\u003d\"border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(136, 136, 136); font-family: arial; font-weight: bold; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n\tOutput 1\u003c/div\u003e\r\n\u003cpre style\u003d\"white-space: pre-wrap; word-wrap: break-word; background-color: rgb(239, 239, 239); line-height: 1.25em; margin-top: 0px; margin-bottom: 0px; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n6\u003c/pre\u003e\r\n\u003cdiv class\u003d\"title\" style\u003d\"border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(136, 136, 136); font-family: arial; font-weight: bold; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n\tOutput 2\u003c/div\u003e\r\n\u003cpre style\u003d\"white-space: pre-wrap; word-wrap: break-word; background-color: rgb(239, 239, 239); line-height: 1.25em; margin-top: 0px; margin-bottom: 0px; padding: 0.25em; color: rgb(0, 0, 0);\"\u003e\r\n1\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cp\u003e\r\n\tNote to the first sample:\u003c/p\u003e\r\n\u003cp\u003e\r\n\tBy the end of Monday and therefore, by the beginning of Tuesday \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"7\"\u003ePetr\u003c/span\u003e has 85 pages left. He has 65 pages left by Wednesday, 45 by Thursday, 30 by Friday, 20 by Saturday and on Saturday \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"8\"\u003ePetr\u003c/span\u003e finishes reading the book (and he also has time to read 10 pages of something else).\u003c/p\u003e\r\n\u003cp\u003e\r\n\tNote to the second sample:\u003c/p\u003e\r\n\u003cp\u003e\r\n\tOn Monday of the first week \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"9\"\u003ePetr\u003c/span\u003e will read the first page. On Monday of the second week \u003cspan data-scayt_word\u003d\"Petr\" data-scaytid\u003d\"10\"\u003ePetr\u003c/span\u003e will read the second page and will finish reading the book.\u003c/p\u003e"}}]}