#include #define rep(i,a,b) for(int i=a;i> N >> M; if (N <= M) printf("1\n"); else if (N % 2 == 0) printf("-1\n"); else if (N / 2 <= M) printf("2\n"); else printf("-1\n"); }