I'm struggling with a problem can someone please help me ?

Правка en5, от Bryma, 2021-04-13 16:30:32

In celebration of the 4th of July, Aldo goes to an American buffet. In this buffet, there are different types of dishes. The -th plate fills a percentage of your stomach and gives you a percentage of happiness.

Aldo can eat a plate at the most once, because he wants variety, and he wants to achieve 100% happiness without going over 100% full. Help Aldo determine the maximum number of dishes he can eat while satisfying his restrictions.

Notes:

It is valid to exceed 100% happiness, but not 100% fullness. It is guaranteed that Aldo can always reach 100% happiness.

Input : The first line contains an integer, the number of dishes. The following lines contain 2 integers each, and the percentages of fullness and happiness that they cause, respectively.

Example input :

  1. 3
  2. 60 50
  3. 30 50
  4. 50 60

Answer : 2

  1. 2
  2. 100 20
  3. 100 100

Answer : 1

Please, i need at least a hint. I tried to solve it solo but i can't.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en7 Английский Bryma 2021-04-13 16:31:34 16
en6 Английский Bryma 2021-04-13 16:31:16 21
en5 Английский Bryma 2021-04-13 16:30:32 5 Tiny change: 'iness.\n\nOutput : \nTh' -> 'iness.\n\nInput : \nTh'
en4 Английский Bryma 2021-04-13 16:30:10 195
en3 Английский Bryma 2021-04-13 16:29:36 21
en2 Английский Bryma 2021-04-13 16:28:45 29
en1 Английский Bryma 2021-04-13 16:28:17 798 Initial revision (published)