;; -*- coding: utf-8 -*-
(eval-when (:compile-toplevel :load-toplevel :execute)
  (defparameter OPT
    #+swank '(optimize (speed 3) (safety 2))
    #-swank '(optimize (speed 3) (safety 0) (debug 0)))
  #+swank (progn (ql:quickload '(:cl-debug-print :fiveam))
                 (shadow :run)
                 (use-package :fiveam))
  #-swank (set-dispatch-macro-character #\# #\> (lambda (s c p) (declare (ignore c p)) (read s nil (values) t))))
#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)

;; BEGIN_INSERTED_CONTENTS
;;;
;;; ARRAY-ELEMENT-TYPE is not constant-folded on SBCL version earlier than
;;; 1.5.0. See
;;; https://github.com/sbcl/sbcl/commit/9f0d12e7ab961828931d01c0b2a76a5885ad35d2
;;;

(eval-when (:compile-toplevel :load-toplevel :execute)
  (sb-c:deftransform array-element-type ((array))
    (let ((type (sb-c::lvar-type array)))
      (flet ((element-type (type)
               (and (sb-c::array-type-p type)
                    (sb-int:neq (sb-kernel::array-type-specialized-element-type type) sb-kernel:*wild-type*)
                    (sb-kernel:type-specifier (sb-kernel::array-type-specialized-element-type type)))))
        (cond ((let ((type (element-type type)))
                 (and type
                      `',type)))
              ((sb-kernel:union-type-p type)
               (let (result)
                 (loop for type in (sb-kernel:union-type-types type)
                       for et = (element-type type)
                       unless (and et
                                   (if result
                                       (equal result et)
                                       (setf result et)))
                       do (sb-c::give-up-ir1-transform))
                 `',result))
              ((sb-kernel:intersection-type-p type)
               (loop for type in (sb-kernel:intersection-type-types type)
                     for et = (element-type type)
                     when et
                     return `',et
                     finally (sb-c::give-up-ir1-transform)))
              (t
               (sb-c::give-up-ir1-transform)))))))

(declaim (inline make-convex-hull!))
(defun make-convex-hull! (points &optional (eps 0))
  "Returns the vector of the vertices of the convex hull. This function sorts
POINTS as a side effect.

If EPS is non-negative (and the calculation error can be ignored), three
vertices in a straight line are excluded. On the other hand, they are allowed if
EPS is a negative number.

POINTS := vector of complex number"
  (declare (inline sort)
           (vector points))
  (macrolet ((outer (p1 p2)
               `(let ((c1 ,p1)
                      (c2 ,p2))
                  (- (* (realpart c1) (imagpart c2))
                     (* (imagpart c1) (realpart c2))))))
    (when (<= (length points) 1)
      (return-from make-convex-hull! (copy-seq points)))
    (let* ((n (length points))
           (end 0)
           (res (make-array (* n 2) :element-type (array-element-type points)))
           (points (sort points (lambda (p1 p2)
                                  (if (= (realpart p1) (realpart p2))
                                      (< (imagpart p1) (imagpart p2))
                                      (< (realpart p1) (realpart p2)))))))
      (declare (fixnum end))
      (do ((i 0 (+ i 1)))
          ((= i n))
        (loop
          (unless (and (> end 1)
                       (<= (outer (- (aref res (- end 1)) (aref res (- end 2)))
                                  (- (aref points i) (aref res (- end 1))))
                           eps))
            (return))
          (decf end))
        (setf (aref res end) (aref points i))
        (incf end))
      (let ((tmp-end end))
        (do ((i (- n 2) (- i 1)))
            ((< i 0))
          (loop
            (unless (and (> end tmp-end)
                         (<= (outer (- (aref res (- end 1)) (aref res (- end 2)))
                                    (- (aref points i) (aref res (- end 1))))
                             eps))
              (return))
            (decf end))
          (setf (aref res end) (aref points i))
          (incf end)))
      (adjust-array res (- end 1)))))

(defmacro dbg (&rest forms)
  #+swank
  (if (= (length forms) 1)
      `(format *error-output* "~A => ~A~%" ',(car forms) ,(car forms))
      `(format *error-output* "~A => ~A~%" ',forms `(,,@forms)))
  #-swank (declare (ignore forms)))

(defmacro define-int-types (&rest bits)
  `(progn
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "UINT~A" b)) () '(unsigned-byte ,b))) bits)
     ,@(mapcar (lambda (b) `(deftype ,(intern (format nil "INT~A" b)) () '(signed-byte ,b))) bits)))
(define-int-types 2 4 7 8 15 16 31 32 62 63 64)

(declaim (inline println))
(defun println (obj &optional (stream *standard-output*))
  (let ((*read-default-float-format* 'double-float))
    (prog1 (princ obj stream) (terpri stream))))

(defconstant +mod+ 1000000007)

;; Body

(declaim (inline calc-angle))
(defun calc-angle (c1 c2)
  "Returns the anticlockwise angle from vector C1 to vector C2. The range is [0,
2PI)."
  (mod (- (phase c2) (phase c1)) (* 2 PI)))

(defun main ()
  (let* ((n (read))
         (points (make-array n :element-type '(complex double-float)))
         (idx-table (make-hash-table))
         (res (make-array n :element-type 'double-float :initial-element 0d0)))
    (dotimes (i n)
      (let ((c (complex (float (read) 1d0) (float (read) 1d0))))
        (setf (aref points i) c)
        (setf (gethash c idx-table) i)))
    (let ((hull (make-convex-hull! points 1d-9)))
      (dotimes (i (length hull))
        (let* ((c-prev (aref hull (mod (- i 1) (length hull))))
               (c (aref hull i))
               (c-next (aref hull (mod (+ i 1) (length hull))))
               (angle (calc-angle (- c c-prev) (- c-next c)))
               (prob (/ angle (* 2 pi))))
          (setf (aref res (gethash c idx-table)) prob))))
    (map () #'println res)))

#-swank(main)


Measured memory_bytes: 54240