Project Euler 115 - Counting Block Combinations II

Official link: https://projecteuler.net/problem=115

Harder version of Problem 114