<jupyter_start><jupyter_text>problem statement
https://www.hackerrank.com/challenges/s10-geometric-distribution-2/problem<jupyter_code># Enter your code here. Read input from STDIN. Print output to STDOUT
import math
def nCr(n,r):
    f = math.factorial
    return f(n)/(f(r) * f(n-r))
a,b = list(map(int,input().split()))
p = a/float(b)
n = int(input())
q = 1-p
ans = 0.0
for x in range(1,n+1):
    ans += ( p * q**(x-1))
print("%.3f"%ans)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1825726141078838, 'fraction_numerical': 0.02074688796680498, 'mean_word_length': 3.979381443298969, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '49283', 'license': 'MIT', 'n_tokens_mistral': 215, 'n_tokens_neox': 205, 'n_words': 42, 'path': 'Day 4/Day 4 Geometric Distribution II.ipynb', 'repo_name': 'Codernob/Hackerrank-10-days-of-Statistics', 'size': '482'}