题目描述
Pinocchio is a very interesting fictional character. Each time he lies, his nose is extended by 1 cm .
Pinocchio and Lampwick are best friends.
But Pinocchio's habit of lying has increased manyfold nowadays which has left Lampwick really upset. As a result, he has decided to maintain a diary recording the length of Pinocchio's nose each day. For this, he asks Pinocchio some questions each day and notes down the length of his nose in centimeters at the end of the day.
For example, the diary containing entries for a week may look like: 1, 2, 2, 3, 4, 5, 5
After N days of carefully analysing Pinocchio's lying habit, Lampwick wants to confront Pinocchio. But for that he needs to find out the number of days when Pinocchio lied atleast once. Can you help him out?
Being a trusting friend, Lampwick assumes Pinocchio was telling the truth on the first day.
Input
First line of input contains T, the number of test cases.
For each of the next T lines, two lines follow. The first line contains an integer N, denoting the number of days. The second line contains N space-separated integers L1, L2, ..., LN representing the length of Pinocchio's nose on different days.
Output
For each test case, output the number of days when Pinocchio lied atleast once , in a new line
Constraints
1 <= T <= 100
1 <= N <= 10^5
1 <= Li <= 5*10^6
Example
Input:
1
7
1 2 2 3 4 5 5
Output:
4
Explanation
For the example given above, Pinocchio lied on days 2, 4, 5 and 6 .Hence, the number of days on which he lied = 4.
输入格式
见题面
输出格式
见题面