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

  • + 1 comment

    Test cases 0 through 3 work for me, but 4 and 5 don't. I assumed the inputs are 7 and 8, so I looked for myself what the outputs are. It turns out for inputs 3 through 6 it just gives the answer, but for 7 and 8 it gets 'truncated'. What should I do? How is it even possible that some people got it right?