{"problem":{"name":"Hydrate","description":{"content":"There is a container with $A$ cyan balls. Takahashi will do the following operation as many times as he likes (possibly zero times): *   add $B$ cyan balls and $C$ red balls into the container. Taka","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc207_b"},"statements":[{"statement_type":"Markdown","content":"There is a container with $A$ cyan balls. Takahashi will do the following operation as many times as he likes (possibly zero times):\n\n*   add $B$ cyan balls and $C$ red balls into the container.\n\nTakahashi's objective is to reach a situation where the number of cyan balls in the container is at most $D$ times the number of red balls in it.\nDetermine whether the objective is achievable. If it is achievable, find the minimum number of operations needed to achieve it.\n\n## Constraints\n\n*   $1 \\leq A,B,C,D \\leq 10^5$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$A$ $B$ $C$ $D$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc207_b","tags":[],"sample_group":[["5 2 3 2","2\n\nBefore the first operation, the container has $5$ cyan balls and $0$ red balls. Since $5$ is greater than $0$ multiplied by $D=2$, Takahashi's objective is not yet achieved.\nJust after the first operation, the container has $7$ cyan balls and $3$ red balls. Since $7$ is greater than $3$ multiplied by $2$, the objective is still not achieved.\nJust after the second operation, the container has $9$ cyan balls and $6$ red balls. Since $9$ is not greater than $6$ multiplied by $2$, the objective is achieved.\nThus, the answer is $2$."],["6 9 2 3","\\-1\n\nNo matter how many times Takahashi repeats the operation, his objective will never be achieved."]],"created_at":"2026-03-03 11:01:14"}}