• + 0 comments
    import math
    # Read input from STDIN
    input_line = input()
    
    # Split the input into a list of values
    values = input_line.split()
    
    # Convert the values to the appropriate data types
    p = int(values[0])/100
    q = (1-p)
    n = int(values[1])
    
    def binomial():
        resultOne = 0
        resultTwo = 0
        
        for i in range(0,3):
            pdf = (math.factorial(n)/(math.factorial(i)*((math.factorial(n-i)))))*(p**i)*(q**(n-i))
            if i <= 2 :
                resultOne = resultOne + pdf
    
        for i in range(1,(n+1)):
            pdf = (math.factorial(n)/(math.factorial(i)*((math.factorial(n-i)))))*(p**i)*(q**(n-i))     
            if i >= 2:
                resultTwo = resultTwo + pdf    
        
        print(round(resultOne, 3))
        print(round(resultTwo, 3))     
        
    
    binomial()