Created
June 21, 2014 03:59
-
-
Save yao2030/2c084e6ee844a3ac6234 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int Count(int m, int n) { | |
if (n == 0 || n == 1) { | |
return 1; | |
} | |
if (n > m) { | |
return Count(m, m); | |
} | |
return Count(m, n - 1) + Count(m - n, n); | |
} | |
int main(void) { | |
int m, n; | |
cin >> m >> n; | |
cout << Count(m, n); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
put m apples in n plates.