{"raw_statement":[{"iden":"problem statement","content":"We have a sequence of $N$ positive integers: $A=(A_1,\\dots,A_N)$.  \nLet $B$ be the concatenation of $10^{100}$ copies of $A$.\nConsider summing up the terms of $B$ from left to right. When does the sum exceed $X$ for the first time?  \nIn other words, find the minimum integer $k$ such that:\n$\\displaystyle{\\sum_{i=1}^{k} B_i \\gt X}$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq A_i \\leq 10^9$\n*   $1 \\leq X \\leq 10^{18}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $\\ldots$ $A_N$\n$X$"},{"iden":"sample input 1","content":"3\n3 5 2\n26"},{"iden":"sample output 1","content":"8\n\nWe have $B=(3,5,2,3,5,2,3,5,2,\\dots)$.  \n$\\displaystyle{\\sum_{i=1}^{8} B_i = 28 \\gt 26}$ holds, but the condition is not satisfied when $k$ is $7$ or less, so the answer is $8$."},{"iden":"sample input 2","content":"4\n12 34 56 78\n1000"},{"iden":"sample output 2","content":"23"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}