{"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":"在一个二维平面上, 欧神的飞机正从点(-1000000000, h)飞往点(1000000000, h)。\u003cbr\u003e\n\u003cbr\u003e\n欧神喜欢玩滑翔, 现在准备从飞机起跳。\u003cbr\u003e\n当欧神跳下后,他的水平速度的大小始终为1,水平速度的方向与飞机一致。\u003cbr\u003e\n他的竖向速度的方向向下,竖向速度的大小为1。\u003cbr\u003e\n\u003cbr\u003e\n但是,有些区域内有上升气流。\u003cbr\u003e\n当欧神进入这些区域时,竖向速度大小为0。\u003cbr\u003e\n当欧神不在这些区域时,竖向速度大小为1。\u003cbr\u003e\n\u003c/p\u003e\u003cbr\u003e\n\n\u003ccenter\u003e \n \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/bf1a0d0060d83928ed7bfbfd0cbb71df?v\u003d1630377967\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003cbr\u003e \n\n \u003cspan class\u003d\"tex-font-size-small\"\u003e\n 上图显示了上升气流对滑翔的影响: 如果欧神从 x\u003d1 跳下, 他会在 x\u003d10落地. 如果从 x\u003d2 跳下, 他会在 x\u003d12 落地.\n \u003c/span\u003e \n\u003c/center\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e第一行包含两个整数, 上升气流数量 n 和飞机飞行高度 h。\u003cbr\u003e\n接下来会有 n 行每行两个数字, 代表上升气流所在的区间的两个端点坐标X1, X2。\u003cbr\u003e\n\u003cbr\u003e\n数据范围限定:\u003cbr\u003e\n1 \u003c\u003d n \u003c\u003d 200000.\u003cbr\u003e\n1 \u003c\u003d X1 \u003c X2 \u003c\u003d 1000000000.\u003cbr\u003e\n任意两个上升气流区间不相交.\u003cbr\u003e\n输入所给的区间是从左到右的.\u003cbr\u003e\n所有的输入数据都是整数.\u003cbr\u003e\n\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e一个整数, 欧神能够滑翔的最远距离(即欧神从跳伞到落地的水平位移).\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e3 4\u003cbr\u003e2 5\u003cbr\u003e7 9\u003cbr\u003e10 11\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e10\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5 10\u003cbr\u003e5 7\u003cbr\u003e11 12\u003cbr\u003e16 20\u003cbr\u003e25 26\u003cbr\u003e30 33\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e18\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e1 1000000000\u003cbr\u003e1 1000000000\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e1999999999\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"在第一个例子中,从x\u003d2起跳,在x\u003d12落地,12 - 2 \u003d 10。\u003cbr\u003e\n在第二个例子中,从x\u003d16起跳,在x\u003d34落地。\u003cbr\u003e\n在第三个例子中,从x\u003d−100起跳,在x\u003d1999999899落地。\u003cbr\u003e"}}]}