This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import division | |
import math | |
def s(a,b,c,e=1): | |
try: | |
p2 = math.sqrt(b**2 - (4*a*c)) | |
return ((-1*b)+p2)/(a*2) if e>0 else ((-1*b)-p2)/(a*2) | |
except ValueError: | |
return None | |
def smaller_root(a,b,c): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cjlib.input import * | |
from cjlib.runner import TaskRunner, DummyRunner, MPQRunner | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
def process(case): | |
# all units in pi cm^2 | |
paintLeft = case[1] | |
canDraw = 0 |