fork download
  1. #include<stdio.h>
  2. #include<algorithm>
  3. #include<math.h>
  4. using namespace std;
  5. const double EPS=1e-10;
  6. const double INF=1e+10;
  7. const double PI=acos(-1);
  8. //
  9. // MEMO
  10. // ***
  11. // ***
  12. // .
  13. //
  14. // こういうケースの場合わけが足りていない。別に付け足そうと思う。左右反転が使える。真ん中の場合わけは3通り。
  15.  
  16.  
  17. // ここらへんに
  18. //   かつて
  19. // ライブラリがあった。
  20. int use[30];
  21. int main(){
  22. double r,x1,y1,x2,y2;
  23. while(scanf("%lf%lf%lf%lf%lf",&r,&x1,&y1,&x2,&y2)){
  24. if(r<0.5)break;
  25. if(y2<0){
  26. double c=y1;
  27. y1=-y2;
  28. y2=-c;
  29. }else if(y1<=0){
  30. double d=x1;
  31. double e=x2;
  32. x1=y1;
  33. x2=y2;
  34. if(x2<0){
  35. y1=-e;
  36. y2=-d;
  37. }else{
  38. y1=d;
  39. y2=e;
  40. }
  41. }
  42. if(x2<0){
  43. double c=x2;
  44. x2=-x1;
  45. x1=-c;
  46. }
  47. double ret=0;
  48. double L[5];
  49. double R[5];
  50. for(int i=0;i<5;i++)L[i]=R[i]=0;
  51. L[0]=r;
  52. R[0]=r;
  53. int ls=1;
  54. int rs=1;
  55. ret+=r*PI;
  56. if(dSP(Pt(x1,y1),Pt(x2,y1),Pt(0,0))>r){
  57. use[0]++;
  58. ret+=r*PI;
  59. goto end;
  60. }
  61. if(x1>0){
  62. ls++;
  63. if(Pt(x1,y2).Abs()<r){
  64. L[ls++]=r-Pt(x1,y2).Abs();
  65. if(L[2]>x2-x1){
  66. L[ls++]=L[2]-(x2-x1);
  67. if(L[3]>y2-y1){
  68. L[ls++]=L[3]-(y2-y1);
  69. }
  70. }
  71. }
  72. if(Pt(x2,y1).Abs()<r){
  73. R[rs++]=r-Pt(x2,y1).Abs();
  74. if(R[1]>y2-y1){
  75. R[rs++]=R[1]-(y2-y1);
  76. if(R[2]>x2-x1){
  77. R[rs++]=R[2]-(x2-x1);
  78. if(R[3]>y2-y1){
  79. R[rs++]=R[3]-(y2-y1);
  80. }
  81. }
  82. }
  83. }
  84. if(ls>2&&rs>2&&iCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2])==1){
  85. use[1]++; pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
  86. if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
  87. Pt q=W.first;
  88. Pt pL=q-Pt(x1,y2);
  89. Pt pR=q-Pt(x2,y2);
  90. ret+=(PI-atan2(y2,x1))*r;
  91. ret+=(atan2(y1,x2))*r;
  92. ret+=(PI/2-atan2(y1,x2))*R[1];
  93. ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
  94. ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
  95. goto end;
  96. }
  97. if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
  98. Pt q=W.second;
  99. Pt pL=q-Pt(x1,y2);
  100. Pt pR=q-Pt(x2,y2);
  101. ret+=(PI-atan2(y2,x1))*r;
  102. ret+=(atan2(y1,x2))*r;
  103. ret+=(PI/2-atan2(y1,x2))*R[1];
  104. ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
  105. ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
  106. goto end;
  107. }
  108. }
  109. if(ls>2&&rs>1&&iCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1])==1){
  110. use[2]++; pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
  111. if(W.first.x>x2&&W.first.y>y2){
  112. Pt q=W.first;
  113. Pt pL=q-Pt(x1,y2);
  114. Pt pR=q-Pt(x2,y1);
  115. ret+=(PI-atan2(y2,x1))*r;
  116. ret+=(atan2(y1,x2))*r;
  117. ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
  118. ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
  119. goto end;
  120. }
  121. if(W.second.x>x2&&W.second.y>y2){
  122. Pt q=W.second;
  123. Pt pL=q-Pt(x1,y2);
  124. Pt pR=q-Pt(x2,y1);
  125. ret+=(PI-atan2(y2,x1))*r;
  126. ret+=(atan2(y1,x2))*r;
  127. ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
  128. ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
  129. goto end;
  130. }
  131. }
  132. if(ls>3&&rs>1&&iCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1])==1){
  133. use[3]++; pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
  134. if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
  135. Pt q=W.first;
  136. Pt pL=q-Pt(x2,y2);
  137. Pt pR=q-Pt(x2,y1);
  138. ret+=(PI-atan2(y2,x1))*r;
  139. ret+=(atan2(y1,x2))*r;
  140. ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
  141. ret+=(atan2(y2,x1))*L[2];
  142. ret+=(-atan2(pL.y,pL.x))*L[3];
  143. goto end;
  144. }
  145. if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
  146. Pt q=W.second;
  147. Pt pL=q-Pt(x2,y2);
  148. Pt pR=q-Pt(x2,y1);
  149. ret+=(PI-atan2(y2,x1))*r;
  150. ret+=(atan2(y1,x2))*r;
  151. ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
  152. ret+=(atan2(y2,x1))*L[2];
  153. ret+=(-atan2(pL.y,pL.x))*L[3];
  154. goto end;
  155. }
  156. }
  157.  
  158. if(Pt(x1,y2).Abs()>r){
  159. use[4]++; pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x1,y2));
  160. if(D.first.y>0){
  161. ret+=(PI-atan2(D.first.y,D.first.x))*r;
  162. }else ret+=(PI-atan2(D.second.y,D.second.x))*r;
  163. }else{
  164. use[5]++; ret+=(PI-atan2(y2,x1))*r;
  165. ret+=(atan2(y2,x1))*L[2];
  166. ret+=PI/2*L[3];
  167. }
  168. if(Pt(x2,y1).Abs()>r){
  169. use[6]++; pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
  170. if(D.first.x>D.second.x){
  171. ret+=(atan2(D.first.y,D.first.x))*r;
  172. }else{
  173. ret+=(atan2(D.second.y,D.second.x))*r;
  174. }
  175. }else{
  176. use[7]++; ret+=(atan2(y1,x2))*r;
  177. ret+=(PI/2-atan2(y1,x2))*R[1];
  178. ret+=PI/2*R[2];
  179. ret+=PI/2*R[3];
  180. }
  181. goto end;
  182. }
  183. if(Pt(x1,y1).Abs()<r){
  184. L[ls++]=r-Pt(x1,y1).Abs();
  185. if(L[1]>y2-y1){
  186. L[ls++]=L[1]-(y2-y1);
  187. if(L[2]>x2-x1){
  188. L[ls++]=L[2]-(x2-x1);
  189. if(L[3]>y2-y1){
  190. L[ls++]=L[3]-(y2-y1);
  191. }
  192. }
  193. }
  194. }
  195. if(Pt(x2,y1).Abs()<r){
  196. R[rs++]=r-Pt(x2,y1).Abs();
  197. if(R[1]>y2-y1){
  198. R[rs++]=R[1]-(y2-y1);
  199. if(R[2]>x2-x1){
  200. R[rs++]=R[2]-(x2-x1);
  201. if(R[3]>y2-y1){
  202. R[rs++]=R[3]-(y2-y1);
  203. }
  204. }
  205. }
  206. }
  207.  
  208. if(ls>1&&rs>2&&iCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2])==1){
  209. use[8]++; pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2]);
  210. if(W.first.x<x1&&W.first.y>y2){
  211. Pt q=W.first;
  212. Pt pL=q-Pt(x1,y1);
  213. Pt pR=q-Pt(x2,y2);
  214. ret+=(PI-atan2(y1,x1))*r;
  215. ret+=(atan2(y1,x2))*r;
  216. ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
  217. ret+=(PI/2-atan2(y1,x2))*R[1];
  218. ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
  219. goto end;
  220. }
  221. if(W.second.x<x1&&W.second.y>y2){
  222. Pt q=W.second;
  223. Pt pL=q-Pt(x1,y1);
  224. Pt pR=q-Pt(x2,y2);
  225. ret+=(PI-atan2(y1,x1))*r;
  226. ret+=(atan2(y1,x2))*r;
  227. ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
  228. ret+=(PI/2-atan2(y1,x2))*R[1];
  229. ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
  230. goto end;
  231. }
  232. }
  233. if(ls>1&&rs>3&&iCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3])==1){
  234. use[9]++; pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3]);
  235. if(W.first.x<x1&&W.first.y>y1&&W.first.y<y2){
  236. Pt q=W.first;
  237. Pt pL=q-Pt(x1,y1);
  238. Pt pR=q-Pt(x1,y2);
  239. ret+=(PI-atan2(y1,x1))*r;
  240. ret+=(atan2(y1,x2))*r;
  241. ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
  242. ret+=(PI/2-atan2(y1,x2))*R[1];
  243. ret+=PI/2*R[2];
  244. ret+=(atan2(pR.y,pR.x)-PI)*R[3];
  245. goto end;
  246. }
  247. if(W.second.x<x1&&W.second.y>y1&&W.second.y<y2){
  248. Pt q=W.second;
  249. Pt pL=q-Pt(x1,y1);
  250. Pt pR=q-Pt(x1,y2);
  251. ret+=(PI-atan2(y1,x1))*r;
  252. ret+=(atan2(y1,x2))*r;
  253. ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
  254. ret+=(PI/2-atan2(y1,x2))*R[1];
  255. ret+=PI/2*R[2];
  256. ret+=(atan2(pR.y,pR.x)-PI)*R[3];
  257. goto end;
  258. }
  259. }
  260. if(ls>2&&rs>1&&iCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1])==1){
  261. use[10]++; pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
  262. if(W.first.x>x2&&W.first.y>y2){
  263. Pt q=W.first;
  264. Pt pL=q-Pt(x1,y2);
  265. Pt pR=q-Pt(x2,y1);
  266. ret+=(PI-atan2(y1,x1))*r;
  267. ret+=(atan2(y1,x2))*r;
  268. ret+=(atan2(y1,x1)-PI/2)*L[1];
  269. ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
  270. ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
  271. goto end;
  272. }
  273. if(W.second.x>x2&&W.second.y>y2){
  274. Pt q=W.second;
  275. Pt pL=q-Pt(x1,y2);
  276. Pt pR=q-Pt(x2,y1);
  277. ret+=(PI-atan2(y1,x1))*r;
  278. ret+=(atan2(y1,x2))*r;
  279. ret+=(atan2(y1,x1)-PI/2)*L[1];
  280. ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
  281. ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
  282. goto end;
  283. }
  284. }
  285. if(ls>2&&rs>2&&iCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2])==1){
  286. use[11]++; pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
  287. if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
  288. Pt q=W.first;
  289. Pt pL=q-Pt(x1,y2);
  290. Pt pR=q-Pt(x2,y2);
  291. ret+=(PI-atan2(y1,x1))*r;
  292. ret+=(atan2(y1,x2))*r;
  293. ret+=(atan2(y1,x1)-PI/2)*L[1];
  294. ret+=(PI/2-atan2(y1,x2))*R[1];
  295. ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
  296. ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
  297. goto end;
  298. }
  299. if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
  300. Pt q=W.second;
  301. Pt pL=q-Pt(x1,y2);
  302. Pt pR=q-Pt(x2,y2);
  303. ret+=(PI-atan2(y1,x1))*r;
  304. ret+=(atan2(y1,x2))*r;
  305. ret+=(atan2(y1,x1)-PI/2)*L[1];
  306. ret+=(PI/2-atan2(y1,x2))*R[1];
  307. ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
  308. ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
  309. goto end;
  310. }
  311. }
  312. if(ls>3&&rs>1&&iCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1])==1){
  313. use[12]++; pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
  314. if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
  315. Pt q=W.first;
  316. Pt pL=q-Pt(x2,y2);
  317. Pt pR=q-Pt(x2,y1);
  318. ret+=(PI-atan2(y1,x1))*r;
  319. ret+=(atan2(y1,x2))*r;
  320. ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
  321. ret+=(atan2(y1,x1)-PI/2)*L[1];
  322. ret+=PI/2*L[2];
  323. ret+=(-atan2(pL.y,pL.x))*L[3];
  324. goto end;
  325. }
  326. if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
  327. Pt q=W.second;
  328. Pt pL=q-Pt(x2,y2);
  329. Pt pR=q-Pt(x2,y1);
  330. ret+=(PI-atan2(y1,x1))*r;
  331. ret+=(atan2(y1,x2))*r;
  332. ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
  333. ret+=(atan2(y1,x1)-PI/2)*L[1];
  334. ret+=PI/2*L[2];
  335. ret+=(-atan2(pL.y,pL.x))*L[3];
  336. goto end;
  337. }
  338. }
  339. if(Pt(x1,y1).Abs()>r){
  340. use[13]++; pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
  341. if(D.first.x<D.second.x){
  342. ret+=(PI-atan2(D.first.y,D.first.x))*r;
  343. }else ret+=(PI-atan2(D.second.y,D.second.x))*r;
  344. }else{
  345. use[14]++; ret+=(PI-atan2(y1,x1))*r;
  346. ret+=(atan2(y1,x1)-PI/2)*L[1];
  347. ret+=PI/2*L[2];
  348. ret+=PI/2*L[3];
  349. }
  350. if(Pt(x2,y1).Abs()>r){
  351. use[15]++; pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
  352. if(D.first.x>D.second.x){
  353. ret+=(atan2(D.first.y,D.first.x))*r;
  354. }else{
  355. ret+=(atan2(D.second.y,D.second.x))*r;
  356. }
  357. }else{
  358. use[16]++; ret+=(atan2(y1,x2))*r;
  359. ret+=(PI/2-atan2(y1,x2))*R[1];
  360. ret+=PI/2*R[2];
  361. ret+=PI/2*R[3];
  362. }
  363. end:;
  364. printf("%.8f\n",ret);
  365. }
  366. // for(int i=0;i<17;i++)printf("%d ",use[i]);
  367. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:56:18: error: ‘Pt’ was not declared in this scope
   if(dSP(Pt(x1,y1),Pt(x2,y1),Pt(0,0))>r){
                  ^
prog.cpp:56:37: error: ‘dSP’ was not declared in this scope
   if(dSP(Pt(x1,y1),Pt(x2,y1),Pt(0,0))>r){
                                     ^
prog.cpp:63:15: error: ‘Pt’ was not declared in this scope
    if(Pt(x1,y2).Abs()<r){
               ^
prog.cpp:72:15: error: ‘Pt’ was not declared in this scope
    if(Pt(x2,y1).Abs()<r){
               ^
prog.cpp:84:31: error: ‘Pt’ was not declared in this scope
    if(ls>2&&rs>2&&iCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2])==1){
                               ^
prog.cpp:84:52: error: ‘iCC’ was not declared in this scope
    if(ls>2&&rs>2&&iCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2])==1){
                                                    ^
prog.cpp:85:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[1]++;    pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
                        ^
prog.cpp:85:24: error:   expected a type, got ‘Pt’
prog.cpp:85:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:85:24: error:   expected a type, got ‘Pt’
prog.cpp:85:27: error: invalid type in declaration before ‘=’ token
 use[1]++;    pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
                           ^
prog.cpp:85:61: error: ‘pCC’ was not declared in this scope
 use[1]++;    pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
                                                             ^
prog.cpp:86:10: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
          ^
prog.cpp:86:24: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
                        ^
prog.cpp:86:38: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
                                      ^
prog.cpp:87:9: error: expected ‘;’ before ‘q’
      Pt q=W.first;
         ^
prog.cpp:88:9: error: expected ‘;’ before ‘pL’
      Pt pL=q-Pt(x1,y2);
         ^
prog.cpp:89:9: error: expected ‘;’ before ‘pR’
      Pt pR=q-Pt(x2,y2);
         ^
prog.cpp:93:18: error: ‘pR’ was not declared in this scope
      ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
                  ^
prog.cpp:94:31: error: ‘pL’ was not declared in this scope
      ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
                               ^
prog.cpp:97:10: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
          ^
prog.cpp:97:25: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
                         ^
prog.cpp:97:40: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
                                        ^
prog.cpp:98:9: error: expected ‘;’ before ‘q’
      Pt q=W.second;
         ^
prog.cpp:99:9: error: expected ‘;’ before ‘pL’
      Pt pL=q-Pt(x1,y2);
         ^
prog.cpp:100:9: error: expected ‘;’ before ‘pR’
      Pt pR=q-Pt(x2,y2);
         ^
prog.cpp:104:18: error: ‘pR’ was not declared in this scope
      ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
                  ^
prog.cpp:105:31: error: ‘pL’ was not declared in this scope
      ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
                               ^
prog.cpp:109:31: error: ‘Pt’ was not declared in this scope
    if(ls>2&&rs>1&&iCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1])==1){
                               ^
prog.cpp:109:52: error: ‘iCC’ was not declared in this scope
    if(ls>2&&rs>1&&iCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1])==1){
                                                    ^
prog.cpp:110:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[2]++;    pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
                        ^
prog.cpp:110:24: error:   expected a type, got ‘Pt’
prog.cpp:110:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:110:24: error:   expected a type, got ‘Pt’
prog.cpp:110:27: error: invalid type in declaration before ‘=’ token
 use[2]++;    pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
                           ^
prog.cpp:110:61: error: ‘pCC’ was not declared in this scope
 use[2]++;    pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
                                                             ^
prog.cpp:111:10: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x>x2&&W.first.y>y2){
          ^
prog.cpp:111:24: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x>x2&&W.first.y>y2){
                        ^
prog.cpp:112:9: error: expected ‘;’ before ‘q’
      Pt q=W.first;
         ^
prog.cpp:113:9: error: expected ‘;’ before ‘pL’
      Pt pL=q-Pt(x1,y2);
         ^
prog.cpp:114:9: error: expected ‘;’ before ‘pR’
      Pt pR=q-Pt(x2,y1);
         ^
prog.cpp:117:18: error: ‘pR’ was not declared in this scope
      ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
                  ^
prog.cpp:118:31: error: ‘pL’ was not declared in this scope
      ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
                               ^
prog.cpp:121:10: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x>x2&&W.second.y>y2){
          ^
prog.cpp:121:25: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x>x2&&W.second.y>y2){
                         ^
prog.cpp:122:9: error: expected ‘;’ before ‘q’
      Pt q=W.second;
         ^
prog.cpp:123:9: error: expected ‘;’ before ‘pL’
      Pt pL=q-Pt(x1,y2);
         ^
prog.cpp:124:9: error: expected ‘;’ before ‘pR’
      Pt pR=q-Pt(x2,y1);
         ^
prog.cpp:127:18: error: ‘pR’ was not declared in this scope
      ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
                  ^
prog.cpp:128:31: error: ‘pL’ was not declared in this scope
      ret+=(atan2(y2,x1)-atan2(pL.y,pL.x))*L[2];
                               ^
prog.cpp:132:31: error: ‘Pt’ was not declared in this scope
    if(ls>3&&rs>1&&iCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1])==1){
                               ^
prog.cpp:132:52: error: ‘iCC’ was not declared in this scope
    if(ls>3&&rs>1&&iCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1])==1){
                                                    ^
prog.cpp:133:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[3]++;    pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
                        ^
prog.cpp:133:24: error:   expected a type, got ‘Pt’
prog.cpp:133:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:133:24: error:   expected a type, got ‘Pt’
prog.cpp:133:27: error: invalid type in declaration before ‘=’ token
 use[3]++;    pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
                           ^
prog.cpp:133:61: error: ‘pCC’ was not declared in this scope
 use[3]++;    pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
                                                             ^
prog.cpp:134:10: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
          ^
prog.cpp:134:24: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
                        ^
prog.cpp:134:38: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
     if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
                                      ^
prog.cpp:135:9: error: expected ‘;’ before ‘q’
      Pt q=W.first;
         ^
prog.cpp:136:9: error: expected ‘;’ before ‘pL’
      Pt pL=q-Pt(x2,y2);
         ^
prog.cpp:137:9: error: expected ‘;’ before ‘pR’
      Pt pR=q-Pt(x2,y1);
         ^
prog.cpp:140:32: error: ‘pR’ was not declared in this scope
      ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
                                ^
prog.cpp:142:19: error: ‘pL’ was not declared in this scope
      ret+=(-atan2(pL.y,pL.x))*L[3];
                   ^
prog.cpp:145:10: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
          ^
prog.cpp:145:25: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
                         ^
prog.cpp:145:40: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
     if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
                                        ^
prog.cpp:146:9: error: expected ‘;’ before ‘q’
      Pt q=W.second;
         ^
prog.cpp:147:9: error: expected ‘;’ before ‘pL’
      Pt pL=q-Pt(x2,y2);
         ^
prog.cpp:148:9: error: expected ‘;’ before ‘pR’
      Pt pR=q-Pt(x2,y1);
         ^
prog.cpp:151:32: error: ‘pR’ was not declared in this scope
      ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
                                ^
prog.cpp:153:19: error: ‘pL’ was not declared in this scope
      ret+=(-atan2(pL.y,pL.x))*L[3];
                   ^
prog.cpp:158:15: error: ‘Pt’ was not declared in this scope
    if(Pt(x1,y2).Abs()>r){
               ^
prog.cpp:159:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[4]++;    pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x1,y2));
                        ^
