정답 코드
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int f[3];
int start[3], end[3];
for(int i=0; i<3; i++) {
cin>>f[i];
}
for(int i=0; i<3; i++) {
cin>>start[i]>>end[i];
}
int start_time = *min_element(start, start+3);
int end_time = *max_element(end, end+3);
int fee=0;
for(int i=start_time; i<end_time; i++) {
int count=0;
if(start[0]<=i && i<end[0]) {
count++;
}
if(start[1]<=i && i<end[1]) {
count++;
}
if(start[2]<=i && i<end[2]) {
count++;
}
fee+=count*f[count-1];
}
cout<<fee<<endl;
return 0;
}