#include #include #include using namespace std; #define MAX 10001 int a[MAX]; int visited[MAX]; int main() { memset(visited, -1, sizeof(visited)); for (int n=1; n0; k++) { int x = k/a[n-k*k]; if (x