Break-Even Point
Time limit0.35sMemory limit128 MB
Given fixed cost A, variable cost B, and price C, find the smallest number of laptops where revenue exceeds total cost, or -1 if impossible.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
World Electronics manufactures and sells laptops. Regardless of how many laptops it sells, it pays a fixed annual cost of A ten-thousand won. Each laptop also adds a variable production cost of B ten-thousand won.
The selling price of one laptop is C ten-thousand won. If the company sells n laptops, its total revenue is Cn and its total cost is A + Bn. In this problem, the break-even point is the smallest number of laptops for which total revenue becomes strictly greater than total cost.
Given A, B, and C, write a program that finds the break-even point.
Input
The first line contains the natural numbers A, B, and C in order, separated by spaces. Each value is at most 2,100,000,000.
Output
Print the first sales quantity that produces profit. If no break-even point exists, print -1.
Hint
The break-even point used in this problem may differ from the accounting definition.