class Solution {
public:
int cutRope(int number) {
vector<int>dp(number + 1, 1);
dp[3] = 2;
dp[4] = 3;
for (int i = 5; i <= number; i++) {
for (int j = 1; j < i; j++) {
dp[i - j] = max (dp[i - j], i - j);
dp[j] = max(dp[j], j);
dp[i] = max(dp[i], dp[j] * dp[i - j]);
}
}
return dp[number];
}
};