Jelly Flavours

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Amy is a big fan of jelly, and wishes to buy some for dessert. There are a total of nn flavours of jelly, numbered 00 to n1n-1. Store A sells jelly of flavour ii for a\[i]a\[i] dollars a piece, whereas Store B sells it for b\[i]b\[i] dollars a piece. Amy can spend up to xx dollars in Store A and up to yy dollars in Store B.

Help Amy find the maximum number of unique flavours of jelly she can purchase.

제한

  • 1n20001 \leq n \leq 2000
  • 0x,y10;0000 \leq x, y \leq 10\\;000
  • 0a\[i],b\[i]10;0000 \leq a\[i], b\[i] \leq 10\\;000 (for all 0in10 \leq i \leq n-1)