1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#include <iostream> #include <cstdio> #define ll long long using namespace std; ll dp[1010]; int main() { int n,kase=1; dp[1]=1; for(int i=2;i<1001;i++) { for(int j=1;j<i;j++) { if((i-1)%j==0) { dp[i]+=dp[j]; dp[i]%=1000000007; } } } while(scanf("%d",&n)!=EOF) { cout<<"Case "<<kase++<<": "<<dp[n]<<"\n"; } return 0; } |