From ac0a1ea7dabaee1b986927efb25e94a3a091fff5 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Mon, 13 Feb 2017 10:29:05 +0700 Subject: Update others/volume1 --- others/volume1/040.pas | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 others/volume1/040.pas (limited to 'others/volume1/040.pas') diff --git a/others/volume1/040.pas b/others/volume1/040.pas new file mode 100644 index 0000000..919304c --- /dev/null +++ b/others/volume1/040.pas @@ -0,0 +1,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. -- cgit 1.4.1