Const
n = 100;
Var
y:array[1..n] of integer;
x,i,k:integer;
Begin
Randomize;
Write('x = ');
ReadLn(x);
Write('y(',n,'):');
y[1]:=1;
Write(' ',y[1]);
For i:= 2 to N do
Begin
y[i]:=y[i-1]+random(n)+1;
Write(' ',y[i]);
if (y[i-1] < x)and(x < y[i]) then k:=i;
End;
WriteLn;
Write('k = ',k)
End.