#Lutece1404. 熄灯啦!

熄灯啦!

Migrated from Lutece 1404 熄灯啦!

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

冬天的时候,寝室阿姨会给全栋楼断电,但众所周知,卿学姐的寝室的电是从来不会断!

title

这是什么原理嘞?谭爷想来好好研究下,好让自己的寝室不再断电!

假设全栋楼的电闸有 n 个,一开始全部闭合,有强迫症的阿姨每次操作必定要翻转不同的 k 个电闸的状态( k <= n ),谭爷准备求最少的操作次数使全楼断电。

如果不能成功给全楼断电则输出-1

Input

输入2个数:n,k (1 <= n <= 10^9, 1 <= k <= 10^9)。

Output

输出翻转次数的最小值。 如果不能成功翻转则输出-1

Samples

6 5
6

Resources

2016 UESTC Training for Math