{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"花里胡哨的zsc发现隔壁飞行器团队有几个可爱的同学,于是去交了个朋友。\u003cbr\u003e\n隔壁团队最近要参加一场飞行器竞速大赛,但是自己造的怕是有点水。\u003cbr\u003e\n于是zsc建议他们购买飞行器参加竞速大赛。\u003cbr\u003e\n但是飞行器都太贵了,他们正在为经费而苦恼。\u003cbr\u003e\n比赛要求在T分钟内跑完S公里。\u003cbr\u003e\n由于赛程太长,可能需要在中间加油,主办方提供了M个免费加油地点。\u003cbr\u003e\n隔壁的同学想知道买哪个飞行器能完成比赛。\u003cbr\u003e\nzsc决定为新朋友解决这个问题!\u003cbr\u003e\n"}},{"title":"Input","value":{"format":"HTML","content":"首先给出N,M,S,T分别代表有N种飞行器,M个可以为飞行器加油的站点,路程全程,最大耗时。 1 \u003c\u003d n \u003c\u003d 2e5, 1 \u003c\u003d m \u003c\u003d 2e5, 2 \u003c\u003d s \u003c\u003d 1e9, 1 \u003c\u003d T \u003c\u003d 2e9\u003cbr\u003e\n接着N行,每行给出一种飞行器的价格和油箱容积,1 \u003c\u003d ci, vi \u003c\u003d 1e9\u003cbr\u003e\n最后一行给出M个站点的位置。1\u003c\u003dgi\u003c\u003dS - 1\u003cbr\u003e \n飞行器每到一个站点都可以瞬间加满油,飞行器有两种飞行模式,高速:一公里跑一分钟,消耗两升油,低速:一公里跑两分钟,消耗一升油。可以在任意时间选择任意一种行驶方式。 \n"}},{"title":"Output","value":{"format":"HTML","content":"在小于最大耗时的前提下,选择最便宜的飞行器跑完全程。输出最小价格,如果找不到就输出-1.\u003cbr\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 1 8 10\u003cbr\u003e10 8\u003cbr\u003e5 7\u003cbr\u003e11 9\u003cbr\u003e3\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\u003e2 2 10 18\u003cbr\u003e10 4\u003cbr\u003e20 6\u003cbr\u003e5 3\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\u003e20\u003cbr\u003e\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}