You call a number beautiful if it contains at least 1 bit '0' and at most 3 bits '0' in its binary representation.
Asked in the OA stage. For Q queries [L, R] up to 1e18, output the sum of cubes of beautiful numbers in range modulo 998244353. The input ranges are stored in query_ranges.
query_id and beautiful_cube_sum.[L, R]; exclude rows with NULL bounds.query_id ascending.| Column | Type | Description |
|---|---|---|
| query_idPK | INT | Unique identifier for the range query |
| lower_bound | NUMERIC(20,0) | Inclusive lower bound of the queried range |
| upper_bound | NUMERIC(20,0) | Inclusive upper bound of the queried range |