...
The calculation can be described more generally as follows: The CPU equivalents of the RAM used are calculated. The maximum of the allocated CPU cores and the CPU equivalents of the working memory are then taken and multiplied by the runtime of the job.
You may find more information on this topic at CPU resources