Discerning Discounts

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Java 3.0s
Python 2 7.0s
Python 3 7.0s
Memory limit: 64M

Author:
Problem type

Benji loves his money very much; however, he is also obsessed with wasting money when he sees discounts. What a tragedy!

Benji wants you to help him determine if an item is worth it to purchase.

He found N items in a store, with the i-th item having an original price of c_i and a discount of d_i in percent off. He will also tell you T, his threshold.

Input Specification

The first line of the input will contain two integers N (1 \le N \le 10^6) representing the number of items, and T (0 \le T \le 10^9), his threshold.

The next N lines will contain two integers c_i (1 \le c_i \le 10^9) and d_i (0 \le d_i \le 100) where (0 \le i \le N).

Output Specification

Output an integer K the number of items Benji can purchase whose price is less than or equal to his threshold.

Sample Input

5 7
100 90
100 93
100 95
10 10
10 40

Sample Output

3

Explanation

Benji can buy the second, third, and last item. After discount, the first item cost 10, the second item cost 7, the third item cost 5, the forth item cost 9, and the fifth item cost 6.


Comments


  • 13
    Jeffmagma  commented on June 23, 2017, 6:11 p.m.

    obsessed with wasting money when he sees discounts

    The Steam Summer Sale has started, rip Benji