#include <stdio.h> #include <string.h> #define MAX 10001 #define TIMAX 30000 long long a[MAX]; bool seen[TIMAX]; int main() { memset(seen, 0, sizeof(seen)); for (int n=0; n<MAX; n++) { for (a[n]=1;; a[n]++) { long long t = a[n/2]*a[n]; if (t>=TIMAX) { goto end; } else if (!seen[t]) { seen[t] = true; printf("%d %lld\n", n, t); break; } } } end: return 0; }