Problem Link: http://acm.epoka.edu.al:8888/en/problem-pid-c50b?ps=1&smt=9&smpwid=0
#include <bits/stdc++.h>
using namespace std;
int main()
{
int age,i,j,k,l,m,n,sum=0,el,yo,ct;
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
vector<int>v;
for(i=1;i<=10000;i++)
{
el=0;
yo=0;
ct=0;
for(j=1;j<=100;j++)
{
cin>>age;
if(age==-1)
{
break;
}
if(age>=7 && age<=12)
{
yo++;
}
else if(age>12)
{
el++;
}
}
if((yo+el)>=10)
{
sum=sum+(yo+el)*500;
}
else
{
sum=sum+(yo)*500;
sum=sum+ (el)*800;
}
//cout<<sum<<endl;
}
cout<<sum<<endl;
return 0;
}
0 comments:
Post a Comment