We want to construct an algorithm with specification: Input:…

We want to construct an algorithm with specification: Input: n,r are integers with n, r >= 0 Output: returns p with p = n times r. For that purpose, we use a loop with invariant: p = (n – k) times r. Fill in the missing spots in the code below such that the invariant is established by the initial assignments, is maintained by the loop body, and such that the invariant implies the postcondition at loop exit. p