Company: Eternal
Difficulty: easy
Repeated Access Detection A company's security system records N employee accesses to a secure room in chronological order. The i -th record contains employee ID id[i] and timestamp time[i] , measured in seconds. For each employee, their first recorded access is not counted. Every later access is a **rapid repeated access** when the difference from that same employee's immediately previous access is at most K seconds. Count all rapid repeated accesses. Input The first line contains N K . The second line contains N integers id[0] ... id[N-1] . The third line contains N strictly increasing integers time[0] ... time[N-1] . Output Print the total number of rapid repeated accesses. Constraints 1 <= N <= 200000 1 <= id[i] <= 10^9 1 <= time[i] <= 10^9 time[i] < time[i+1] 1 <= K <= 10^9 The answer fits in a 32-bit signed integer. Example Input: 7 5 1 2 1 3 2 1 2 1 3 5 7 8 12 13 Output: 3 Explanation Employee 1 has gaps 4 and 7, so only the first repeat is ra