#C1001. Treasure Hunt: Count Eligible Players

    ID: 39168 Type: Default 1000ms 256MiB

Treasure Hunt: Count Eligible Players

Treasure Hunt: Count Eligible Players

You are given T activity records. Each record contains a player ID and the number of treasures that the player collected during that particular activity. Your task is to determine the number of unique players whose cumulative treasure count is at least K.

For each player, sum up the treasures from all of their activities, and count the player if the sum is greater than or equal to K.

Input/Output: All input is given via standard input (stdin) and all output should be written to standard output (stdout).

Note: If a player appears in multiple records, add their treasure counts together.

inputFormat

The first line contains two integers T and K, where T is the number of activity records and K is the treasure threshold. Each of the following T lines contains two space-separated integers representing a player's ID and the number of treasures collected in that activity.

outputFormat

Output a single integer—the number of unique players whose total number of treasures collected is at least K.## sample

5 10
1 5
2 6
1 6
3 4
2 5
2

</p>