prog.cpp:159:24: error:   expected a type, got ‘Pt’
prog.cpp:159:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:159:24: error:   expected a type, got ‘Pt’
prog.cpp:159:27: error: invalid type in declaration before ‘=’ token
 use[4]++;    pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x1,y2));
                           ^
prog.cpp:159:61: error: ‘pCL’ was not declared in this scope
 use[4]++;    pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x1,y2));
                                                             ^
prog.cpp:160:10: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
     if(D.first.y>0){
          ^
prog.cpp:161:23: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
      ret+=(PI-atan2(D.first.y,D.first.x))*r;
                       ^
prog.cpp:161:33: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
      ret+=(PI-atan2(D.first.y,D.first.x))*r;
                                 ^
prog.cpp:162:28: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
     }else ret+=(PI-atan2(D.second.y,D.second.x))*r;
                            ^
prog.cpp:162:39: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
     }else ret+=(PI-atan2(D.second.y,D.second.x))*r;
                                       ^
prog.cpp:168:15: error: ‘Pt’ was not declared in this scope
    if(Pt(x2,y1).Abs()>r){
               ^
prog.cpp:169:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[6]++;    pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                        ^
prog.cpp:169:24: error:   expected a type, got ‘Pt’
prog.cpp:169:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:169:24: error:   expected a type, got ‘Pt’
prog.cpp:169:27: error: invalid type in declaration before ‘=’ token
 use[6]++;    pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                           ^
prog.cpp:169:61: error: ‘pCL’ was not declared in this scope
 use[6]++;    pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                                                             ^
prog.cpp:170:10: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
     if(D.first.x>D.second.x){
          ^
prog.cpp:170:20: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
     if(D.first.x>D.second.x){
                    ^
prog.cpp:171:20: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
      ret+=(atan2(D.first.y,D.first.x))*r;
                    ^
prog.cpp:171:30: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
      ret+=(atan2(D.first.y,D.first.x))*r;
                              ^
prog.cpp:173:20: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
      ret+=(atan2(D.second.y,D.second.x))*r;
                    ^
prog.cpp:173:31: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
      ret+=(atan2(D.second.y,D.second.x))*r;
                               ^
prog.cpp:183:14: error: ‘Pt’ was not declared in this scope
   if(Pt(x1,y1).Abs()<r){
              ^
prog.cpp:195:14: error: ‘Pt’ was not declared in this scope
   if(Pt(x2,y1).Abs()<r){
              ^
prog.cpp:208:30: error: ‘Pt’ was not declared in this scope
   if(ls>1&&rs>2&&iCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2])==1){
                              ^
prog.cpp:208:51: error: ‘iCC’ was not declared in this scope
   if(ls>1&&rs>2&&iCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2])==1){
                                                   ^
prog.cpp:209:23: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[8]++;   pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2]);
                       ^
prog.cpp:209:23: error:   expected a type, got ‘Pt’
prog.cpp:209:23: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:209:23: error:   expected a type, got ‘Pt’
prog.cpp:209:26: error: invalid type in declaration before ‘=’ token
 use[8]++;   pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2]);
                          ^
