Let Cost Price = CP
When sold at ₹797, there is profit since the selling price is higher than cost price.
Profit =797−CP
When sold at ₹635, there is loss since the selling price is lower than cost price.
Loss =CP−635
The profit earned equals the loss incurred:
797−CP=CP−635
797+635=CP+CP
1432=2CP
CP=21432
CP=716
The cost price is the average of the two selling prices:
CP=2797+635
CP=21432
CP=716
Therefore, the cost price of the item is ₹716.