c++||beats 100%||combinatorics
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n#define ll long long\nlong long nCr(long long n, long long r) {\n    if (r > n) return 0;\n    if (r == 0 || r == n) return 1; \n    if (r > n - r) {\n        r = n - r;\n    }\n    long long result = 1;\n    for (int i = 0; i < r; i++) {\n        result *= (n - i); \n        result /= (i + 1); \n    }\n\n    return result;\n}\n    string kthSmallestPath(vector<int>& a, int k) \n    {\n        ll V=a[0];\n        ll H=a[1];\n        string ans="";\n        while(V||H)\n        {\n            if(V)\n            {\n                long long prev=nCr(H+V,H);\n                long long curr=nCr(H+V-1,H);\n                ll used=prev-curr;\n                if(used<k)\n                {\n                    ans.push_back(\'V\');\n                    V--;\n                    k-=used;\n                }\n                else\n                {\n                    ans.push_back(\'H\');\n                    H--;\n                }\n            }\n            else\n            {\n                ans.push_back(\'H\');\n                H--;\n            }\n        } \n        return ans;   \n    }\n};\n```
['Combinatorics', 'C++']