Rearrange the formula `r=nk+w`by solving for `w`

To solve for `w`, we need to isolate it on one side of the equation by moving all other terms to the other side.

Starting with the formula:
r = nk + w

We want to isolate `w` on one side, so let's move the `nk` term to the other side by subtracting `nk` from both sides:
r - nk = nk + w - nk

This simplifies to:
r - nk = w

Therefore, the formula rearranged for `w` is:
w = r - nk