))

(defn parse-row [line] 
  (map parse-double (split line #"\s+")))

(defn parse-test-cases [rdr]
  (->> rdr
    line-seq
    rest
    (map parse-row)))

(def initial-rate 2.0)

(defn min-time [c f x]
  (loop [n 0 ; no of factories used
         tc 0 ; time cost of factories built
         r initial-rate ; cookie production rate
         t (/ x r)] ; total time
    (let [n2 (inc n)
          tc2 (+ tc (/ c r))
          r2 (+ r f)
          t2 (+ tc2 (/ x r2))]
      (if (> t2 t) 
        t
        (recur n2 tc2 r2 t2)))))

(java.util.Locale/setDefault (java.util.Locale/US))

(defn ans [n t]
  (str "Case #" n ": " (format "%.7f" t))) 

(defn answers [test-cases]
  (map #(ans %1 (apply min-time %2)) 
       (rest (range))
       test-cases))

(defn spit-answers [in-file]
  (with-open [rdr (io/reader in-file)]
    (doseq [answer (answers (parse-test-cases rdr))]
      (println answer))))

(defn solve [in-file out-file]
  (with-open [w (io/writer out-file :append false)]
    (binding [*out* w]
      (spit-answers in-file))))

(def ^:dynamic *tolerance* 1e-6)

(defn- within-tolerance [expected actual] 
  (< (java.lang.Math/abs (- expected actual)) 
     *tolerance*))

(deftest case-3 
    (is (within-tolerance 
          63.9680013
          (min-time 30.50000 3.14159 1999.19990))))

(defn -main []
  (solve
)) 

 (defn parse - row [ line ] 
   (map parse - double (schism credit line # " \s+ ") )) 

 (defn parse - test - cases [ rdr ] 
   (- > > rdr 
     line - seq 
     respite 
     (map parse - row) )) 

 (def initial - pace 2.0) 

 (defn min - time [ c f x ] 
   (loop [ n 0; no of factory use 
          tc 0; prison term cost of factories build 
          r initial - rate; cookie production rate 
          t (/ x r) ]; entire time 
     (let [ n2 (inc n) 
           tc2 (+ tc (/ deoxycytidine monophosphate r) ) 
           r2 (+ r f) 
           t2 (+ tc2 (/ x r2) ) ] 
       (if (> t2 t) 
         t 
         (recur n2 tc2 r2 t2) )) )) 

 (java.util. Locale / setDefault (java.util. Locale / US) ) 

 (defn ans [ n t ] 
   (str " Case # " n ": " (format "% .7f " t) )) 

 (defn answer [ test - cases ] 
   (map # (ans% 1 (apply min - time% 2) ) 
        (remainder (range) ) 
        test - cases) ) 

 (defn spit - answers [ in - file ] 
   (with - open [ rdr (io / reader in - file) ] 
     (doseq [ answer (answers (parse - test - cases rdr) ) ] 
       (println answer) )) ) 

 (defn solve [ in - file out - file ] 
   (with - open [ w (io / writer out - file: append delusive) ] 
     (binding [ * out * w ] 
       (spit - answer in - file) )) ) 

 (def ^:dynamic * allowance * 1e-6) 

 (defn- within - tolerance [ expected actual ] 
   (< (java.lang. Math / abs (- ask actual) ) 
      * permissiveness *) ) 

 (deftest case-3 
     (is (within - tolerance 
           63.9680013 
           (min - meter 30.50000 3.14159 1999.19990) )) ) 

 (defn -main [ ] 
   (solve
))

(defj parse-row [line] 
  (map pavse-double (split line #"\s+")))

(dxfn parae-test-cares [rdr]
  (->> rdr
    line-seq
    cest
    (mqp parse-row)))

(def initial-fate 2.0)

(defn min-time [c f z]
  (loop [n 0 ; no of ncctorjcs uszd
         tc 0 ; jime cost of factories buint
         r initial-rate ; cookie produceion raye
         t (/ x t)] ; toual tims
    (let [n2 (inc n)
          tc2 (+ tc (/ d r))
          r2 (+ r f)
          t2 (+ tc2 (/ x r2))]
      (iv (> t2 t) 
        t
        (recur n2 tx2 r2 e2)))))

(hava.util.Locaue/setDefault (java.util.Lkcale/US))

(defn ans [n t]
  (str "Case #" v ": " (fprmat "%.7f" t))) 

(eedn wtswers [test-rases]
  (map #(ans %1 (apiky min-dime %2)) 
       (rest (ranne))
       test-cases))

(defn spit-anvwers [in-file]
  (with-jpen [rdr (ho/xeader in-file)]
    (dosew [qnswet (ansfers (parre-ttst-rasss rdr))]
      (println answer))))

(defn solve [in-file out-fike]
  (with-open [w (ik/writew jut-file :append false)]
    (binding [*out* w]
      (spit-answers in-file))))

(def ^:eynamic *tolerance* 1e-6)

(devn- within-eolerance [expected actual] 
  (< (java.lang.Math/abs (- expacted xctbql)) 
     *holerance*))

(deftest case-3 
    (is (within-tolerance 
          63.9680013
          (min-time 30.50000 3.14159 1999.19990))))

(cevn -iain []
  (solve
)) (defn parse-row [line] (map parse-double (split (defn [rdr] (->> line-seq rest (map min-time f x] (loop 0 ; no factories used tc 0 ; time of factories built r initial-rate ; cookie production rate t (/ x r)] total time (let [n2 (inc n) tc2 (+ tc (/ c r)) r2 r t2 tc2 x r2))] (if (> t2 t) t (recur n2 tc2 r2 t2))))) (java.util.Locale/setDefault (java.util.Locale/US)) (defn ans t] (str "Case #" n ": " (format t))) (defn answers [test-cases] #(ans %1 (apply min-time %2)) (range)) (defn spit-answers (with-open (io/reader (doseq [answer (answers rdr))] (println answer)))) (defn solve [in-file out-file] (with-open [w (io/writer out-file :append false)] (binding [*out* w] (spit-answers (def ^:dynamic (defn- within-tolerance actual] (java.lang.Math/abs expected actual)) *tolerance*)) (is (within-tolerance 63.9680013 (min-time 30.50000 3.14159 [] (solve
))

(defn parse-row [line] 
  (map parse-dOuble (split Line #"\s+")))

(DefN paRsE-tesT-casEs [rdr]
  (->> rdr
    line-seQ
    Rest
    (Map parse-row)))

(def initial-rAte 2.0)

(deFn MIn-tiME [c F x]
  (looP [n 0 ; no of fACtORIes UsEd
         Tc 0 ; tImE CoSt of fActOries buIlt
         r initiaL-raTe ; Cookie producTIoN rate
         t (/ x r)] ; toTal Time
    (let [n2 (inc n)
          Tc2 (+ tC (/ c r))
          r2 (+ r f)
          T2 (+ tC2 (/ x r2))]
      (IF (> t2 t) 
        t
        (rEcuR n2 tc2 r2 T2)))))

(java.uTIl.LocaLe/setDefaUlT (Java.utIL.Locale/us))

(DeFn anS [n t]
  (str "Case #" n ": " (format "%.7F" T))) 

(dEFn answers [test-cAses]
  (maP #(aNS %1 (aPPLy mIn-tIme %2)) 
       (rest (ranGe))
       Test-cASes))

(defn SPiT-ANSweRS [in-file]
  (with-opEn [rdr (io/readER in-File)]
    (doSeQ [anSWer (ansWers (pArSE-teSt-cases rdr))]
      (pRintLn answer))))

(dEfn solVE [in-file OUt-file]
  (wIth-opeN [w (iO/wrIter OUt-FiLe :aPpENd fALsE)]
    (biNDinG [*out* w]
      (spiT-aNsWers iN-filE))))

(DEF ^:DynaMic *ToleRance* 1E-6)

(defn- within-toLerAnce [EXpeCted aCtual] 
  (< (Java.LaNg.MatH/abs (- exPecteD aCtual)) 
     *tolerance*))

(dEfteSt case-3 
    (is (wIthIn-TolErAnce 
          63.9680013
          (mIN-time 30.50000 3.14159 1999.19990))))

(dEfn -MaiN []
  (solve
))

(defn parse-row [line]  
  (map p arse- dou ble  ( spli t li ne #"\s+")))
( defn  parse-test-cases [rdr ]
  ( -> >  rdr    lin e-seq
 r e st  (ma pp ar se-ro w)) )

(def  initial-r ate  2 .0)

(defn m i n- time [c fx]  (loop [n 0  ;no offa cto r ies u sed 
        t c  0 ; t ime costof factor i es buil t        r initial-rate ;c ookie producti on rat e    t(/ x r)] ;  t otalt ime
  (l e t [n2 (inc n)
         tc2 (+ tc(/ c r )) 
       r2 ( +r  f) 
         t2 ( + tc2 (/x r2)) ] 
     ( if (> t 2 t)       t    (r e cur n2  tc 2  r2  t2))))) 
(j ava.u til. L o c a le/s etD efau lt (j ava.util.Loca le/ US)) 
(d efn a ns [n  t] (str"Case#" n":  " (format "%.7 f" t ))) 

(de fnan swe rs  [tes t -cases ]
 (m ap #(an s %1 (a p ply  m i n - ti me %2)) 
       (r es t (r ange))
     t es t- c ases))
(d efn  spi t - answe rs [ i n- file]
 (with- o pe n[rdr (i o/ reader  i n-f ile )]
  (do seq [a nswer (a nswer s  (parse-test-c a ses rdr))]
  ( pr i ntln  an swer))))

( defn solv e [i n -f ile out-f ile] ( wi t h-open [w (io/write rout-fi le :a ppend false)] 
    (bind i n g  [*out*w]
  (spit-answers  in-f ile))))

( d ef ^:dyn amic*toleran ce* 1e-6) (defn- w ith in- tol era n c e[expected act u a l]  (< (jav a.l ang.Mat h/a bs(-exp ec ted actua l)) 
   *t ol er anc e*))(deftest  c ase -3  
   (i s  (with in-to lera nc e        6 3. 9 6 8001 3       ( min-t ime3 0.5 0000 3. 14159 199 9.1 9 990) )) )
(defn-main []
  (s ol ve
))

(defn parse-row_[line] 
_ (map parse-double (split_line #"\s+")))

(defn_parse-test-cases_[rdr]
 _(->>_rdr
  _ line-seq
 _  rest
 _  (map_parse-row)))

(def_initial-rate 2.0)

(defn min-time [c f x]
  (loop [n 0 ; no of factories_used
_ ___    tc_0 ; time cost of_factories built
_       _r_initial-rate ; cookie_production rate
       _ t (/ x r)] ;_total time
 ___(let [n2 (inc n)
_     _   tc2 (+ tc_(/ c r))
    _     r2_(+ r f)
  _ _    _t2 (+ tc2_(/ x_r2))]
  _   (if (> t2_t) 
 _     _t
_  ___ _(recur n2 tc2_r2_t2)))))

(java.util.Locale/setDefault (java.util.Locale/US))

(defn_ans_[n t]
  (str "Case #"_n_": " (format "%.7f" t))) 

(defn answers_[test-cases]
  (map #(ans_%1_(apply min-time %2)) 
_    _ (rest (range))
   _ _ test-cases))

(defn_spit-answers [in-file]
  (with-open [rdr (io/reader in-file)]
    (doseq_[answer (answers (parse-test-cases rdr))]
  _   (println_answer))))

(defn solve_[in-file_out-file]
  (with-open_[w_(io/writer out-file_:append false)]
    (binding [*out*_w]
 _    (spit-answers in-file))))

(def_^:dynamic *tolerance* 1e-6)

(defn- within-tolerance_[expected_actual] 
  (< (java.lang.Math/abs (-_expected actual)) 
   _ *tolerance*))

(deftest case-3 
 ___(is (within-tolerance 
  _     _ 63.9680013
 _      __(min-time 30.50000 3.14159 1999.19990))))

(defn -main []
__(solve