C++ lis
\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& nums, int k) {\n        int res = 0;\n        vector<int> lis(nums.size() / k + 2, INT_MAX);\n    
```\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& nums, int k) {\n        int res = 0;\n        vector<int> lis(nums.size() / k + 2, INT_MAX);\n        for (int i = 0; i < k; ++i) {\n            std::fill(lis.begin(), lis.end(), INT_MAX);\n            int maxLen = 1;\n            lis[maxLen] = nums[i];\n            for (int j = i + k; j < nums.size(); j += k) {\n                auto it = upper_bound(lis.begin() + 1, lis.begin() + maxLen + 1, nums[j]);\n                maxLen = max(maxLen, (int)(it - lis.begin()));\n                *it = min(*it, nums[j]);\n            }\n            res += (nums.size() / k) + (i < (nums.size() % k)) - maxLen;\n        }\n        return res;\n    }\n};\n```
[]