## Discerning Discounts

View as PDF

Points: 3 (partial)
Time limit: 2.0s
Java 1.4s
Python 2 3.0s
Python 3 3.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 items in a store, with the -th item having an original price of and a discount of in percent off. He will also tell you , his threshold.

#### Input Specification

The first line of the input will contain two integers representing the number of items, and , his threshold.

The next lines will contain two integers and where .

#### Output Specification

Output an integer 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 , the second item cost , the third item cost , the forth item cost , and the fifth item cost .

• KingT  commented on April 26, 2020, 1:09 p.m.

Can someone help with my code. On test case #5 it gives the wrong answer but I don't understand why.

• Jonathan_Uy  commented on April 27, 2020, 2:03 p.m.

Floats don't go to as many decimal places as doubles, causing you to basically get a rounding error. Just replace "float" with "double" in your code and you pass.

• 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