๋ฌธ์
ํ์ด
#include <bits/stdc++.h>
using namespace std;
int timeCount[101], feeTable[3], parkingTime[3][2], amount;
int main() {
// ์๊ธ ํ
์ด๋ธ ์
๋ ฅ
scanf("%d %d %d", &feeTable[0], &feeTable[1], &feeTable[2]);
for (int i = 0; i < 3; i++) {
// ์ฃผ์ฐจ์๊ฐ ์
๋ ฅ
scanf("%d %d", &parkingTime[i][0], &parkingTime[i][1]);
// ์ฃผ์ฐจ์๊ฐ๋งํผ ๊ธฐ๋ก
for (int t = parkingTime[i][0]; t < parkingTime[i][1]; t++) timeCount[t]++;
}
// ๊ธฐ๋ก๋ ์ฃผ์ฐจ์๊ฐ๋งํผ ์๊ธ ๊ณ์ฐ
for (int i = 1; i < 101; i++)
amount += (feeTable[timeCount[i] - 1] * timeCount[i]);
printf("%d", amount);
}