Problem #377
Perfect Fit
You are supposed to create a regular 12-sided polygon which has a side length of d units. To do so, you have to make use of tiles in the shape of a square or an equilateral triangle and having a side length of 1 unit. You have an infinite set of each tiles and you must form the 12-sided polygon completely without overlap.
Calculate the number of ways to tile such a polygon with d = 391489 modulo 1,000,000,007. Two ways are considered identical if one can be obtained from the other by rotation.