For this Question: When Alexa writes an integer, he uses a comma for every third digit from the right. How many commas will be used in total when she writes each integer from 1 to N (inclusive) once?The input consists of a single integer N.

<b>Constraints</b>
1 &le; N &le; 10<sup>15</sup>
N is an integer.Print the total number of commas.<b>Sample Input 1</b> 
1010
<b>Sample Output 1</b> 
11

<b>Explanation</b>
For 1 to 999, the number of commas used is 0.
For 1000 there is 1 comma --> 1,000.
For 1001 there is 1 comma --> 1,001.
For 1002 there is 1 comma --> 1,002.
For 1003 there is 1 comma --> 1,003.
For 1004 there is 1 comma --> 1,004.
For 1005 there is 1 comma --> 1,005.
For 1006 there is 1 comma --> 1,006.
For 1007 there is 1 comma --> 1,007.
For 1008 there is 1 comma --> 1,008.
For 1009 there is 1 comma --> 1,009.
For 1010 there is 1 comma --> 1,010.

Hence the total number of commas required is 11., I have written this Solution Code: #include <bits/stdc++.h>
 
using namespace std;
using lint = long long;
 
void solve() {
    lint n;
    cin >> n;
 
    lint ans = 0, ten = 1;
    for (int k = 1; k <= 5; ++k) {
        ten *= 1000;
        ans += max(n - ten + 1, 0LL);
    }
 
    cout << ans << "\n";
}
 
int main() {
    solve();
 
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?