#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

class Person
{
	string first;
    string last;
    int age;

public:
	Person(string first_name, string last_name, int the_age);

	string getFirstName() const { return first; }
	string getLastName() const { return last; }
    int getAge() const { return age; }
};

Person::Person(string first_name, string last_name, int the_age){
	first = first_name;
	last = last_name;
	age = the_age;
} 

int main()
{
	vector<Person> people;
	people.emplace_back("John", "Cool-Johnson", 15);
	people.emplace_back("Paul", "Bob", 1000);

	string::size_type max_fname = 10;
	string::size_type max_lname = 9;
	string::size_type max_age = 3;

	for(const Person &p : people)
	{
    	max_fname = max(max_fname, p.getFirstName().size());
	    max_lname = max(max_lname, p.getLastName().size());
    	max_age = max(max_age, to_string(p.getAge()).size());
	}

	cout << left << setfill(' ');
	cout << setw(max_fname) << "First Name" << "  " << setw(max_lname) << "Last Name" << "  " << setw(max_age) << "Age" << "\n";
	cout << setfill('-');
	cout << setw(max_fname) << "" << "  " << setw(max_lname) << "" << "  " << setw(max_age) << "" << "\n";
	cout << setfill(' ');

	for(const Person &p : people)
	{
    	cout << setw(max_fname) << p.getFirstName() << "  " << setw(max_lname) << p.getLastName() << "  " << setw(max_age) << p.getAge() << "\n";
	}

	cout << people.size() << " people\n";

	return 0;
}