{"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":"MD","content":"郑州地铁的圆线有n个车站。 我们知道所有邻近站点之间的距离:\n\nd[1]是第1站和第2站之间的距离;\nd[2]是第2站和第3站之间的距离;\n...\n\nd[n - 1]是第n-1和第n个站之间的距离;\nd[n]是第n个站和第1个站之间的距离。\n列车沿着两个方向的圆线。 找到具有数字s和t的站点之间的最短距离。"}},{"title":"Input","value":{"format":"MD","content":"\n第一行包含整数n(3≤n≤100),表示圆线上的站数。 第二行包含n个整数d[1],d[2],...,d[n](1≤d[i]≤100) 表示相邻站对之间的距离。 第三行包含两个整数s和t(1≤s,t≤n) 表示站点数量,您需要在这些站点之间找到最短距离。 这些数字可以相同。\n\n行中的数字由单个空格分隔。"}},{"title":"Output","value":{"format":"MD","content":"打印一个数字 ,站号s和t之间最短路径的长度。"}},{"title":"Examples","value":{"format":"MD","content":"#### 样例1\nInput:\n4\n2 3 4 9\n1 3\n\nOutput:\n5\n#### 样例2\nInput:\n4\n5 8 2 100\n4 1\n\nOutput:\n15\n#### 样例3\nInput:\n3\n1 1 1\n3 1\n\nOutput:\n1\n#### 样例4\nInput:\n3\n31 41 59\n1 1\n\nOutput:\n0"}},{"title":"Note","value":{"format":"MD","content":"\n在第一个样本中,路径1→2→3的长度等于5,路径1→4→3的长度等于13。\n\n在第二个样本中,路径4→1的长度为100,路径4→3→2→1的长度为15。\n\n在第三个样本中,路径3→1的长度为1,路径3→2→1的长度为2。\n\n在第四个样本中,站的数量是相同的,因此最短距离等于0。"}}]}