#include<iostream>
 using namespace std;
 int main()
 {
     float *averageList;
    long int *idList;
     int i, n;
    float totalAverage;
     cout << "  please enter number of student : ";
    cin >> n;
     averageList = new float[n];
    idList = new long int[n];
     if (!idList || !averageList)
    {
        cout << "  not enough memory!";
         return 0;
     }
    totalAverage = 0;
     for (i = 0; i < n; i++)
    {
        cout << "  enter id and average : \n";
         cin >> idList[i] >> averageList[i];
            // or cin >> idList + i >> averageList + i;
        totalAverage += averageList[i];
     }
     totalAverage /= n;
     cout << "  good students :\n";
    for (i = 0; i < n; i++)
        if (averageList[i] > totalAverage)
            cout <<"  " <<idList[i];
     delete[] averageList;
    delete[] idList;
     return 0;
 }