prog.cpp:209:60: error: ‘pCC’ was not declared in this scope
 use[8]++;   pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x2,y2),R[2]);
                                                            ^
prog.cpp:210:9: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x1&&W.first.y>y2){
         ^
prog.cpp:210:23: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x1&&W.first.y>y2){
                       ^
prog.cpp:211:8: error: expected ‘;’ before ‘q’
     Pt q=W.first;
        ^
prog.cpp:212:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y1);
        ^
prog.cpp:213:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y2);
        ^
prog.cpp:216:30: error: ‘pL’ was not declared in this scope
     ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
                              ^
prog.cpp:218:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
                 ^
prog.cpp:221:9: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x1&&W.second.y>y2){
         ^
prog.cpp:221:24: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x1&&W.second.y>y2){
                        ^
prog.cpp:222:8: error: expected ‘;’ before ‘q’
     Pt q=W.second;
        ^
prog.cpp:223:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y1);
        ^
prog.cpp:224:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y2);
        ^
prog.cpp:227:30: error: ‘pL’ was not declared in this scope
     ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
                              ^
prog.cpp:229:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
                 ^
prog.cpp:233:30: error: ‘Pt’ was not declared in this scope
   if(ls>1&&rs>3&&iCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3])==1){
                              ^
prog.cpp:233:51: error: ‘iCC’ was not declared in this scope
   if(ls>1&&rs>3&&iCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3])==1){
                                                   ^
prog.cpp:234:23: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[9]++;   pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3]);
                       ^
