Small program in any programming language

Employer
[no-member:pro]Константин[/no-member:pro]
Project parameters
Type of cooperationOne-time project
SectionSoftware development
Prepaymentwithout prepayment
Payment methodsBank transfer, Electronic money
Acceptance of requestsfrom Jan 26, 2019 until Feb 1, 2019
Project description
You need to write a small program to solve a school-level problem in any programming language.
Task.
You decided to order a pizza with home delivery. It is known that for customers who have made an order for an amount of more than C rubles, delivery is free, when ordering for C rubles and less delivery costs B rubles.
You have already chosen a product worth A rubles. There are still N goods worth d1, ..., dNruble, each in a single copy. They can also be included in the order.
How to spend the least money and get a home already selected goods in A rubles?
Input data
First, the numbers A, B, C, N are entered, and then N of the numbers d1, ..., dN.
All numbers are integers, 1 ≤ A ≤ 1000, 1 ≤ B ≤ 1000, 1 ≤ C ≤ 1000, 0 ≤ N ≤ 1000, 1 ≤ di ≤ 1,000,000.
Output
First, you need to specify the total amount of money that you will have to spend. If you plan to make an additional order with the expectation of free delivery, then then display the number of these goods and their numbers in increasing order. If you are going to pay for the delivery yourself, then you will be able to enter one number -1 (minus one).
Task.
You decided to order a pizza with home delivery. It is known that for customers who have made an order for an amount of more than C rubles, delivery is free, when ordering for C rubles and less delivery costs B rubles.
You have already chosen a product worth A rubles. There are still N goods worth d1, ..., dNruble, each in a single copy. They can also be included in the order.
How to spend the least money and get a home already selected goods in A rubles?
Input data
First, the numbers A, B, C, N are entered, and then N of the numbers d1, ..., dN.
All numbers are integers, 1 ≤ A ≤ 1000, 1 ≤ B ≤ 1000, 1 ≤ C ≤ 1000, 0 ≤ N ≤ 1000, 1 ≤ di ≤ 1,000,000.
Output
First, you need to specify the total amount of money that you will have to spend. If you plan to make an additional order with the expectation of free delivery, then then display the number of these goods and their numbers in increasing order. If you are going to pay for the delivery yourself, then you will be able to enter one number -1 (minus one).