+Using a combination of black square tiles and oblong tiles chosen from: red tiles measuring two units, green tiles measuring three units, and blue tiles measuring four units, it is possible to tile a row measuring five units in length in exactly fifteen different ways.
+How many ways can a row measuring fifty units in length be tiled?
+NOTE: This is related to problem 116.
+use Math::GMP qw(:constant);
+ my ($min_tile_len, $max_tile_len, $total_len) = @_;
+ foreach my $len (0 .. $min_tile_len-1)
+ for my $len ($min_tile_len .. $total_len)
+ foreach my $delta (1, ($min_tile_len .. $max_tile_len))
+ $sum += $counts[-$delta];
+ # We need to exclude the all-black-squares one which is:
+ # 2. Should not be included.
+print count(2, 4, 50), "\n";