{"trustable":true,"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":"\u003cdiv class\u003d\"epigraph\"\u003e\u003cdiv class\u003d\"epigraph-text\"\u003e\u003ca href\u003d\"https://soundcloud.com/kivawu/hyouryu\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eTHE SxPLAY \u0026amp; KIVΛ - 漂流\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e \u003cdiv class\u003d\"epigraph\"\u003e\u003cdiv class\u003d\"epigraph-text\"\u003e\u003ca href\u003d\"https://soundcloud.com/kivawu/perspectives\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eKIVΛ \u0026amp; Nikki Simmons - Perspectives\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003cp\u003e换了新身体的偶像白芳香(或者我们应该称她为南宫香?)开始通过操作系统空间揭开她失去的过去。\u003c/p\u003e\u003cp\u003e这个空间可以被视为一个二维平面,有无限数量的数据节点,从$$$0$$$开始编号,它们的坐标定义如下:\u003c/p\u003e\u003cul\u003e \u003cli\u003e$$$0$$$-th节点的坐标是$$$(x_0, y_0)$$$\u003c/li\u003e\u003cli\u003e对于$$$i \u0026gt; 0$$$,$$$i$$$-th节点的坐标是$$$(a_x \\cdot x_{i-1} + b_x, a_y \\cdot y_{i-1} + b_y)$$$\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e最初,芳香站在点$$$(x_s, y_s)$$$。她最多可以在操作系统空间停留$$$t$$$秒,因为超过这个时间她就必须回到现实世界。她\u003cspan class\u003d\"tex-font-style-bf\"\u003e不需要\u003c/span\u003e回到入口点$$$(x_s, y_s)$$$就可以回家。\u003c/p\u003e\u003cp\u003e在操作系统空间内,芳香可以进行以下操作:\u003c/p\u003e\u003cul\u003e \u003cli\u003e从点$$$(x, y)$$$,芳香可以移动到以下点之一:$$$(x-1, y)$$$、$$$(x+1, y)$$$、$$$(x, y-1)$$$或$$$(x, y+1)$$$。这个行动需要$$$1$$$秒。\u003c/li\u003e\u003cli\u003e如果芳香停留的地方有一个数据节点,她可以收集它。我们可以假设这个行动需要$$$0$$$秒。当然,每个数据节点最多只能被收集一次。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e芳香希望在回到现实世界之前尽可能多地收集数据节点。你能帮她计算在$$$t$$$秒内她最多能收集到多少数据节点吗?\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含整数$$$x_0$$$、$$$y_0$$$、$$$a_x$$$、$$$a_y$$$、$$$b_x$$$、$$$b_y$$$($$$1 \\leq x_0, y_0 \\leq 10^{16}$$$、$$$2 \\leq a_x, a_y \\leq 100$$$、$$$0 \\leq b_x, b_y \\leq 10^{16}$$$),它们定义了数据节点的坐标。\u003c/p\u003e\u003cp\u003e第二行包含整数$$$x_s$$$、$$$y_s$$$、$$$t$$$($$$1 \\leq x_s, y_s, t \\leq 10^{16}$$$)— 初始芳香的坐标和可用时间。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e输出一个整数 — 芳香在$$$t$$$秒内最多能收集到的数据节点数量。\u003c/p\u003e"}},{"title":"示例 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 1 2 3 1 0\n2 4 20\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"示例 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 1 2 3 1 0\n15 27 26\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"示例 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 1 2 3 1 0\n2 2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注意","value":{"format":"HTML","content":"\u003cp\u003e在所有三个示例中,前$$$5$$$个数据节点的坐标是$$$(1, 1)$$$、$$$(3, 3)$$$、$$$(7, 9)$$$、$$$(15, 27)$$$和$$$(31, 81)$$$(记住节点是从$$$0$$$开始编号的)。\u003c/p\u003e\u003cp\u003e在第一个示例中,收集$$$3$$$个节点的最佳路线如下:\u003c/p\u003e\u003cul\u003e \u003cli\u003e去到坐标$$$(3, 3)$$$并收集第$$$1$$$个节点。这需要$$$|3 - 2| + |3 - 4| \u003d 2$$$秒。\u003c/li\u003e\u003cli\u003e去到坐标$$$(1, 1)$$$并收集第$$$0$$$个节点。这需要$$$|1 - 3| + |1 - 3| \u003d 4$$$秒。\u003c/li\u003e\u003cli\u003e去到坐标$$$(7, 9)$$$并收集第$$$2$$$个节点。这需要$$$|7 - 1| + |9 - 1| \u003d 14$$$秒。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e在第二个示例中,收集$$$2$$$个节点的最佳路线如下:\u003c/p\u003e\u003cul\u003e \u003cli\u003e收集第$$$3$$$个节点。这不需要时间。\u003c/li\u003e\u003cli\u003e去到坐标$$$(7, 9)$$$并收集第$$$2$$$个节点。这需要$$$|15 - 7| + |27 - 9| \u003d 26$$$秒。\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e在第三个示例中,芳香无法收集任何节点。她应该适当休息,而不是匆忙进入操作系统空间。\u003c/p\u003e"}}]}