#include<iostream> #include<algorithm> usingnamespace std; int N, m, M, T, R; intmain(void){ cin>>N>>m>>M>>T>>R; if(m+T>M){ cout<<"-1"<<endl; return0; } int cnt=0, stat = m; do{ if(stat+T<=M){ stat+=T; --N; } else{ stat-=R; if(stat<m) stat = m; } ++cnt; }while(N); cout<<cnt<<endl; }