{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"### Read problems statements in [Mandarin Chinese](https://www.codechef.com/download/translated/COOK127/mandarin/WEIGHTBL.pdf), [Russian](https://www.codechef.com/download/translated/COOK127/russian/WEIGHTBL.pdf), [Vietnamese](https://www.codechef.com/download/translated/COOK127/vietnamese/WEIGHTBL.pdf), and [Bengali](https://www.codechef.com/download/translated/COOK127/bengali/WEIGHTBL.pdf) as well.\r\n\r\nNo play and eating all day makes your belly fat. This happened to Chef during the lockdown. His weight before the lockdown was $w_1$ kg (measured on the most accurate hospital machine) and after $M$ months of lockdown, when he measured his weight at home (on a regular scale, which can be inaccurate), he got the result that his weight was $w_2$ kg ($w_2 \\gt w_1$).\r\n\r\nScientific research in all growing kids shows that their weights increase by a value between $x_1$ and $x_2$ kg (inclusive) per month, but not necessarily the same value each month. Chef assumes that he is a growing kid. Tell him whether his home scale could be giving correct results.\r\n\r\n### Input\r\n- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.\r\n- The first and only line of each test case contains five space-separated integers $w_1$, $w_2$, $x_1$, $x_2$ and $M$. \r\n\r\n### Output\r\nFor each test case, print a single line containing the integer $1$ if the result shown by the scale can be correct or $0$ if it cannot.\r\n\r\n### Constraints\r\n- $1 \\leq T \\leq 10^5$\r\n- $1 \\leq w_1 \\lt w_2 \\leq 100$\r\n- $0 \\leq x_1 \\leq x_2 \\leq 10$\r\n- $1 \\leq M \\leq 10$"}},{"title":"Sample 1","value":{"format":"MD","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\u003e5\r\n1 2 1 2 2\r\n2 4 1 2 2\r\n4 8 1 2 2\r\n5 8 1 2 2\r\n1 100 1 2 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n1\r\n1\r\n1\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n**Example case 1:** Since the increase in Chef\u0027s weight is $2 - 1 \u003d 1$ kg and that is less than the minimum possible increase $1 \\cdot 2 \u003d 2$ kg, the scale must be faulty.\r\n\r\n**Example case 2:** Since the increase in Chef\u0027s weight is $4 - 2 \u003d 2$ kg, which is equal to the minimum possible increase $1 \\cdot 2 \u003d 2$ kg, the scale is showing correct results.\r\n\r\n**Example case 3:** Since the increase in Chef\u0027s weight is $8 - 4 \u003d 4$ kg, which is equal to the maximum possible increase $2 \\cdot 2 \u003d 4$ kg, the scale is showing correct results.\r\n\r\n**Example case 4:** Since the increase in Chef\u0027s weight $8 - 5 \u003d 3$ kg lies in the interval $[1 \\cdot 2, 2 \\cdot 2]$ kg, the scale is showing correct results.\r\n\r\n**Example case 5:** Since the increase in Chef\u0027s weight is $100 - 1 \u003d 99$ kg and that is more than the maximum possible increase $2 \\cdot 2 \u003d 4$ kg, the weight balance must be faulty."}}]}