prog.cpp:234:23: error:   expected a type, got ‘Pt’
prog.cpp:234:23: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:234:23: error:   expected a type, got ‘Pt’
prog.cpp:234:26: error: invalid type in declaration before ‘=’ token
 use[9]++;   pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3]);
                          ^
prog.cpp:234:60: error: ‘pCC’ was not declared in this scope
 use[9]++;   pair<Pt,Pt> W=pCC(Pt(x1,y1),L[1],Pt(x1,y2),R[3]);
                                                            ^
prog.cpp:235:9: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x1&&W.first.y>y1&&W.first.y<y2){
         ^
prog.cpp:235:23: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x1&&W.first.y>y1&&W.first.y<y2){
                       ^
prog.cpp:235:37: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x1&&W.first.y>y1&&W.first.y<y2){
                                     ^
prog.cpp:236:8: error: expected ‘;’ before ‘q’
     Pt q=W.first;
        ^
prog.cpp:237:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y1);
        ^
prog.cpp:238:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x1,y2);
        ^
prog.cpp:241:30: error: ‘pL’ was not declared in this scope
     ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
                              ^
prog.cpp:244:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-PI)*R[3];
                 ^
prog.cpp:247:9: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x1&&W.second.y>y1&&W.second.y<y2){
         ^
prog.cpp:247:24: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x1&&W.second.y>y1&&W.second.y<y2){
                        ^
prog.cpp:247:39: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x1&&W.second.y>y1&&W.second.y<y2){
                                       ^
prog.cpp:248:8: error: expected ‘;’ before ‘q’
     Pt q=W.second;
        ^
prog.cpp:249:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y1);
        ^
