View Code of Problem 104

#include<stdio.h>
int main(){
int v1,v2,n,t;
float time;
while(scanf("%d%d%d%d",&n,&v1,&v2,&t)!=EOF)
{    if(v1>v2){
   	time=1000.0*n/(v1-v2);
   	if(time>t){
   		printf("NO\n");
	   }
     else printf("%.2f\n",time);
   } 
   else{
   	printf("NO\n");
   } 
  }
  return 0;
}

Double click to view unformatted code.


Back to problem 104