A grocer buys two kinds of rice X and Y, one X kg at the rate of Rs. a per kg and the other Y kg at the rate of Rs. b per kg. He mixes them and obtains a mixture of Rs. c per kg. What is the ratio of the variety X to that of variety Y in the mixture?