fork(1) download
  1. #include<iostream>
  2. using namespace std;
  3. int main(){
  4. int N,K,m;
  5. cin>>N>>K;
  6. m=(N-1)/K;
  7. if((N-1)%K!=0&&m<0){
  8. cout<<"-1";}
  9. else {cout<<m;}
  10. return 0;}
Success #stdin #stdout 0s 4532KB
stdin
6 4
stdout
1