Company: Optiver
Difficulty: hard
Overheat Controller You are implementing firmware for a multicore processor. Each core runs a configurable workload that produces heat, every core has its own active-cooling capacity, and all running cores share a single pooled-cooling capacity. The operating system changes workloads with SetCoreLoad and calls Tick to learn which cores have changed between running and shut down. Thermal model Use the following deterministic model. At time 0 , every core is running with temperature 0 and load 0 . Time and all operation timestamps are measured in whole seconds. If r cores are running during a second, each running core receives floor(pooledCooling / r) units of pooled cooling for that second. For a running core i , its temperature changes during that second by load[i] - activeCooling[i] - floor(pooledCooling / r) . Temperature cannot fall below 0 . If a core's temperature reaches or exceeds shutdownTemperature at the end of a second, it shuts down before the next second. Pooled cooling is