Modulo and Double
First, after any multiplication, we get rid of trailing zeros, counting them in c.\n\nNow, how to find out the last 5 digits of the product? For that, we multip
First, after any multiplication, we get rid of trailing zeros, counting them in `c`.\n\nNow, how to find out the last 5 digits of the product? For that, we multiply numbers, remove trailing zeros, and keep last `n` digits using the modulo operation. Simple.\n\nWhat about the first 5 digits? We could use `double`, multiply numbers, and *divide* the result by 10 until we only have 5 digits before the decimal point. The precision seems to be sufficient enough.\n\n**C++**\n```cpp\nstring abbreviateProduct(int left, int right) {\n    long long suff = 1, c = 0, total = 0, max_suff = 100000000000;\n    double pref = 1.0;\n    for (int i = left; i <= right; ++i) {\n        pref *= i;\n        suff *= i;\n        while (pref >= 100000) {\n            pref /= 10;\n            total = total == 0 ? 6 : total + 1; \n        }\n        while (suff % 10 == 0) {\n            suff /= 10;\n            ++c;\n        }\n        suff %= max_suff;\n    }\n    string s = to_string(suff);\n    return to_string((int)pref) + (total - c <= 10 ? "" : "...") \n            + (total - c < 5 ? "" : s.substr(s.size() - min(5LL, total - c - 5))) + "e" + to_string(c);\n}\n```
['C']