{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eMs. Iyo Kiffa-Australis有一个天平和两种重量单位来测量药物的剂量。\u003cbr\u003e\u003cbr\u003e例如,要用300mg的重量和700mg的重量来测量200mg的阿司匹林,她可以把一个700mg的重量放在药物一侧,另一侧放三个300mg的重量(图1)。虽然她可以把四个300mg的重量放在药物一侧,另一侧放两个700mg的重量(图2),但她不会选择这种方案,因为使用更多的重量不够方便。\u003cbr\u003e\u003cbr\u003e现在需要你帮助她计算需要多少个重量。\u003cbr\u003e\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/ea85f6022de2c4812580282419cad2af?v\u003d1710068584\"\u003e\u003c/center\u003e\u003cbr\u003e\u003cbr\u003e\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"输入包含一个数据集序列。每个数据集包含一行,包含三个正整数a、b和d,用空格分隔。满足以下关系:a !\u003d b, a \u0026lt;\u003d 10000, b \u0026lt;\u003d 10000, d \u0026lt;\u003d 50000。你可以假设可以用amg和bmg的重量组合来测量dmg。换句话说,你无需考虑“无解”情况。\u003cbr\u003e\u003cbr\u003e输入以包含三个用空格分隔的零的行表示结束。这不是一个数据集。\u003cbr\u003e"}},{"title":"输出","value":{"format":"HTML","content":"输出应由多行组成,每行对应一个输入数据集(a, b, d)。输出行应包含两个非负整数x和y,用空格分隔。它们应满足以下三个条件。\u003cbr\u003e\u003cpre\u003e\u0026nbsp;\u0026nbsp;1. You can measure dmg using x many amg weights and y many bmg weights.\u003cbr\u003e\u0026nbsp;\u0026nbsp;2. The total number of weights (x + y) is the smallest among those pairs of nonnegative\u003cbr\u003e\u0026nbsp;\u0026nbsp;integers satisfying the previous condition.\u003cbr\u003e\u0026nbsp;\u0026nbsp;3. The total mass of weights (ax + by) is the smallest among those pairs of nonnegative\u003cbr\u003e\u0026nbsp;\u0026nbsp;integers satisfying the previous two conditions.\u003c/pre\u003e\u003cbr\u003e输出中不应出现额外字符(例如额外空格)。\u003cbr\u003e"}},{"title":"示例","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\u003e700 300 200\r\n500 200 300\r\n500 200 500\r\n275 110 330\r\n275 110 385\r\n648 375 4002\r\n3 1 10000\r\n0 0 0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 3\r\n1 1\r\n1 0\r\n0 3\r\n1 1\r\n49 74\r\n3333 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}