mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
23 lines
396 B
C++
23 lines
396 B
C++
|
#include<stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
int m,n,x,s,c,i,j;
|
||
|
scanf("%d",&x);
|
||
|
while(x--)
|
||
|
{
|
||
|
c=0;
|
||
|
scanf("%d%d",&n,&m);
|
||
|
s=5*n-m;
|
||
|
for(i=0;i<=n;i++)
|
||
|
{
|
||
|
for(j=0;j<=n;j++)
|
||
|
{
|
||
|
if(4*i+3*j==s && n-i-j>=0)
|
||
|
c++;
|
||
|
}
|
||
|
}
|
||
|
printf("%d\n",c);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|