prog.cpp:250:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x1,y2);
        ^
prog.cpp:253:30: error: ‘pL’ was not declared in this scope
     ret+=(atan2(y1,x1)-atan2(pL.y,pL.x))*L[1];
                              ^
prog.cpp:256:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-PI)*R[3];
                 ^
prog.cpp:260:30: error: ‘Pt’ was not declared in this scope
   if(ls>2&&rs>1&&iCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1])==1){
                              ^
prog.cpp:260:51: error: ‘iCC’ was not declared in this scope
   if(ls>2&&rs>1&&iCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1])==1){
                                                   ^
prog.cpp:261:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[10]++;   pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
                        ^
prog.cpp:261:24: error:   expected a type, got ‘Pt’
prog.cpp:261:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:261:24: error:   expected a type, got ‘Pt’
prog.cpp:261:27: error: invalid type in declaration before ‘=’ token
 use[10]++;   pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
                           ^
prog.cpp:261:61: error: ‘pCC’ was not declared in this scope
 use[10]++;   pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y1),R[1]);
                                                             ^
prog.cpp:262:9: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x>x2&&W.first.y>y2){
         ^
prog.cpp:262:23: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x>x2&&W.first.y>y2){
                       ^
prog.cpp:263:8: error: expected ‘;’ before ‘q’
     Pt q=W.first;
        ^
prog.cpp:264:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y2);
        ^
