#include <stdio.h>

int main(void)
{
int n = 1;
int S = 1;

while (S <= 2000) {
++n;
S += n * n;
}

printf("n = %d, S = %d\n", n, S);
}