about summary refs log tree commit diff
path: root/others/volume1/040.pas
blob: 919304c281dff5244cada97f38bc03472b00bce9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var
  n, i, c: int16;
  x, a, b: int32;
  s: array of boolean;

begin
  c := 0;
  readln(n, x);
  setlength(s, n);
  for i := 0 to n - 1 do
    s[i] := false;
  for i := 0 to n - 1 do
    begin
      readln(a, b);
      if (a <= x) and
         (x <= b) then
        begin
          inc(c);
          s[i] := true
        end
    end;
  writeln(c);
  for i := 0 to n - 1 do
    if s[i] then
      write(i + 1, ' ');
  writeln
end.