Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. double N, a, x, y, i, in;
  6. while (1)
  7. {
  8. scanf("%lf %lf", &N, &a);
  9. if (N == 0 && a == 0) break;
  10. in = 0;
  11. for (i = 0 ; i < N; i++)
  12. {
  13. scanf("%lf %lf", &x, &y);
  14. if (x*x + y*y < a*a && x*x + (a-y)*(a-y) < a*a &&
  15. (a-x)*(a-x) + (a-y)*(a-y) < a*a && (a-x)*(a-x) + y*y < a*a)
  16. in ++;
  17. }
  18. printf("%.5lf\n", (in/N)*a*a);
  19. }
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement