The average of three numbers p, q and r is k. p is as much more than the average as q is less than the average. What is the value of r?