prog.cpp:265:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y1);
        ^
prog.cpp:269:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
                 ^
prog.cpp:270:22: error: ‘pL’ was not declared in this scope
     ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
                      ^
prog.cpp:273:9: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x>x2&&W.second.y>y2){
         ^
prog.cpp:273:24: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x>x2&&W.second.y>y2){
                        ^
prog.cpp:274:8: error: expected ‘;’ before ‘q’
     Pt q=W.second;
        ^
prog.cpp:275:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y2);
        ^
prog.cpp:276:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y1);
        ^
prog.cpp:280:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-atan2(y1,x2))*R[1];
                 ^
prog.cpp:281:22: error: ‘pL’ was not declared in this scope
     ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
                      ^
prog.cpp:285:30: error: ‘Pt’ was not declared in this scope
   if(ls>2&&rs>2&&iCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2])==1){
                              ^
prog.cpp:285:51: error: ‘iCC’ was not declared in this scope
   if(ls>2&&rs>2&&iCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2])==1){
                                                   ^
prog.cpp:286:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[11]++;   pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
                        ^
prog.cpp:286:24: error:   expected a type, got ‘Pt’
prog.cpp:286:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:286:24: error:   expected a type, got ‘Pt’
prog.cpp:286:27: error: invalid type in declaration before ‘=’ token
 use[11]++;   pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
                           ^
prog.cpp:286:61: error: ‘pCC’ was not declared in this scope
 use[11]++;   pair<Pt,Pt> W=pCC(Pt(x1,y2),L[2],Pt(x2,y2),R[2]);
                                                             ^
prog.cpp:287:9: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
         ^
prog.cpp:287:23: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
                       ^
prog.cpp:287:37: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x<x2&&W.first.x>x1&&W.first.y>y2){
                                     ^
prog.cpp:288:8: error: expected ‘;’ before ‘q’
     Pt q=W.first;
        ^
prog.cpp:289:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y2);
        ^
