A Beacen of Flowers🌸
The artisans of Bright Beacen Mosque are laying a grand geometric mosaic across the main hall. Inspired by traditional Islamic pattern art, the design radiates outward from repeating stars and polygons — each tile contributing to the spiritual balance of the space.
However, the original blueprints were encoded as a massive grid of digits.
Each digit represents a type of carved stone tile.
Your task is to calculate the Total Radiance of the mosaic.
The Mosaic Blueprint
You are given a grid of digits.
Each digit is between 1 and 6 and represents a tile type.
The blueprint is 400 rows by 80 columns.
Each tile contributes a certain amount of Radiance based on whether it contains a central axis (a "rose") and how many decorative "petals" surround it.
Tile Types
Only star tiles contribute Radiance.
| Tile | Name | Radiance |
|---|---|---|
| 1 | Base Polygon | 0 |
| 2 | Base Polygon | 0 |
| 3 | Small Star | 2 |
| 4 | Base Polygon | 0 |
| 5 | Great Star | 4 |
| 6 | Void Tile | 0 |
Interpretation
- A Type 3 tile has a central axis with 2 petals
- A Type 5 tile has a central axis with 4 petals
- All other tiles contribute 0 Radiance
Radiance Rule
The Total Radiance of the mosaic is simply the sum of the Radiance values of every tile in the grid.
In other words:
Count how many 3s and 5s appear in the grid
Multiply:
- each 3 by 2
- each 5 by 4
- Add the results together
Example
If a row contains:
15324653
Then the radiance is:
1 → 0
5 → 4
3 → 2
2 → 0
4 → 0
6 → 0
5 → 4
3 → 2
Total = 12
Your Task
Calculate the Total Radiance of the entire floor.
Return a single integer.