Run ID:158145

提交时间:2026-08-20 16:47:33

#include<bits/stdc++.h> using namespace std; int main(){ int n,m,T; cin>>T; for(int i=1;i<=T;i++){ int s=0; cin>>n>>m; for(int x=0;x<=n;x++){ for(int y=0;y<=m/2;y++){ int z=n-x-y; if(z>=0 && (x+(2*y)+(5*z))==m){ s++; } } } cout<<s<<endl; } return 0; }