{"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":"\u003cstyle type\u003d\u0027text/css\u0027\u003e .input, .output {border: 1px solid #888888;} .output {margin-bottom:1em;position:relative;top:-1px;} .output pre,.input pre {background-color:#EFEFEF;line-height:1.25em;margin:0;padding:0.25em;} .title {background-color:#FFFFFF;border-bottom: 1px solid #888888;font-family:arial;font-weight:bold;padding:0.25em;} \u003c/style\u003e \u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027]], displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027]]}\n });\n \u003c/script\u003e\n \u003cscript type\u003d\"text/javascript\" async\n src\u003d\"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\"\u003e\n \u003c/script\u003e\n\u003cp\u003eTwo ant fall in love with each other.\u003c/p\u003e\n\u003cp\u003edebananda noticed that they want to go for their first date . The positions of the two ants can be represented as integer coordinates on a horizontal line. The male ant is currently on position x, and the female ant is currently on position y (x \u003c y).There is a problem. Every second, each ant hops to another position. The male ant hops to the positive direction by a, and the female ant hops to the negative direction by b.\u003c/p\u003e \n\u003cp\u003eFor example, let\u0027s say x\u003d0, y\u003d10, a\u003d2, and b\u003d3. At the 1st second, each ant will be at position 2 and 7. At the 2nd second, both ants will be at position 4.\u003c/p\u003e\n\u003cp\u003edebananda is now wondering: Will the two ants can be at the same position for their first date at the same moment? If so, how long will it take? Let\u0027s find a moment in time (in seconds) after which the ants will be at the same point.\u003c/p\u003e\n"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eEach test contains one or more test cases. The first line contains the number of test cases t (1 \u003c\u003d t \u003c\u003d 1000).\u003c/p\u003e\n\u003cp\u003eEach test case contains exactly one line. The line consists of four integers x, y, a, b (0 \u003c\u003d x \u003c y \u003c\u003d 10^9, 1 \u003c\u003d a,b \u003c\u003d 10^9) — the current position of the male ant, the current position of the female ant, the hopping distance of the male ant, and the hopping distance of the female ant, respectively.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, print the single integer: number of seconds the two ants will take to be at the same position for their first date.\u003c/p\u003e\n\u003cp\u003eIf the two ants will never be at the same position for the date simultaneously, print -1.\u003c/p\u003e"}},{"title":"Example","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\u003e5\n0 10 2 3\n0 10 3 3\n900000000 1000000000 1 9999999\n1 2 1 1\n1 3 1 1\n\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\u003e2\n-1\n10\n-1\n1\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThe first case is explained in the description.\u003c/p\u003e\n\u003cp\u003eIn the second case, each ants will be at position 3 and 7 respectively at the 1st second. But in the 2nd second they will be at 6 and 4 respectively, and we can see that they will never be at the same position since the distance between the two ants will only increase afterward.\u003c/p\u003e"}}]}