$$$\textit{Aswad}$$$ is a member of a Telegram group chat with $$$n$$$ participants, he has a unique communication style. Although $$$\textit{Aswad}$$$ he doesn't like engaging in conversations, he still like to participate in the group by responding to messages.
However, instead of responding immediately, $$$\textit{Aswad}$$$ waits for a set amount of time before sending a message. Specifically, $$$\textit{Aswad}$$$ waits for $$$k$$$ minutes after the previous message is sent before responding.
It's $$$\textbf{important}$$$ to note that if another message is sent during the waiting period, $$$\textit{Aswad}$$$ will ignore the previous message and will wait for a new $$$k$$$ minutes. This approach allows $$$\textit{Aswad}$$$ to take his time in crafting a response and to avoid getting caught up in the rapid pace of the chat.
Given a list of $$$m$$$ timestamps for when messages were sent in the group chat, and the number of minutes $$$k$$$. your task is to determine how many messages $$$\textit{Aswad}$$$ has sent in the group chat.
The first line of the input contains a single integer $$$t$$$ $$$(1 \leq t \leq 1000)$$$ — the number of test cases. The description of the test cases follows.
The first line of each test case contains three integers $$$n,k$$$, and $$$m$$$, where $$$n$$$ represents the number of members in the group chat, $$$k$$$ represents the time in minutes that $$$\textit{Aswad}$$$ waits before responding, and $$$m$$$ represents the number of messages sent in the group chat $$$(1 \leq n \leq 1000 , 1 \leq k , m \leq 1440)$$$.
The next $$$m$$$ lines each contain an $$$ID$$$ for the participant who sent the message, and a timestamp in the format HH:MM, representing the time when the message was sent in the group chat $$$(1 \leq ID \leq n , 0 \leq HH \leq 23 , 0 \leq MM \leq 59)$$$.
For each test case, output a single integer on a new line representing the number of messages that $$$\textit{Aswad}$$$ has sent in the group chat.
31 1 11 00:001 10 11 23:596 5 51 01:002 02:001 03:003 03:063 03:07
1 1 4
14 15 61 03:453 04:004 04:071 04:303 04:412 06:09
3
in the second example: $$$\textit{Aswad}$$$ will respond to the third, fifth and the sixth message because the message after each of them was sent exactly after k minuites, so the answers will be 3.
| Name |
|---|


