等红灯不是固定的30 读题啊读题读题读题
直接给人家 constr int wait = 30
了 我是大傻子hhhhh
#include <bits/stdc++.h>
using namespace std;
int main()
{
int r, y, g;
cin >> r >> y >> g;
int n;
cin >> n;
int ans = 0;
for(int i = 0; i < n; i++)
{
int deng, time, temp;
cin >> deng >> time;
if(deng == 0 || deng == 1 ) ans += time;
else if( deng == 2)
{
ans += (time + r);
}
}
cout << ans;
return 0;
}