Two Choices
We have only two choices:\n1. Punch minutes and seconds as is,\n2. or punch minutes - 1 and seconds + 60.\n\nWe just need to check that the number of minutes an
We have only two choices:\n1. Punch `minutes` and `seconds` as is,\n2. or punch `minutes - 1` and `seconds + 60`.\n\nWe just need to check that the number of minutes and seconds is valid (positive and less than 99).\n\nFor example, for `6039` seconds, we can only use the second option (`99:99`), as the first option is invalid (`100:39`).\n\n**C++**\n```cpp\nint minCostSetTime(int startAt, int moveCost, int pushCost, int targetSeconds) {\n    auto cost = [&](int pos, int m, int s){\n        if (min(m, s) < 0 || max(m, s) > 99)\n            return INT_MAX;\n        int res = 0;\n        for (auto digit : to_string(m * 100 + s)) {\n            res += pushCost + (pos == digit - \'0\' ? 0 : moveCost);\n            pos = digit - \'0\';\n        }\n        return res;\n    };\n    int m = targetSeconds / 60, s = targetSeconds % 60;\n    return min(cost(startAt, m, s), cost(startAt, m - 1, s + 60));\n}\n```
['C']