G. Like a Comet
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

There's a cartoon show you made called Comet Universe that you're working on by yourself. After releasing the pilot episode (episode $$$0$$$) which got a perfect rating of $$$10$$$, you plan to release $$$N$$$ episodes, numbered from $$$1$$$ to $$$N$$$. To release the episodes, you want to do what's called a comet bomb.

You have $$$N\times M$$$ days to work on your cartoon, numbered from $$$1$$$ to $$$N\times M$$$. For each episode $$$i$$$ ($$$1\leq i\leq N$$$), you have to finish it by the end of day $$$i\times M$$$ so the episode can air by that time. For each day, you can only choose to work on one episode. An episode is said to be ready if you've worked on it for a total of at least $$$A$$$ days. An episode is said to be excellent if you've worked on it for a total of at least $$$B$$$ days ($$$B\geq A$$$).

When an episode airs, there are three cases:

  • If it's excellent, then it'll get a perfect rating of $$$10$$$.
  • If it's only ready, but not excellent, then it'll get a rating of $$$\max(r-1,0)$$$ with $$$r$$$ being the rating of the previous episode. (Note that episode $$$0$$$ got a rating of $$$10$$$).
  • If it's not ready, then your entire cartoon show will become a disappointment and will be canceled immediately, with the audience completely forgetting about the entire thing. Because of that, you won't let that happen.

What's the maximum possible sum of ratings of episodes $$$1$$$ through $$$N$$$ if every episode must be ready when it airs? Or report if it's impossible!

Input

The only line contains four integers $$$N$$$, $$$M$$$, $$$A$$$, and $$$B$$$ ($$$1\leq N,M\leq100\,000$$$; $$$1\leq A\leq B\leq100\,000$$$) — the number of episodes, the number of days between episodes, the number of days for an episode to be ready, and the number of days for an episode to be excellent.

Output

A single integer representing the maximum possible sum of ratings of episodes $$$1$$$ through $$$N$$$ if every episode must be ready when it airs, or report -1 it's impossible.

Examples
Input
4 3 2 5
Output
36
Input
1 10 100 1000
Output
-1
Note

In the first example, you can do the following for each day:

  1. Work on episode $$$1$$$.
  2. Work on episode $$$3$$$.
  3. Work on episode $$$1$$$.
    • Episode $$$1$$$ airs with a rating of $$$9$$$.
  4. Work on episode $$$3$$$.
  5. Work on episode $$$2$$$.
  6. Work on episode $$$2$$$.
    • Episode $$$2$$$ airs with a rating of $$$8$$$.
  7. Work on episode $$$3$$$.
  8. Work on episode $$$3$$$.
  9. Work on episode $$$3$$$.
    • Episode $$$3$$$ airs with a rating of $$$10$$$.
  10. Work on episode $$$4$$$.
  11. Work on episode $$$4$$$.
  12. Work on episode $$$4$$$.
    • Episode $$$4$$$ airs with a rating of $$$9$$$.

The sum of ratings of episodes $$$1$$$ through $$$4$$$ is $$$9+8+10+9=36$$$.