#include<iostream>
#include<string>
#include<iomanip>
using namespace std;
class tracker
{
    private:
    string name;
    string id;
    int logs;
    public:
    void sname(string n)
    {
        name=n;
    }
    void setlogs(int l)
    {
        logs=l;
    }
    string getName()const
    {
        return name;
    }
    string getId()const
    {
        return id;
    }
    int getLogs()const
    {
        return logs;
    }
    static void calcndis()
    {
        string n,i;
        int l;
        cin>>n>>i>>l;
        if(l<1||l>10)
        {
            cout<<"Invalid input"<<endl;
            return;
        }
        double tothours=0.0;
        double tottasks=0.0;
        bool valid = true;
        for(int k =0; k<l; ++k)
        {
            int hours, tasks;
            if(!(cin>>hours>>tasks))
            {
                valid=false;
                break;
            }
        }
        if(hours<1||hours>24||tasks<0||tasks>100)
        {
            valid=false;
        }
        totalHours+=hours;
        totalTasks+=tasks;
    }
    if(!valid)
    {
        cout<< "Invalid input" <<endl;
    }
    else
    {
        double average=tottasks/tothours;
        cout<<fixed<<setprecision(2)<<averagee>>endl;
    }

};
int main()
{
    tracker::calcndis();
    return 0;
}