Go Back
Pritam Hates Bus Conductor (200)
Description

As you all know, Pritam loves to go on trips. Hence buses are like lifeline for Pritam. But nothing ever ideal happens with Pritam as he wishes for.
Bus conductor of the buses which Pritam aboards are usually bad at Math. So this always costs Pritam some extra money. Back at home, Pritam was reviewing some old tickets and the amount he paid for them.
But as usual Pritam is busy planning for his future trips. So he needs your help again.
So given a ticket code and the expression for total amount of ticket your task is to count the total number of ticket for which Pritam paid extra money and print those ticket codes in which they appear in the input sequence.

Input

The first line of input contain an integer T denoting the number of test cases.
First line of each test case contains N.
Next N lines contain space separated input of ticket code and expression for bus fare calculation.
Each line contains CODE seperated by space with expression of PxCOST=SUM Here P, COST and SUM are integers

Output

For each test case output the number of invalid tickets and the ticket codes which are invalid.

Constraints

1 <= T <= 100
1 <= N <= 103
1 <= |CODE| <= 102
1 <= P, COST, SUM <= 109

Example
Copy Input

Input:
1
5
SAB180X1 2x9=18
SAB180X2 2x3=6
SAB180X3 12x9=118
SAB180X4 7x7=50
SAB180X5 3x9=17

Output:
3
SAB180X3
SAB180X4
SAB180X5

Explanation

Code for 3rd, 4th and 5th ticket in the input sequence is incorrect. Hence count of invalid tickets is 3.

Single Round Match #02
3 hour contest



Announcement
Important:
There was a mistake encountered in setting of SRM02A and SRM02B. Points for Wrong Answer has been retracted. You can make submissions for SRM02A and SRM02B now. We apologise for the inconvenience.
For SRM02A: Output should have an exact precision of 2 digits after decimal.
Constraints are 1 <= T <= 100000

Problem Tags
strings

Supported by our Coding Partner