• + 0 comments

    include

    include

    include

    include // For controlling the output format

    using namespace std;

    int main() { // Step 1: Read the number of elements (not actually used, we just need the list) int n; cin >> n;

    // Step 2: Read the list of numbers into a vector
    vector<int> nums(n);
    for (int i = 0; i < n; ++i) {
        cin >> nums[i];
    }
    
    // Step 3: Calculate the average
    double sum = 0;
    for (int num : nums) {
        sum += num;
    }
    double average = sum / n;
    
    // Step 4: Find the minimum number
    int min_val = *min_element(nums.begin(), nums.end());
    
    // Step 5: Output the results
    // Print the average rounded to 1 decimal place
    cout << fixed << setprecision(1) << average << endl;
    
    // Print the average rounded to the nearest whole number
    cout << round(average) << endl;
    
    // Print the smallest number
    cout << min_val << endl;
    
    return 0;
    

    }