Start: May, 31, 2017 13:30:00
2017ACM通识课期末考试
End: May, 31, 2017 17:30:00
Time elapsed:
Time remaining:

Problem_ID: H
Result: Accepted
Time: 7ms
Memory: 1712kB
Author: 2016212402023
In contest: 1090

#include<iostream>
#include<algorithm>
using namespace std;
bool comp(int a,int b)
{
	return a>b;
}
int main()
{
	int T,d,t,a,b;
	double fee;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%d %d",&d,&t);
		double f1,f2;
		f1=f2=11;
		if(d<=10&&d>3)
		f1+=(d-3)*2,f2+=(d-3)*2.5;
		else if(d>10)
		f1+=14+(d-10)*3,f2+=17.5+(d-10)*3.75;
		f1+=(t*1.0/5)*2,f2+=(t*1.0/4)*2.5;
		a=(int)(f1+0.5),b=(int)(f2+0.5);
		printf("%d\n",b-a);
	}
}