{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\"text/css\"\u003e pre { text-align:left; font-family: \"Courier New\", Courier, monospace; font-size: 16px; white-space: pre; line-height:20px; text-indent: 0px; }\u003c/style\u003e\u003cdiv class\u003d\"pro_desc\"\u003e\n \u003cp\u003eXzz need to calculate Intersection over Union(IoU) of two rectangles, can you help him? \u003c/p\u003e\n \u003cp\u003erectangle (x, y, w, h) means a rectangle MNPQ, M(x,y), N(x, y+h), P(x+w, y+h), Q(x+w, y). \u003c/p\u003e\n \u003cp\u003eIoU \u003d Area of overlap / Area of union. \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"pro_desc\"\u003e\n \u003cp\u003eFirst line of the input file contains an integer T(0 \u0026lt; T \u0026lt;\u003d 100) that indicates how many cases of inputs are there. \u003c/p\u003e\n \u003cp\u003eThe description of each case is given below: \u003c/p\u003e\n \u003cp\u003eThe first line of each input set contains integer x1, y1, w1, h1. \u003c/p\u003e\n \u003cp\u003eThe second line of each input set contains integer x2, y2, w2, h2. \u003c/p\u003e\n \u003cp\u003e0 ≤ x, y, w, h ≤ 100000 \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"pro_desc\"\u003e\n \u003cp\u003eThe description of output for each test case is given below: \u003c/p\u003e\n \u003cp\u003eThe first line of the output for each test case contains number k- the IoU of two rectangles. \u003c/p\u003e\n \u003cp\u003eOutput should be rounded to 2 digits after decimal point. \u003c/p\u003e\n\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\r\n1 1 1 1\r\n1 1 2 2\r\n1 1 2 1\r\n1 1 1 2\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e0.25\r\n0.33\u003c/pre\u003e"}}]}