(I2
I165
I4
(dp0
Vsquares.%l
p1
(Vkvadrati.cpp
p2
S'#include <iostream>\r\n#include <vector>\r\n#include <algorithm>\r\n#include <math.h>\r\nusing namespace std;\r\nvector<int> centrix;\r\nvector<int> centriy;\r\nvector<int> str;\r\n//vector<vector<bool> > t;\r\nint n, p;\r\n\r\n//int djg(int r)\r\n//{\r\n//    return 8*(r*r);\r\n//}\r\n\r\nvoid presek(int ox, int oy, int d, int ox1, int oy1, int d1)\r\n{\r\n    if((ox<ox1 && ox+d<ox1-d1)||(ox > ox1 && ox-d > ox1 + d1)|| (oy<oy1&& oy+d< oy1 - d1) || (oy> oy1 && oy-d > oy1 + d1))\r\n        return;\r\n        //cout << "dada";\r\n    int x,  y;\r\n    int ax = min(ox1 + d1, ox+d);\r\n    int bx = max(ox-d, ox1 - d1);\r\n    x = ax - bx;\r\n    int ay = min(oy+d, oy1 + d1);\r\n    int by= max (oy-d, oy1-d1);\r\n    y = ay - by;\r\n    p-= x*y;\r\n   // cout << ax << " "<<ay << " "<<bx << " " << by << " " << x*y;\r\n\r\n\r\n}\r\n\r\n\r\nint main()\r\n{\r\n   int n;\r\n   cin >> n;\r\n  centrix.resize(n);\r\n centriy.resize(n);\r\n str.resize(n);\r\n   // t.resize(102, vector<bool>(102, false));\r\n   for(int i=0; i<n; i++)\r\n   {\r\n       int c1,c2,a1,a2;\r\n//       cin >> centrix[i] >> centriy[i] >> a >> b;\r\n//\r\n        cin >> c1 >> c2 >> a1 >> a2;\r\n        int r = abs(c1-a1);\r\n//        for(int i=c1-r; i<c1+r; i++)\r\n//        {\r\n//            for(int j = c2 -r; j<c2+r; j++)\r\n//            {\r\n//                t[i+50][j+50] = true;\r\n//\r\n//            }\r\n//        }\r\n            centrix[i]=c1;\r\n            centriy[i] = c2;\r\n\r\n      str[i] =r;\r\n\r\n       p+= 4*r*r;\r\n\r\n   }\r\n\r\n//   for(int i=0; i<102; i++)\r\n//   {\r\n//       for(int j=0; j<102; j++)\r\n//       {\r\n//           if(t[i][j])\r\n//            p++;\r\n//       }\r\n//   }\r\n   for(int i=0; i<n; i++)\r\n   {\r\n        for(int j =i+1; j<n; j++)\r\n        {\r\n            presek(centrix[i], centriy[i], str[i], centrix[j], centriy[j], str[j]);\r\n            //cout << "da";\r\n        }\r\n   }\r\n   cout << p;\r\n    return 0;\r\n}\r\n'
p3
tp4
stp5
.