Map
Time limit2sMemory limit1024 MB
Given n scraps and k parts per tear, find how many seconds t Vasya tore the map, or print -1 if no such t exists.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
The hooligan Vasya got an F in geography and, out of anger, started tearing up a map. He did this for seconds.
Every second he took any piece of the map and tore it into parts. When he finished, he found scraps in front of him.
While he was destroying the map, he lost track of time. Now he wants to know how long he tore the map, so he asked you to find .
Input
The first line contains two integers and ().
Output
If no suitable exists, print a single number . Otherwise, print .