include
include <stdio.h>
include <stdlib.h>
using namespace std;
int main()
{ int T; scanf("%d",&T); long long n,m,v,k; while(T--) {cin>>n>>m>>v>>k; int ans=0; if(n<=m) { ans=0; }else if( mm) { m= (m-v)*k; ans++; } } printf("%d\n",ans);}return 0;
}