Under construction

Still being built. Things may change

Gravity Falls Diary

Interview

Time limit2sMemory limit1024 MB

Summary
Given page size, letter size, and letter count, find how many pages the diary needs, or -1 if no letter fits on a page.
Level

Easy2 of 10

Topics
Implementation, Math
Solved
No attempts yet

Problem

One day, while walking through the forest, Dipper found a new diary and was overjoyed. His happiness did not last long. When he opened the cover, he found only scraps of parchment with letters on them. Someone clearly did not want this diary to be read.

In Gravity Falls, a diary usually consists of many pages filled in a special way. All letters in the diary have the same size, that is, the same width and height. The gaps between letters, both horizontal and vertical, are so small that they can be treated as zero. Each page contains continuous text, filled as follows: if a letter fits in the width of the current line, it is written on that line. If it does not fit, it is written on the next line below. If there is no next line, for example because the letter does not fit vertically on the current page, the letter moves to the upper left corner of the next page, and the process repeats.

Dipper knows the total number of letters and the sizes of the pages and letters. Assuming there are no blank pages, Dipper can easily count how many pages the diary had. Can you?

Input

The first line contains two natural numbers ww and hh (1≤w,h≤1001 \le w, h \le 100), the dimensions of the diary pages. The second line contains three natural numbers nn, aa, and bb (1≤n,a,b≤1001 \le n, a, b \le 100), the number of letters, the width of the letters, and the height of the letters.

Output

Print a single line containing the number of pages in the diary. If no solution exists, for example when the letters are so large that not a single one fits on a page, print -1.

Examples2

  1. Example 1

    Input
    7 18
    25 2 6
    
    Expected output
    3
    
  2. Example 2

    Input
    4 9
    100 3 10
    
    Expected output
    -1