# Solution of;
# Project Euler Problem 499: St. Petersburg Lottery
# https://projecteuler.net/problem=499
# 
# A gambler decides to participate in a special lottery. In this lottery the 
# gambler plays a series of one or more games. Each game costs m pounds to 
# play and starts with an initial pot of 1 pound. The gambler flips an 
# unbiased coin. Every time a head appears, the pot is doubled and the gambler 
# continues. When a tail appears, the game ends and the gambler collects the 
# current value of the pot. The gambler is certain to win at least 1 pound, 
# the starting value of the pot, at the cost of m pounds, the initial fee. The 
# game ends if the gambler's fortune falls below m pounds. Let pm(s) denote 
# the probability that the gambler will never run out of money in this lottery 
# given an initial fortune s and the cost per game m. For example p2(2) ≈ 0. 
# 2522, p2(5) ≈ 0. 6873 and p6(10 000) ≈ 0. 9952 (note: pm(s) = 0 for s < m). 
# Find p15(109) and give your answer rounded to 7 decimal places behind the 
# decimal point in the form 0. abcdefg.
# 
# by lcsm29 http://github.com/lcsm29/project-euler
import timed


def dummy(n):
    pass


if __name__ == '__main__':
    n = 1000
    i = 10000
    prob_id = 499
    timed.caller(dummy, n, i, prob_id)
