#include <iostream>
using namespace std;
int main(){
int cost, n, a, i, j;
double add, sum, seat;
while(!cin.eof()){
cin >> cost >> seat >> n;
sum=0; add=0;
for(i=0; i<n; i++){
cin >> a;
for(j=0; j<a; j++){
sum = sum + 1;
if(sum/seat <= 0.2)
add = add + 0.7 * cost;
else if(sum/seat <= 0.4)
add = add + 0.8 * cost;
else if(sum/seat<= 0.6)
add = add + 0.9 * cost;
else add = add + cost;
}
}
if(!cin.eof())
cout << add -cost*seat *0.3<< endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(){
int cost, n, a, i, j;
double add, sum, seat;
while(!cin.eof()){
cin >> cost >> seat >> n;
sum=0; add=0;
for(i=0; i<n; i++){
cin >> a;
for(j=0; j<a; j++){
sum = sum + 1;
if(sum/seat <= 0.2)
add = add + 0.7 * cost;
else if(sum/seat <= 0.4)
add = add + 0.8 * cost;
else if(sum/seat<= 0.6)
add = add + 0.9 * cost;
else add = add + cost;
}
}
if(!cin.eof())
cout << add -cost*seat *0.3<< endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main(){
int cost, n, a, i, j;
double add, sum, seat;
while(!cin.eof()){
cin >> cost >> seat >> n;
sum=0; add=0;
for(i=0; i<n; i++){
cin >> a;
for(j=0; j<a; j++){
sum = sum + 1;
if(sum/seat <= 0.2)
add = add + 0.7 * cost;
else if(sum/seat <= 0.4)
add = add + 0.8 * cost;
else if(sum/seat<= 0.6)
add = add + 0.9 * cost;
else add = add + cost;
}
}
if(!cin.eof())
cout << add -cost*seat *0.3<< endl;
}
return 0;
}