#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int N = 100;
pair<int, int> p[N + 10];
int main() {
// freopen("in.txt", "r", stdin);
int R, Y, B;
scanf("%d%d%d", &R, &Y, &B);
int n;
cin >> n;
int x, y;
for (int i = 1; i <= n; i++) {
scanf("%d%d", &x, &y);
p[i] = make_pair(x, y);
}
int ans = 0;
for (int i = 1; i <= n; i++) {
switch (p[i].first) {
case 0: // 道路
case 1: // 红灯
ans += p[i].second;
break;
case 2: // 黄灯-->红灯-->绿灯
ans += p[i].second + R;
break;
case 3: // 绿灯
break;
}
}
printf("%d\n", ans);
return 0;
}
/**
30 3 30
8
0 10
1 5
0 11
2 2
0 6
0 3
3 10
0 3
*/
201812-1 小明上学
最新推荐文章于 2022-06-22 10:38:01 发布