Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define M 123457
- using namespace std;
- int dp[10001];
- int main()
- {
- int n,x;
- cin>>n;
- for(int i=1;i<=n;++i)
- if(n%i==0)
- {
- x=i;
- ++dp[x],dp[x]%=M;
- for(int j=x;j<=n;++j)
- dp[j]+=dp[j-x],dp[j]%=M;
- }
- cout<<dp[n];
- return 0;
- }
Add Comment
Please, Sign In to add comment