const
nhap='thoigian.inp';
xuat='thoigian.out';
var a,b,c,kt,i,s,m:longint;
begin
assign(input,nhap);reset(input);
assign(output,xuat);rewrite(output);
read(m); s:=0;i:=0;
while s<=m do
begin
i:=i+1;
s:=s+i*i;
end;
write(i-1);
close(input);close(output);
end.
uses crt;
var m,i,k,s:longint;
begin
clrscr;
write('Nhap m=');
readln(m);
write('Nhap k=');
readln(k);
s:=0;
for i:=1 to m do
s:=s+i*i;
writeln(s);
readln
end.
var m,i,s:integer;
begin
write('m=');readln(m);
s:=0;
for i:=1 to m do s:=s+(i*i);
if (s<m) and (s=m) then write(s);
readln;
end.
lm lại
var m,k,i,s:integer;
begin
write('m=');readln(m);
write('k=');readln(k);
s:=0;
for i:=1 to k do s:=s+(i*i);
if (s<m) and (s=m) then write(s);
readln;
end.