For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to 987654321.
Input contains integer number N (1<=N<=106)
Write answer to the output.
8
0
#include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
int n = 0;
std::cin >> n;
if(n <= 8) {
std::cout << 0 << std::endl;
} else if(n == 9) {
std::cout << 8 << std::endl;
} else {
std::cout << 72;
while(n---10) {
std::cout << "0";
}
std::cout << std::endl;
}
return 0;
}