0
已解决
陶笛龙
中级守护
中级守护
题目链接: 酷町堂:8346
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,s,a,h=0,s1=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>s>>a;
if(a==1){
if(s-4<0) continue;
else s1+=4;
}
else if(a==2){
if(s-3<0) continue;
else s1+=3;
}
else if(a==3){
if(s-2<0)continue;
else s1+=2;
}
h+=s;
}
cout<<h<<" "<<h+s1;
return 0;
}
//25 35