LearnPy Hub
← Arena
EasyRating 1000

Game Sale

The first game costs p. Each next game costs d less, but never less than m. With s taka, how many games can you buy?

Input

Four integers p d m s.

Output

One integer.

Sample 1

Input
20 3 6 80
Output
6

Sample 2

Input
20 3 6 85
Output
7
solution.py
Output appears here
Game Sale · Python Arena problem · LearnPy Hub