prog.cpp:290:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y2);
        ^
prog.cpp:295:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
                 ^
prog.cpp:296:22: error: ‘pL’ was not declared in this scope
     ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
                      ^
prog.cpp:299:9: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
         ^
prog.cpp:299:24: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
                        ^
prog.cpp:299:39: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x<x2&&W.second.x>x1&&W.second.y>y2){
                                       ^
prog.cpp:300:8: error: expected ‘;’ before ‘q’
     Pt q=W.second;
        ^
prog.cpp:301:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x1,y2);
        ^
prog.cpp:302:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y2);
        ^
prog.cpp:307:17: error: ‘pR’ was not declared in this scope
     ret+=(atan2(pR.y,pR.x)-PI/2)*R[2];
                 ^
prog.cpp:308:22: error: ‘pL’ was not declared in this scope
     ret+=(PI/2-atan2(pL.y,pL.x))*L[2];
                      ^
prog.cpp:312:30: error: ‘Pt’ was not declared in this scope
   if(ls>3&&rs>1&&iCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1])==1){
                              ^
prog.cpp:312:51: error: ‘iCC’ was not declared in this scope
   if(ls>3&&rs>1&&iCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1])==1){
                                                   ^
prog.cpp:313:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[12]++;   pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
                        ^
prog.cpp:313:24: error:   expected a type, got ‘Pt’
prog.cpp:313:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:313:24: error:   expected a type, got ‘Pt’
prog.cpp:313:27: error: invalid type in declaration before ‘=’ token
 use[12]++;   pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
                           ^
prog.cpp:313:61: error: ‘pCC’ was not declared in this scope
 use[12]++;   pair<Pt,Pt> W=pCC(Pt(x2,y2),L[3],Pt(x2,y1),R[1]);
                                                             ^
prog.cpp:314:9: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
         ^
prog.cpp:314:23: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
                       ^
prog.cpp:314:37: error: request for member ‘first’ in ‘W’, which is of non-class type ‘int’
    if(W.first.x>x2&&W.first.y>y1&&W.first.y<y2){
                                     ^
prog.cpp:315:8: error: expected ‘;’ before ‘q’
     Pt q=W.first;
        ^
prog.cpp:316:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x2,y2);
        ^
prog.cpp:317:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y1);
        ^
