ACM The Dajte Express




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;
}

Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment