//@Author Damien Bell
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
    int choice=0, i, total=0, j=0;
    double avg=0;
    
    cout << "Enter a number between 1 and 1776: ";
    cin >> choice;
    
    while(choice <1 || choice > 1776){
        cout << "Please enter a valid value, between 1 and 1776: ";
        cin >> choice; 
    }
    
    for(i=1776; i >= choice; i--){
        total += i;
        cout << setw(8) << i;
        j++;
    }
    avg = total /double(j);
    cout <<endl <<endl;
    cout << "Numbers output: " << j << endl <<"Total of numbers output: " <<total <<endl;
    cout << "Average of numbers output: " <<avg <<endl;
    
    
    
 return 0;
}

//Select a number, between 1 and 1776
// Count down from 1776, to our number.
//Print out the total, average;

//1772
//1776,1775,1774,1773, 1772
