SPOJ MEOWIST

The Problem
This problem should be a practise problem
It took me 20mins to solve it =) , I am too rusted lately but hopefully I will post a new problem everyday from now on

#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>

using namespace std;

class person{
public:
int age;
[...]