For this Question: Given two integers n and k, Find the lexicographical nth palindrome of k digitsInput contains of two integers n and k separated by spaces.

Constraints:-
1 <= n <= 10000000
1 <= k <=20Single number that is the nth palindrome of k digitsSample Input: 
5 4

Sample Output:
1441

Sample Input:-
2 2

Sample Output"
22

Explanation:-
For test2:-
first palindrome of length 2 is 11
second palindrome of length 2 is 22
so ans is 22., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

void nthPalindrome(long long  n, long long  k)
{
    // Determine the first half digits
    long long  temp = (k & 1) ? (k / 2) : (k/2 - 1);
    long long  palindrome = lround(pow(10, temp));
    palindrome += n - 1;

    // Print the first half digits of palindrome
    printf("%d", palindrome);

    // If k is odd, truncate the last digit
    if (k & 1)
        palindrome /= 10;

    // print the last half digits of palindrome
    while (palindrome)
    {
        printf("%d", palindrome % 10);
        palindrome /= 10;
    }
    printf("\n");
}

// Driver code
int main()
{
 long long  n,k;
 cin>>n>>k;
    nthPalindrome(n, k);
    return 0;
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?