\gets p: (p\in\mathcal{PM})\wedge(p(2)\cdot p(3)=\max\limits_{p'\in\mathcal{PM}}(p'(2)\cdot p'(3)))$;\
$\mathcal{PM} \gets \mathcal{PM}\setminus\{pm\}$; $\mathcal{C} \gets \mathcal{C}\cup\{($new core$, pm(3), 0, pm(1))\}$; $vm \gets v: (v\in\mathcal{VT})\wedge$ C1$(v) \wedge$ C2$(v) \wedge$ C3$(v)$;\
/\* C1$(v): (\forall t)((t\in \mathcal{T})\wedge(t(2)/v(3)\leq t(3)))$,\
C2$(v): v(2)\cdot v(3)/v(4)=$\
$\max\limits_{(v'\in\mathcal{VT})\wedge \textrm{\scriptsize C1}(v')}(v'(2)\cdot v'(3)/v'(4)))$,\
C3$(v): v(4)=\min\limits_{(v'\in\mathcal{VT})\wedge \textrm{\scriptsize C1}(v')\wedge \textrm{\scriptsize C2}(v')}{v'(4)}$ \*/ $\mathcal{C} \gets \mathcal{C}\cup\{($new core$, vm(3), 0,$ a new VM instance of type $vm(1))\}$; $(task, core) \gets (t, c): \textrm{C4}(t, c)\wedge\textrm{C5}(t, c)\wedge\textrm{C6}(t, c)$;\
/\* $\textrm{C4}(t, c): (t \in \mathcal{T}) \wedge (c \in \mathcal{C}) $\
$\wedge (t(3)\geq c(3)+t(2)/c(2))$,\
$\textrm{C5}(t, c): t(3)-(c(3)+t(2)/c(2))$\
$ = \min\limits_{\textrm{\scriptsize C4}(t', c')}{(t'(3)-(c'(3)+t'(2)/c'(2)))}$,\
$\textrm{C6}(t, c): t(2) = \max\limits_{\textrm{\scriptsize C4}(t', c')\wedge\textrm{\scriptsize C5}(t', c')}{(t'(2))}$ \*/ $\mathcal{A} \gets \mathcal{A}\cup\{(task(1), core(1), core(4), core(3)$\
$, core(3)+task(2)/core(2))\}$; $core(3) \gets core(3)+task(2)/core(2)$; $\mathcal{T} \gets \mathcal{T}\setminus \{task\}$; $\mathcal{C} \gets \phi$;

If there is no available resource (line 2), the algorithm would add an available PM (lines 3-8) or lease a VM (lines 9-14) from public cloud when there is no available PM in local cloud. The selection principle of an PM is to selecting the PM with most capacity (line 4). The selection principle of rented VM is that the selected VM has the capacity to complete any task when running alone (C1 in line 10) and has best cost-performance ratio (C2 in line 