(I2
I149
I4
(dp0
Vsquares.%l
p1
(Vmain.cpp
p2
S'#include <cstdio>\r\n#include <vector>\r\n#include <algorithm>\r\n\r\nusing namespace std;\r\n\r\nconst int nmax = 9;\r\n\r\nstruct point\r\n{\r\n\tint x, y;\r\n\tpoint() {x=y=0;}\r\n\tpoint(int a, int b){x=a;y=b;}\r\n};\r\n\r\nstruct square\r\n{\r\n\tpoint x, y;\r\n\tsquare(){x=point();y=point();}\r\n\tsquare(point a, point b){x=a;y=b;}\r\n};\r\n\r\nvector <square> a;\r\n\r\nint main()\r\n{\r\n//    freopen("test.in", "r", stdin);\r\n//    freopen("test.out", "w", stdout);\r\n    int n;\r\n    scanf("%d", &n);\r\n    for(int i=0; i<n; i++)\r\n\t{\r\n\t\tint c1, c2, x, y;\r\n\t\tscanf("%d%d%d%d", &c1, &c2, &x, &y);\r\n\t\tpoint A = point(x, y);\r\n\t\tpoint B = point(2*c1-x, 2*c2-y);\r\n\t\tif(A.x>B.x)swap(A.x, B.x);\r\n\t\tif(A.y>B.y)swap(A.y, B.y);\r\n\t\ta.push_back(square(A, B));\r\n\t}\r\n\tint lim = (1<<n);\r\n\tint ans = 0;\r\n\tfor(int i=1; i<lim; i++)\r\n\t{\r\n\t\tint x = i;\r\n\t\tsquare tmp(point(-200, -200), point(200, 2000));\r\n\t\tint Area = 2000000000;\r\n\t\tint j = 0, nrbits = 0;\r\n\t\twhile(x)\r\n\t\t{\r\n\t\t\tif(x&1)\r\n\t\t\t{\r\n\t\t\t\tint x1 = max(tmp.x.x, a[j].x.x);\r\n\t\t\t\tint x2 = min(tmp.y.x, a[j].y.x);\r\n\t\t\t\tint y1 = max(tmp.x.y, a[j].x.y);\r\n\t\t\t\tint y2 = min(tmp.y.y, a[j].y.y);\r\n\t\t\t\tif(x1>=x2 || y1>=y2)\r\n\t\t\t\t{\r\n\t\t\t\t\tArea = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\ttmp = square(point(x1, y1), point(x2, y2));\r\n\t\t\t\tnrbits++;\r\n\t\t\t}\r\n\t\t\tx>>=1;\r\n\t\t\tj++;\r\n\t\t}\r\n\t\tif(Area!=0)\r\n\t\t{\r\n\t\t\tArea = (tmp.y.x-tmp.x.x)*(tmp.y.y-tmp.x.y);\r\n\t\t\tif(nrbits%2==0)ans-=Area;\r\n\t\t\telse ans+=Area;\r\n\t\t}\r\n\t}\r\n\tprintf("%d\\n", ans);\r\n    return 0;\r\n}\r\n'
p3
tp4
stp5
.