Uses crt;
var
sum,x,itog: real;
i,y: integer;
begin
i:=1;
itog:=0;
write ('Start summa: ');
readln (sum);
while (itogbegin
write ('¹',i,': ');
i:=i+1;
readln (x);
write ('Kol-vo: ');
readln (y);
itog:=itog+y*x;
end;
if (itog>sum) then
writeln ('Itog: ',itog-y*x)
else
writeln ('Itog: ',itog);
end.