Source Code:
// 5217.c
#include<stdio.h>
int main(){
// args
long long n, // the num of the cards and...
d; // the number of divisors
// method 1: stimulate, method 2: mathmetics
// inputs
scanf("%ld", &n);
// method 1:
// 1. find the number of divisors, d
// 2. if d % 2 == 1, print
// 1.
printf("%d", 1);
for (long long i = 2; i * i <= n; ++i) { // traverse
printf(" %lld", i * i);
}
return 0;
}