In a small town, there are n temples in a row and a well in front of each temple. A pilgrim came to the town with certain number of flowers.
Before entering the first temple, he washed all the flowers he had with the water of well. To his surprise, flowers flowers became a times(if he dipped x flowers those will become a*x). He offered few flowers to the God in the first temple and moved to the second temple. Here also, before entering the temple he washed the remaining flowers with the water of well. And again his flowers became a times. He offered few flowers to the God in second temple and moved to the third temple. Here also, his flowers became a times after washing them with water. He offered few flowers to the God in third temple.so on.......till n
There were no flowers left when pilgrim came out of nth temple and he offered same number of flowers to the God in all n temples. What is the minimum number of flowers the pilgrim had initially(X)? How many flower did he offer to each God(Y)?