Project Euler #151: Paper sheets of standard sizes: an expected-value problem.

  • [deleted]
    + 2 comments

    for N=4, is the following results correct? if my understanding of the problem statement is correct, I think the results should be correct, but it cannot pass the test case

    0 0 0 0: 0

    0 0 0 1: 1

    0 0 0 2: 1

    0 0 1 0: 2

    0 0 0 3: 1

    0 0 1 1: 500000005

    0 0 0 4: 1

    0 0 1 2: 333333337

    0 0 2 0: 500000005

    0 1 0 0: 500000006

    0 0 1 3: 250000003

    0 0 2 1: 388888893

    0 1 0 1: 916666675

    0 0 2 2: 319444448

    0 1 0 2: 694444451

    0 1 1 0: 652777784

    0 1 1 1: 555555561

    1 0 0 0: 555555562