2019-05-28
19:25:40
加油,坚持!!!
是一道水题
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf("%d", &t); while(t--) { int n, m; scanf("%d %d", &n, &m); int count = 0; for (int i = 0; i <= n; i++) { for (int j = 0; j <= n ; j++) { if(i + 2 * j + (n - i - j) *5 == m && n - i -j >= 0) { count++; } } } cout << count << endl; } return 0; }