Universal Cup Judging System

Universal Cup

Süre Sınırı: 2 s Bellek Sınırı: 1024 MB Toplam puan: 100 Hack'lenebilir ✓
İstatistikler

Bored during the vacation, Eric decided to develop and play a game called Carrot Click Game, and the rules are as follows:

In this game, Eric initially starts the game with $0$ carrots and $s$ equal to $1$.

Then, every second, he can take one of two actions:

  1. Click and get $s$ carrots.
  2. Choose an integer $i$ $(1 \le i \le N)$. Then, pay $A_i$ of the carrots you have and buy the $i$-th speed effect. In this case, $s$ is increased by $B_i$. (You can also buy again a previously bought speed effect).

Let's help Eric, who has exhausted all his energy developing the game, by finding out how many carrots he can obtain after playing the game for $K$ seconds!

Input

The first line contains two space-separated integers $N$ and $K$.

The $i$-th line of the following $N$ lines contains two space-separated integers $A_i$ and $B_i$.

Output

Print the maximum number of carrots that can be obtained after playing the game for $K$ seconds.

Constraints

  • $1\le N,K\le 100$
  • $1\le A_i,B_i\le 50$

Scoring

No. Points Constraints
$1$ $3$ $K \le 2$
$2$ $12$ $N \le 4$; $K \le 10$
$3$ $20$ $N = 1$
$4$ $65$ No additional constraints

Examples

Input 1

2 4
1 2
2 5

Output 1

6

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.