View Code of Problem 448

#include <stdio.h>
int main()
{
	int n,num;
	double d,t,count1,count2;
	scanf("%d",&n);
	while(n--)
	{
		count1=count2=0.0;
		scanf("%lf%lf",&d,&t);
		if(d>=3.0&&d<=10.0)
		{
			count1=(d-3.0)*2.0;
			count2=(d-3.0)*2.5;
		}
		else if(d>10)
		{
			count1=14.0+(d-10.0)*3.0;
			count2=17.5+(d-10.0)*3.75;
		}
		count1=count1+t*2.0/5.0+10.0+1.0;
		count2=count2+t*2.5/4.0+11.0;
		num=(int)(count2-count1+0.5);
		printf("%d\n",num);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 448