杭电acm2401

#include <stdio.h>

int main(){

	int n, w, d, sum, ans, t;
	while(~scanf("%d%d%d%d", &n, &w, &d, &t)){
 	    sum = n * (n-1) / 2 * w;
 	    ans = (sum - t) / d;
 	    if(sum==t)
 	    		  printf("%d\n", n);
        else
 	    printf("%d\n", ans);
	}

	return 0;
}

posted @ 2015-09-20 19:48  StevenLuke  阅读(105)  评论(0编辑  收藏  举报