P and q together have 3 times what q and r have, while p, q and r together have thirty rupees more than p. if q has 5 times what r has then what amount does p have?