http://codeforces.com/problemset/problem/864/C
#include<iostream>
using namespace std;
#define ll long long
int main()
{
ll a,b,f,k;
cin>>a>>b>>f>>k;
ll x=b-f;
ll l=0;
if(b<f||b<a-f) {
cout<<-1;
return 0;
}
if(k%2==0) {
for(int i=0; i<k; i++) {
if(i%2==0) {
if(x>=2*(a-f))
x=x-2*(a-f);
else if(b-2*(a-f)<0) {
cout<<-1;
return 0;
} else {
x=b-2*(a-f);
l++;
}
} else {
if(i!=k-1) {
if(x>=2*(f))
x-=2*(f);
else if(b-2*(f)<0) {
cout<<-1;
return 0;
} else {
x=b-2*(f);
l++;
}
} else {
if(x<f)
l++;
}
}
}
} else {
for(int i=0; i<k; i++) {
if(i%2==0) {
if(i!=k-1) {
if(x>=2*(a-f))
x=x-2*(a-f);
else if(b-2*(a-f)<0) {
cout<<-1;
return 0;
} else {
x=b-2*(a-f);
l++;
}
} else {
if(x<(a-f))
l++;
}
} else {
if(x>=2*(f))
x-=2*(f);
else if(b-2*(f)<0) {
cout<<-1;
return 0;
} else {
x=b-2*(f);
l++;
}
}
}
}
cout<<l;
}