{"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":"玛琪玛小姐经常会来拜访早川一家,但是早川家这几个懒狗太能睡了,有时候玛琪玛小姐在的时候他们也要去睡觉,有时候玛琪玛来了要等好久他们才会醒,早川家每天只在[l1,r1]时间内是清醒的,但是在第k分钟早川家会睡着 (仅这一分钟)。\n\n现在玛琪玛小姐准备在[l2,r2]时间内拜访早川一家,请问在玛琪玛拜访早川家的时候,早川家清醒的时间是多少。"}},{"title":"Input","value":{"format":"MD","content":"输入五个数 l1,r1,l2,r2,k\n[l1,r1] 是早川家清醒的时间\n[l2,r2] 是玛琪玛拜访早川家的时间\nk 表示第k分钟早川家会睡着\n(1 ≤ l1, r1, l2, r2, k ≤ 1e18, l1 ≤ r1, l2 ≤ r2)"}},{"title":"Output","value":{"format":"MD","content":"输出一行,玛琪玛在拜访早川家的时候,早川家清醒的总时间是多少。"}},{"title":"Examples","value":{"format":"MD","content":"输入:1 10 9 20 1\n输出:2\n\n输入:1 100 50 200 75\n输出:50\n"}},{"title":"Note","value":{"format":"MD","content":"在样例一中,早川清醒的时间是[1,10] 但第一分钟会睡着,所以是[2,10] ,玛琪玛小姐拜访的时间是[9,20] 所以在拜访时间中只有[9,10]早川家是清醒的\n\n注意k不一定在区间[l1,r1]中"}}]}