The cost price is calculated using the formula: Cost Price = (100 * Selling Price) / (100 + Gain Percentage).