Codeforces Round 518 (Div. 2) [Thanks, Mail.Ru!]
A
Birthday
Codeforces
1400
原题
←B →
翻译中…

Ivan is collecting coins. There are only $N$ different collectible coins, Ivan has $K$ of them. He will be celebrating his birthday soon, so all his $M$ freinds decided to gift him coins. They all agreed to three terms:

翻译中…
  • Everyone must gift as many coins as others.
  • All coins given to Ivan must be different.
  • Not less than $L$ coins from gifts altogether, must be new in Ivan's collection.
翻译中…

But his friends don't know which coins have Ivan already got in his collection. They don't want to spend money so they want to buy minimum quantity of coins, that satisfy all terms, irrespective of the Ivan's collection. Help them to find this minimum number of coins or define it's not possible to meet all the terms.

翻译中…

Input

翻译中…

The only line of input contains 4 integers $N$, $M$, $K$, $L$ ($1 \le K \le N \le 10^{18}$; $1 \le M, \,\, L \le 10^{18}$) — quantity of different coins, number of Ivan's friends, size of Ivan's collection and quantity of coins, that must be new in Ivan's collection.

翻译中…

Output

翻译中…

Print one number — minimal number of coins one friend can gift to satisfy all the conditions. If it is impossible to satisfy all three conditions print "-1" (without quotes).

翻译中…

Note

翻译中…

In the first test, one coin from each friend is enough, as he will be presented with 15 different coins and 13 of them will definitely be new.

翻译中…

In the second test, Ivan has 11 friends, but there are only 10 different coins. So all friends can't present him different coins.

翻译中…

样例

Input #1
20 15 2 3
Output #1
1
InputCopy OutputCopy
Input #2
10 11 2 4
Output #2
-1
InputCopy OutputCopy
题目信息
题号
1068A
时间限制
1 s
内存限制
256 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。