Description
Square Counting
Design a hardware module that simulates a dance competition elimination process. Given an R×C grid of dancers with skill levels, simulate elimination rounds where dancers are eliminated if their skill is strictly less than the average of their orthogonal neighbors. Calculate the total sum of all dancers' skills across all rounds.
Example: For a 2×4 grid with skill levels, simulate elimination rounds and sum all skill levels across rounds.
Source: Google Code Jam 2020 Round 1A - Problem C: Square Dance
Input
r
32-bit Unsigned IntegerNumber of rows in grid.
c
32-bit Unsigned IntegerNumber of columns in grid.
Output
64-bit Unsigned Integer
Total number of squares that can be formed.