eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Transfer

Transfer

Vasya has one package of mobile phone operator Ratsviyk and \textbf{S0} tugriks on its account. (Tugrik is the currency in Vasya’s country. 0.01 of tugrik is a cent). Also he has \textbf{n} packages of Eciujd which is the satellite of Ratsviyk. There are \textbf{Si} tugriks on the account of the \textbf{i}-th package of Eciujd. There was a new tariff plan on Ratsviyk and Vasya want to go into it. For this purpose it is necessary to have at least \textbf{S} tugriks on the account. Vasya hasn’t any money, that is why he don’t want to buy new bill replenishment, to fill up the Ratsviyk account to the necessary sum. But the escape exists. On Ratsviyk there is such possibility as to transfer money between each others. The transfer is the sending of some money from one account to another. It is possible to send only an integer amounts of tugriks, not smaller than 5. The cost of the transfer is 10 cents which is draw from the account from which money was sended. Transfer can be made only if after it on the account remains at least 5 tugriks. Since Eciujd is the satellite of Ratsviyk, then subscribers of Eciujd also can participate in this transfers. Giving \textbf{S0}, \textbf{S}, \textbf{n}, \textbf{Si} (1 ≤ \textbf{i} ≤ \textbf{n}) find whether it is possible to go into new tariff plan without buying new bill replenishment and if so find the minimum number of transfers needed for this. \InputFile In the first line of input there is an integer \textbf{n} (\textbf{0} ≤ \textbf{n} ≤ \textbf{1000}), \textbf{S0} and \textbf{S}. In the second line are written down through a blank numbers \textbf{S1}, \textbf{S2}, …, \textbf{Sn}. All numbers \textbf{S}, \textbf{Si} (\textbf{0} ≤ \textbf{i} ≤ \textbf{n}) - real numbers from the interval \[\textbf{0.01}, \textbf{10000.00}\] with exactly with two digits after a decimal point. \OutputFile Output the minimum number of transfers needed to go into new tariff plan or -1 if it is impossible without buying a new bill replenishment.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
2 10.10 16.00
10.10 7.10
Вихідні дані #1
2