POJ_1664

#include <cstdlib> #include <iostream> using namespace std; int getCount(int m, int n) { if(m == 0 || n == 1) return 1; if(m < n) return getCount(m, m); return getCount(m, n - 1) + getCount(m - n, n); } int main(int argc, char *argv[]) { int caseCount; cin >> caseCount; while(caseCount-- > 0) { int m, n; cin >> m >> n; cout << getCount(m, n) << endl; } return EXIT_SUCCESS; }  

你可能感兴趣的:(include)