The first line contains the number of skills N, the enemy's health M, and the extra mana K added on each repeat of the same skill. (1≤N,M,K≤100)
Each of the next N lines describes one skill with the mana it needs, X, and the health it removes, Y. (1≤X,Y≤100)
Every input has at least one combination that brings the enemy's health to exactly 0.