// language C with STL(C++)
// 剑指57-II
// https://leetcode-cn.com/problems/he-wei-sde-lian-xu-zheng-shu-xu-lie-lcof/
class Solution {
public:
vector<vector<int>> findContinuousSequence(int target) {
vector<vector<int>> ans;
int i =0, total = 0;
while(total<=target){
total += ++i;
}
total -= i--;
while(i>=2){
int temp = target-total;
if(temp%i == 0){
vector<int> waibiwaibi;
temp = temp/i;
for(int j = 1; j<=i; j++)
waibiwaibi.push_back(j+temp);
ans.push_back(waibiwaibi);
}
total -= i--;
}
return ans;
}
};