prog.cpp:320:31: error: ‘pR’ was not declared in this scope
     ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
                               ^
prog.cpp:323:18: error: ‘pL’ was not declared in this scope
     ret+=(-atan2(pL.y,pL.x))*L[3];
                  ^
prog.cpp:326:9: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
         ^
prog.cpp:326:24: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
                        ^
prog.cpp:326:39: error: request for member ‘second’ in ‘W’, which is of non-class type ‘int’
    if(W.second.x>x2&&W.second.y>y1&&W.second.y<y2){
                                       ^
prog.cpp:327:8: error: expected ‘;’ before ‘q’
     Pt q=W.second;
        ^
prog.cpp:328:8: error: expected ‘;’ before ‘pL’
     Pt pL=q-Pt(x2,y2);
        ^
prog.cpp:329:8: error: expected ‘;’ before ‘pR’
     Pt pR=q-Pt(x2,y1);
        ^
prog.cpp:332:31: error: ‘pR’ was not declared in this scope
     ret+=(-atan2(y1,x2)+atan2(pR.y,pR.x))*R[1];
                               ^
prog.cpp:335:18: error: ‘pL’ was not declared in this scope
     ret+=(-atan2(pL.y,pL.x))*L[3];
                  ^
prog.cpp:339:14: error: ‘Pt’ was not declared in this scope
   if(Pt(x1,y1).Abs()>r){
              ^
prog.cpp:340:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[13]++;   pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                        ^
prog.cpp:340:24: error:   expected a type, got ‘Pt’
prog.cpp:340:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:340:24: error:   expected a type, got ‘Pt’
prog.cpp:340:27: error: invalid type in declaration before ‘=’ token
 use[13]++;   pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                           ^
prog.cpp:340:61: error: ‘pCL’ was not declared in this scope
 use[13]++;   pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                                                             ^
prog.cpp:341:9: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
    if(D.first.x<D.second.x){
         ^
prog.cpp:341:19: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
    if(D.first.x<D.second.x){
                   ^
prog.cpp:342:22: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
     ret+=(PI-atan2(D.first.y,D.first.x))*r;
                      ^
prog.cpp:342:32: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
     ret+=(PI-atan2(D.first.y,D.first.x))*r;
                                ^
prog.cpp:343:27: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
    }else ret+=(PI-atan2(D.second.y,D.second.x))*r;
                           ^
prog.cpp:343:38: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
    }else ret+=(PI-atan2(D.second.y,D.second.x))*r;
                                      ^
prog.cpp:350:14: error: ‘Pt’ was not declared in this scope
   if(Pt(x2,y1).Abs()>r){
              ^
prog.cpp:351:24: error: type/value mismatch at argument 1 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
 use[15]++;   pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                        ^
prog.cpp:351:24: error:   expected a type, got ‘Pt’
prog.cpp:351:24: error: type/value mismatch at argument 2 in template parameter list for ‘template<class _T1, class _T2> struct std::pair’
prog.cpp:351:24: error:   expected a type, got ‘Pt’
prog.cpp:351:27: error: invalid type in declaration before ‘=’ token
 use[15]++;   pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                           ^
prog.cpp:351:61: error: ‘pCL’ was not declared in this scope
 use[15]++;   pair<Pt,Pt> D=pCL(Pt(0,0),r,Pt(x1,y1),Pt(x2,y1));
                                                             ^
prog.cpp:352:9: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
    if(D.first.x>D.second.x){
         ^
prog.cpp:352:19: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
    if(D.first.x>D.second.x){
                   ^
prog.cpp:353:19: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
     ret+=(atan2(D.first.y,D.first.x))*r;
                   ^
prog.cpp:353:29: error: request for member ‘first’ in ‘D’, which is of non-class type ‘int’
     ret+=(atan2(D.first.y,D.first.x))*r;
                             ^
prog.cpp:355:19: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
     ret+=(atan2(D.second.y,D.second.x))*r;
                   ^
prog.cpp:355:30: error: request for member ‘second’ in ‘D’, which is of non-class type ‘int’
     ret+=(atan2(D.second.y,D.second.x))*r;
                              ^
stdout
Standard output is empty