#C994. Continuous Session Check

    ID: 54088 Type: Default 1000ms 256MiB

Continuous Session Check

Continuous Session Check

In this problem, you are given a series of timestamps (in seconds) representing user activity and a timeout period (in seconds). Your task is to determine whether the session is continuous. A session is considered continuous if the time difference between every two consecutive timestamps does not exceed the specified timeout. Formally, given a sequence of timestamps \(t_1, t_2, \ldots, t_n\), the session is continuous if for every \(i\) with \(2 \le i \le n\), it holds that \(t_i - t_{i-1} \le timeout\). For sessions with zero or one timestamp, the session is trivially continuous.

inputFormat

The input is provided via standard input (stdin) in three lines:

  1. The first line contains an integer \(n\) representing the number of timestamps.
  2. The second line contains \(n\) space-separated integers representing the timestamps in seconds. If \(n = 0\), this line will be empty.
  3. The third line contains an integer representing the timeout period in seconds.

outputFormat

Output a single line to standard output (stdout) which is either True or False indicating whether the session is continuous.

## sample
4
100 105 120 130
20
True