package csp;
import java.util.Scanner;
public class csp_18_12_01 {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int r = in.nextInt();
int y = in.nextInt();
int g = in.nextInt();
int n = in.nextInt();
int result = 0;
for(int i =0;i<n;i++) {
int a = in.nextInt();
int b = in.nextInt();
if(a==0 || a==1) result += b;
if(a==2) result += b+r;
}
System.out.print(result);
}
}
18-12-01(小明上学)
猜你喜欢
转载自blog.csdn.net/qq_51985653/article/details/121443305
今日推荐
周排行